From bc5058234feab7646f58dc01379b4eadf95bf411 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 20 May 2021 09:18:23 -0700 Subject: LaTeX reader sinuitx: fix + sign on ang. --- src/Text/Pandoc/Readers/LaTeX/SIunitx.hs | 9 ++++++--- test/command/6658.md | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Text/Pandoc/Readers/LaTeX/SIunitx.hs b/src/Text/Pandoc/Readers/LaTeX/SIunitx.hs index 1474329d4..72f81dcde 100644 --- a/src/Text/Pandoc/Readers/LaTeX/SIunitx.hs +++ b/src/Text/Pandoc/Readers/LaTeX/SIunitx.hs @@ -118,11 +118,14 @@ doSIang :: PandocMonad m => LP m Inlines doSIang = do skipopts ps <- T.splitOn ";" . untokenize <$> braced + let dropPlus t = case T.uncons t of + Just ('+',t') -> t' + _ -> t case ps ++ repeat "" of (d:m:s:_) -> return $ - (if T.null d then mempty else str d <> str "\xb0") <> - (if T.null m then mempty else str m <> str "\x2032") <> - (if T.null s then mempty else str s <> str "\x2033") + (if T.null d then mempty else str (dropPlus d) <> str "\xb0") <> + (if T.null m then mempty else str (dropPlus m) <> str "\x2032") <> + (if T.null s then mempty else str (dropPlus s) <> str "\x2033") _ -> return mempty -- converts e.g. \SIrange{100}{200}{\ms} to "100 ms--200 ms" diff --git a/test/command/6658.md b/test/command/6658.md index bcd174465..0a8512f85 100644 --- a/test/command/6658.md +++ b/test/command/6658.md @@ -3,7 +3,10 @@ pandoc -f latex \SI{10.0 +- 3.3}{\ms} \num{.3e45} + +\ang{+10;+3;} ^D

10.0 ± 3.3 ms

0.3 × 1045

+

10°3′

``` -- cgit v1.2.3