aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/LaTeX.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2021-07-22 23:05:43 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2021-07-22 23:05:43 -0700
commit1f1a30bbf6aa6d1c1dc60ac9d97560346066d02f (patch)
tree12b0d73b1f9b55b56ce2cff194303e914d46ad99 /src/Text/Pandoc/Writers/LaTeX.hs
parent832196fb17d7df037b1d1747d2c2d173ff7b3a95 (diff)
downloadpandoc-1f1a30bbf6aa6d1c1dc60ac9d97560346066d02f.tar.gz
LaTeX writer: Use ulem for underline.
ulem is conditionally included already when the `strikeout` variable is set, so we set this when there is underlined text, and use `\uline` instead of `\underline`. This fixes wrapping for underlined text. Closes #7351.
Diffstat (limited to 'src/Text/Pandoc/Writers/LaTeX.hs')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 063e347fb..dd837bdf0 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -786,7 +786,9 @@ inlineToLaTeX (Span (id',classes,kvs) ils) = do
then braces contents
else foldr inCmd contents cmds)
inlineToLaTeX (Emph lst) = inCmd "emph" <$> inlineListToLaTeX lst
-inlineToLaTeX (Underline lst) = inCmd "underline" <$> inlineListToLaTeX lst
+inlineToLaTeX (Underline lst) = do
+ modify $ \st -> st{ stStrikeout = True } -- this gives us the ulem package
+ inCmd "uline" <$> inlineListToLaTeX lst
inlineToLaTeX (Strong lst) = inCmd "textbf" <$> inlineListToLaTeX lst
inlineToLaTeX (Strikeout lst) = do
-- we need to protect VERB in an mbox or we get an error