git.iko.soy/typeable/pandoc
on master help sign in
LaTeX reader sinuitx: fix + sign on ang.
commitbc5058234feab7646f58dc01379b4eadf95bf411 authorJohn MacFarlane <jgm@berkeley.edu> dateThu 20 May 2021, 09:18 (5 years ago) parent5dc917d
2 files changed+9−3
src/Text/Pandoc/Readers/LaTeX/SIunitx.hs+6−3 test/command/6658.md+3
src/Text/Pandoc/Readers/LaTeX/SIunitx.hs+6−3
@@ -118,11 +118,14 @@ doSIang :: PandocMonad m => LP m Inlines
118118doSIang = do
119119 skipopts
120120 ps <- T.splitOn ";" . untokenize <$> braced
121+ let dropPlus t = case T.uncons t of
122+ Just ('+',t') -> t'
123+ _ -> t
121124 case ps ++ repeat "" of
122125 (d:m:s:_) -> return $
123− (if T.null d then mempty else str d <> str "\xb0") <>
124− (if T.null m then mempty else str m <> str "\x2032") <>
125− (if T.null s then mempty else str s <> str "\x2033")
126+ (if T.null d then mempty else str (dropPlus d) <> str "\xb0") <>
127+ (if T.null m then mempty else str (dropPlus m) <> str "\x2032") <>
128+ (if T.null s then mempty else str (dropPlus s) <> str "\x2033")
126129 _ -> return mempty
127130
128131-- converts e.g. \SIrange{100}{200}{\ms} to "100 ms--200 ms"
test/command/6658.md+3
@@ -3,7 +3,10 @@ pandoc -f latex
33\SI{10.0 +- 3.3}{\ms}
44
55\num{.3e45}
6+
7+\ang{+10;+3;}
68^D
79<p>10.0 ± 3.3 ms</p>
810<p>0.3 × 10<sup>45</sup></p>
11+<p>10°3′</p>
912```