git.iko.soy/typeable/pandoc
on master help sign in
LaTeX reader: support all \textXX commands.

where XX = rm, tt, up, md, sf, bf. Spans with a class are used when there is nothing better. Closes #3488.

commitddc2b9024fbe8be9c51ff1347caa6eef30adebe2 authorJohn MacFarlane <jgm@berkeley.edu> dateSun 5 Mar 2017, 20:21 (10 years ago) parente20f556
1 file changed+5−1
src/Text/Pandoc/Readers/LaTeX.hs+5−1
src/Text/Pandoc/Readers/LaTeX.hs+5−1
@@ -498,6 +498,11 @@ inlineCommands = M.fromList $
498498 , ("textit", extractSpaces emph <$> tok)
499499 , ("textsl", extractSpaces emph <$> tok)
500500 , ("textsc", extractSpaces smallcaps <$> tok)
501+ , ("textsf", extractSpaces (spanWith ("",["sans-serif"],[])) <$> tok)
502+ , ("textmd", extractSpaces (spanWith ("",["medium"],[])) <$> tok)
503+ , ("textrm", extractSpaces (spanWith ("",["roman"],[])) <$> tok)
504+ , ("textup", extractSpaces (spanWith ("",["upright"],[])) <$> tok)
505+ , ("texttt", (code . stringify . toList) <$> tok)
501506 , ("sout", extractSpaces strikeout <$> tok)
502507 , ("textsuperscript", extractSpaces superscript <$> tok)
503508 , ("textsubscript", extractSpaces subscript <$> tok)
@@ -582,7 +587,6 @@ inlineCommands = M.fromList $
582587 , ("verb", doverb)
583588 , ("lstinline", skipopts *> doverb)
584589 , ("Verb", doverb)
585− , ("texttt", (code . stringify . toList) <$> tok)
586590 , ("url", (unescapeURL <$> braced) >>= \url ->
587591 pure (link url "" (str url)))
588592 , ("href", (unescapeURL <$> braced <* optional sp) >>= \url ->