LaTeX writer: change braced backtick to \textasciigrave{}

Backticks in verbatim environments are converted to
open-single-quotes. This change makes them appear as backticks. This
corresponds to how we treat `'' in verbatim environments (with
\textquotesingle{}).
This commit is contained in:
Jesse Rosenthal 2016-09-20 09:44:35 -04:00
parent 02e4b7da89
commit 581fc0130b
2 changed files with 2 additions and 2 deletions

View file

@ -276,7 +276,7 @@ stringToLaTeX ctx (x:xs) = do
'€' -> "\\euro{}" ++ rest
'{' -> "\\{" ++ rest
'}' -> "\\}" ++ rest
'`' | ctx == CodeString -> "{`}" ++ rest
'`' | ctx == CodeString -> "\\textasciigrave{}" ++ rest
'$' | not isUrl -> "\\$" ++ rest
'%' -> "\\%" ++ rest
'&' -> "\\&" ++ rest

View file

@ -76,6 +76,6 @@ tests = [ testGroup "code blocks"
, "single quotes" =:
code "dog's" =?> "\\texttt{dog\\textquotesingle{}s}"
, "backtick" =:
code "`nu?`" =?> "\\texttt{{`}nu?{`}}"
code "`nu?`" =?> "\\texttt{\\textasciigrave{}nu?\\textasciigrave{}}"
]
]