@@ -393,8 +393,9 @@ blockCommands = M.fromList $
393 , ("graphicspath", graphicsPath)
393 , ("graphicspath", graphicsPath)
394 -- hyperlink
394 -- hyperlink
395 , ("hypertarget", braced >> grouped block)
395 , ("hypertarget", braced >> grouped block)
396− -- textcolor
397+ , ("textcolor", coloredBlock "color")
397− , ("textcolor", blockTextcolor)
398+ , ("colorbox", coloredBlock "background-color")
398 ] ++ map ignoreBlocks
399 ] ++ map ignoreBlocks
399 -- these commands will be ignored unless --parse-raw is specified,
400 -- these commands will be ignored unless --parse-raw is specified,
400 -- in which case they will appear as raw latex blocks
401 -- in which case they will appear as raw latex blocks
@@ -416,11 +417,11 @@ blockCommands = M.fromList $
416 , "pagebreak"
417 , "pagebreak"
419−blockTextcolor :: PandocMonad m => LP m Blocks
420+coloredBlock :: PandocMonad m => String -> LP m Blocks
420−blockTextcolor = do
421+coloredBlock stylename = do
421 skipopts
422 skipopts
422 color <- braced
423 color <- braced
423− let constructor = divWith ("",[],[("style","color: " ++ color)])
424+ let constructor = divWith ("",[],[("style",stylename ++ ": " ++ color)])
424 inlineContents <|> constructor <$> blockContents
425 inlineContents <|> constructor <$> blockContents
425 where inlineContents = do
426 where inlineContents = do
426 ils <- grouped inline
427 ils <- grouped inline
@@ -694,8 +695,9 @@ inlineCommands = M.fromList $
694 , ("nohyphens", tok)
695 , ("nohyphens", tok)
695 , ("textnhtt", ttfamily)
696 , ("textnhtt", ttfamily)
696 , ("nhttfamily", ttfamily)
697 , ("nhttfamily", ttfamily)
697− -- textcolor
699+ , ("textcolor", coloredInline "color")
698− , ("textcolor", inlineTextcolor)
700+ , ("colorbox", coloredInline "background-color")
699 ] ++ map ignoreInlines
701 ] ++ map ignoreInlines
700 -- these commands will be ignored unless --parse-raw is specified,
702 -- these commands will be ignored unless --parse-raw is specified,
701 -- in which case they will appear as raw latex blocks:
703 -- in which case they will appear as raw latex blocks:
@@ -707,11 +709,11 @@ inlineCommands = M.fromList $
707 , "pagebreak"
709 , "pagebreak"
710−inlineTextcolor :: PandocMonad m => LP m Inlines
712+coloredInline :: PandocMonad m => String -> LP m Inlines
711−inlineTextcolor = do
713+coloredInline stylename = do
712 skipopts
714 skipopts
713 color <- braced
715 color <- braced
714− spanWith ("",[],[("style","color: " ++ color)]) <$> tok
716+ spanWith ("",[],[("style",stylename ++ ": " ++ color)]) <$> tok
716ttfamily :: PandocMonad m => LP m Inlines
718ttfamily :: PandocMonad m => LP m Inlines
717ttfamily = (code . stringify . toList) <$> tok
719ttfamily = (code . stringify . toList) <$> tok