mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-01 15:38:09 +08:00
LaTeX reader: Add basic support for hyphenat package (#3603)
This commit is contained in:
committed by
John MacFarlane
parent
256e3a6a5d
commit
a29fa15a7b
@@ -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
|
||||
|
||||
@@ -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"]]
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user