From 49336ee6eeecc352e248d1262ea1b46070e00243 Mon Sep 17 00:00:00 2001 From: Marc Schreiber Date: Tue, 2 May 2017 10:48:57 +0200 Subject: Add basic \textcolor support to LaTeX reader --- src/Text/Pandoc/Readers/LaTeX.hs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/Text/Pandoc/Readers') diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index a54238206..6252293d7 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -680,6 +680,8 @@ inlineCommands = M.fromList $ , ("nohyphens", tok) , ("textnhtt", ttfamily) , ("nhttfamily", ttfamily) + -- textcolor + , ("textcolor", textcolor) ] ++ map ignoreInlines -- these commands will be ignored unless --parse-raw is specified, -- in which case they will appear as raw latex blocks: @@ -756,6 +758,12 @@ dosiunitx = do emptyOr160 unit, unit] +textcolor :: PandocMonad m => LP m Inlines +textcolor = do + skipopts + color <- braced + spanWith ("",[],[("style","color: " ++ color)]) <$> tok + lit :: String -> LP m Inlines lit = pure . str -- cgit v1.2.3