From a29fa15a7b214ff83efe7b32fe51a55711984ef7 Mon Sep 17 00:00:00 2001 From: schrieveslaach Date: Wed, 26 Apr 2017 12:05:13 +0200 Subject: LaTeX reader: Add basic support for hyphenat package (#3603) --- src/Text/Pandoc/Readers/LaTeX.hs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 564d4e417..a54238206 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -518,7 +518,7 @@ inlineCommands = M.fromList $ , ("textmd", extractSpaces (spanWith ("",["medium"],[])) <$> tok) , ("textrm", extractSpaces (spanWith ("",["roman"],[])) <$> tok) , ("textup", extractSpaces (spanWith ("",["upright"],[])) <$> tok) - , ("texttt", (code . stringify . toList) <$> tok) + , ("texttt", ttfamily) , ("sout", extractSpaces strikeout <$> tok) , ("textsuperscript", extractSpaces superscript <$> tok) , ("textsubscript", extractSpaces subscript <$> tok) @@ -671,6 +671,15 @@ inlineCommands = M.fromList $ , ("hypertarget", braced >> tok) -- siuntix , ("SI", dosiunitx) + -- hyphenat + , ("bshyp", lit "\\\173") + , ("fshyp", lit "/\173") + , ("dothyp", lit ".\173") + , ("colonhyp", lit ":\173") + , ("hyp", lit "-") + , ("nohyphens", tok) + , ("textnhtt", ttfamily) + , ("nhttfamily", ttfamily) ] ++ map ignoreInlines -- these commands will be ignored unless --parse-raw is specified, -- in which case they will appear as raw latex blocks: @@ -682,6 +691,9 @@ inlineCommands = M.fromList $ , "pagebreak" ] +ttfamily :: PandocMonad m => LP m Inlines +ttfamily = (code . stringify . toList) <$> tok + mkImage :: PandocMonad m => [(String, String)] -> String -> LP m Inlines mkImage options src = do let replaceTextwidth (k,v) = case numUnit v of -- cgit v1.2.3