mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-24 15:44:59 +08:00
LaTeX reader sinuitx: fix + sign on ang.
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -3,7 +3,10 @@ pandoc -f latex
|
||||
\SI{10.0 +- 3.3}{\ms}
|
||||
|
||||
\num{.3e45}
|
||||
|
||||
\ang{+10;+3;}
|
||||
^D
|
||||
<p>10.0 ± 3.3 ms</p>
|
||||
<p>0.3 × 10<sup>45</sup></p>
|
||||
<p>10°3′</p>
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user