summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs5
-rw-r--r--test/command/9597.md6
2 files changed, 10 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 2c3404310..33fa15f1b 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -868,7 +868,10 @@ inlineToLaTeX (Strikeout lst) = do
-- incorrect results if there is a space, see #5529
contents <- inlineListToLaTeX $ walk (concatMap protectCode) lst
modify $ \s -> s{ stStrikeout = True }
- return $ inCmd "st" contents
+ -- soul doesn't like \(..\) delimiters, so we change these to $ (#9597):
+ let fixMath = T.replace "\\(" "$" . T.replace "\\)" "$" .
+ T.replace "\\[" "$$" . T.replace "\\]" "$$"
+ return $ inCmd "st" $ fixMath <$> contents
inlineToLaTeX (Superscript lst) =
inCmd "textsuperscript" <$> inlineListToLaTeX lst
inlineToLaTeX (Subscript lst) =
diff --git a/test/command/9597.md b/test/command/9597.md
new file mode 100644
index 000000000..272d79d02
--- /dev/null
+++ b/test/command/9597.md
@@ -0,0 +1,6 @@
+```
+% pandoc -t latex
+~~$T$~~
+^D
+\st{$T$}
+```