git.iko.soy/typeable/pandoc
on master help sign in
LaTeX reader: support `\pm` in `SI{..}`.

Closes #6620.

commit8437a4a002210a33ee721c58f5f95605898a8e1b authorJohn MacFarlane <jgm@berkeley.edu> dateThu 20 May 2021, 08:15 (5 years ago) parentb6239f4
2 files changed+6−1
src/Text/Pandoc/Readers/LaTeX/SIunitx.hs+3−1 test/command/6620.md+3
src/Text/Pandoc/Readers/LaTeX/SIunitx.hs+3−1
@@ -45,7 +45,9 @@ doSI tok = do
4545 unit]
4646
4747doSInum :: PandocMonad m => LP m Inlines
48−doSInum = skipopts *> (tonum . untokenize <$> braced)
48+doSInum = skipopts *> (tonum . untokenize . map convertPM <$> braced)
49+ where convertPM (Tok pos (CtrlSeq "pm") _) = Tok pos Word "\xb1\xa0"
50+ convertPM t = t
4951
5052tonum :: Text -> Inlines
5153tonum value =
test/command/6620.md+3
@@ -7,9 +7,12 @@
77\SI{0.135(21)}{\m}
88
99\SI{12.3(60)}{\m}
10+
11+\SI{10.0 \pm 3.3}{\ms}
1012^D
1113<p>23 ± 2 m</p>
1214<p>125 ± 12 m</p>
1315<p>0.135 ± 0.021 m</p>
1416<p>12.3 ± 6 m</p>
17+<p>10.0 ± 3.3 ms</p>
1518```