aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-03-29 10:04:22 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2019-03-29 10:04:22 -0700
commit93ee73e1dc0405ddf71417d907656c2a8726f133 (patch)
treef3fe6f16220dbbc4c7ca45e650af2e83ce771d4c /src
parent5fa4ea8eb1e712f95a1c273e36dd4bbef19d6bc9 (diff)
downloadpandoc-93ee73e1dc0405ddf71417d907656c2a8726f133.tar.gz
LaTeX writer: Avoid inadvertently creating ?` or !` ligatures.
These are upside down ? and !, resp. Closes #5407.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 0ef04db3f..d0c08815c 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -340,6 +340,14 @@ stringToLaTeX context zs = do
-> cs <> xs
_ -> cs <> "{}" <> xs
in case x of
+ '?' | ligatures -> -- avoid ?` ligature
+ case xs of
+ '`':_ -> emits "?{}"
+ _ -> emitc x
+ '!' | ligatures -> -- avoid !` ligature
+ case xs of
+ '`':_ -> emits "!{}"
+ _ -> emitc x
'{' -> emits "\\{"
'}' -> emits "\\}"
'`' | ctx == CodeString -> emitcseq "\\textasciigrave"