aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorschrieveslaach <schrieveslaach@online.de>2017-04-26 12:05:13 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-04-26 12:05:13 +0200
commita29fa15a7b214ff83efe7b32fe51a55711984ef7 (patch)
tree73ffcd99dbfac955dbff403245e41d5a6c1c3cd3 /src/Text/Pandoc/Readers
parent256e3a6a5d3f91262e8b3304fc2fa8cd1a854038 (diff)
downloadpandoc-a29fa15a7b214ff83efe7b32fe51a55711984ef7.tar.gz
LaTeX reader: Add basic support for hyphenat package (#3603)
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs14
1 files changed, 13 insertions, 1 deletions
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