git.iko.soy/typeable/pandoc
on master help sign in
Improve fix to siunitx numbers with minus.
5271c6bJohn MacFarlane
src/Text/Pandoc/Readers/LaTeX/SIunitx.hs+1−1
@@ -71,7 +71,7 @@ parseNumPart =
71 parseSpace
71 parseSpace
72 where
72 where
73 parseDecimalNum = do
73 parseDecimalNum = do
74− pref <- option mempty $ (mempty <$ char '+') <|> ("-" <$ char '-')
74+ pref <- option mempty $ (mempty <$ char '+') <|> ("\x2212" <$ char '-')
75 basenum <- (pref <>) . T.pack
75 basenum <- (pref <>) . T.pack
76 <$> many1 (satisfy (\c -> isDigit c || c == '.'))
76 <$> many1 (satisfy (\c -> isDigit c || c == '.'))
77 uncertainty <- option mempty $ T.pack <$> parseParens
77 uncertainty <- option mempty $ T.pack <$> parseParens
test/command/6844.mdnew file+27
@@ -0,0 +1,27 @@
1+Negative numbers with siunitx
2+
3+```
4+% pandoc -f latex -t native
5+\SI{123}{\celsius}
6+
7+^D
8+[Para [Str "123\160\176C"]]
9+```
10+
11+```
12+% pandoc -f latex -t native
13+\SI{-123}{\celsius}
14+
15+^D
16+[Para [Str "\8722\&123\160\176C"]]
17+```
18+
19+```
20+% pandoc -f latex -t native
21+\SI{+123}{\celsius}
22+
23+^D
24+[Para [Str "123\160\176C"]]
25+```
26+
27+
test/command/siunitx-negative-numbers.mddeleted−15
@@ -1,15 +0,0 @@
1−```
2−% pandoc -f latex
3−\SI{+33.3}{\m}
4−
5−\num{+5}
6−
7−\SI{-33.3}{\m}
8−
9−\num{-33}
10−^D
11−<p>33.3 m</p>
12−<p>5</p>
13−<p>-33.3 m</p>
14−<p>-33</p>
15−```