git.iko.soy/typeable/pandoc
on master help sign in
LaTeX writer: Use `\textquotesingle` for `'` in inline code.
87ab016John MacFarlane
src/Text/Pandoc/Writers/LaTeX.hs+1
@@ -220,6 +220,7 @@ stringToLaTeX ctx (x:xs) = do
220 '>' -> "\\textgreater{}" ++ rest
220 '>' -> "\\textgreater{}" ++ rest
221 '[' -> "{[}" ++ rest -- to avoid interpretation as
221 '[' -> "{[}" ++ rest -- to avoid interpretation as
222 ']' -> "{]}" ++ rest -- optional arguments
222 ']' -> "{]}" ++ rest -- optional arguments
223+ '\'' | ctx == CodeString -> "\\textquotesingle{}" ++ rest
223 '\160' -> "~" ++ rest
224 '\160' -> "~" ++ rest
224 '\x2026' -> "\\ldots{}" ++ rest
225 '\x2026' -> "\\ldots{}" ++ rest
225 '\x2018' | ligatures -> "`" ++ rest
226 '\x2018' | ligatures -> "`" ++ rest
tests/Tests/Writers/LaTeX.hs+2
@@ -63,5 +63,7 @@ tests = [ testGroup "code blocks"
63 strikeout (code "foo" <> space
63 strikeout (code "foo" <> space
64 <> str "bar") =?>
64 <> str "bar") =?>
65 "\\sout{\\texttt{foo} bar}"
65 "\\sout{\\texttt{foo} bar}"
66+ , "single quotes" =:
67+ code "dog's" =?> "\\texttt{dog\\textquotesingle{}s}"
66 ]
68 ]
67 ]
69 ]