summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs14
-rw-r--r--test/command/hyphenat.md49
2 files changed, 62 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
diff --git a/test/command/hyphenat.md b/test/command/hyphenat.md
new file mode 100644
index 000000000..3aae85101
--- /dev/null
+++ b/test/command/hyphenat.md
@@ -0,0 +1,49 @@
+```
+% pandoc -f latex -t native
+electromagnetic\hyp{}endioscopy
+^D
+[Para [Str "electromagnetic-endioscopy"]]
+```
+
+```
+% pandoc -f latex -t native
+C\colonhyp\bshyp{}Windows\bshyp
+^D
+[Para [Str "C:\173\\\173Windows\\\173"]]
+```
+
+```
+% pandoc -f latex -t native
+\fshyp{}usr\fshyp{}share\fshyp
+^D
+[Para [Str "/\173usr/\173share/\173"]]
+```
+
+```
+% pandoc -f latex -t native
+\fshyp{}home\fshyp{}schrieveslaach\fshyp\dothyp{}m2
+^D
+[Para [Str "/\173home/\173schrieveslaach/\173.\173m2"]]
+```
+
+```
+% pandoc -f latex -t native
+\nohyphens{Pneumonoultramicroscopicsilicovolcanoconiosis}
+^D
+[Para [Str "Pneumonoultramicroscopicsilicovolcanoconiosis"]]
+```
+
+```
+% pandoc -f latex -t native
+\textnhtt{Pneumonoultramicroscopicsilicovolcanoconiosis}
+^D
+[Para [Code ("",[],[]) "Pneumonoultramicroscopicsilicovolcanoconiosis"]]
+```
+
+```
+% pandoc -f latex -t native
+\nhttfamily{Pneumonoultramicroscopicsilicovolcanoconiosis}
+^D
+[Para [Code ("",[],[]) "Pneumonoultramicroscopicsilicovolcanoconiosis"]]
+```
+