diff options
| author | John MacFarlane <jgm@berkeley.edu> | 2024-03-22 08:50:20 -0700 |
|---|---|---|
| committer | John MacFarlane <jgm@berkeley.edu> | 2024-03-22 08:50:20 -0700 |
| commit | b28dc15817e6e4b56cd1f12c6883bbb5b964afad (patch) | |
| tree | 4288cc01b9a64c839492d81c03c3e9b14a2b590b /src/Text | |
| parent | a70399d7a07ec4854551e1cd0bc75d28ee99b002 (diff) | |
LaTeX writer: fix math inside strikeout (closes #9597).
Diffstat (limited to 'src/Text')
| -rw-r--r-- | src/Text/Pandoc/Writers/LaTeX.hs | 5 |
1 files changed, 4 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) = |
