LaTeX writer: Use \textquotesingle for ' in inline code.

Otherwise we get curly quotes in the PDF output.
Closes #1364.
This commit is contained in:
John MacFarlane 2014-06-23 12:51:10 -07:00
parent e03ed7377c
commit 87ab01637e
2 changed files with 3 additions and 0 deletions

View file

@ -220,6 +220,7 @@ stringToLaTeX ctx (x:xs) = do
'>' -> "\\textgreater{}" ++ rest
'[' -> "{[}" ++ rest -- to avoid interpretation as
']' -> "{]}" ++ rest -- optional arguments
'\'' | ctx == CodeString -> "\\textquotesingle{}" ++ rest
'\160' -> "~" ++ rest
'\x2026' -> "\\ldots{}" ++ rest
'\x2018' | ligatures -> "`" ++ rest

View file

@ -63,5 +63,7 @@ tests = [ testGroup "code blocks"
strikeout (code "foo" <> space
<> str "bar") =?>
"\\sout{\\texttt{foo} bar}"
, "single quotes" =:
code "dog's" =?> "\\texttt{dog\\textquotesingle{}s}"
]
]