@@ -259,6 +259,29 @@ dosiunitx = do
259259 emptyOr160 unit,
260260 unit]
261261
262+-- converts e.g. \SIRange{100}{200}{\ms} to "100 ms--200 ms"
263+doSIRange :: PandocMonad m => LP m Inlines
264+doSIRange = do
265+ skipopts
266+ startvalue <- tok
267+ startvalueprefix <- option "" $ bracketed tok
268+ stopvalue <- tok
269+ stopvalueprefix <- option "" $ bracketed tok
270+ unit <- grouped (mconcat <$> many1 siUnit) <|> siUnit <|> tok
271+ let emptyOr160 "" = ""
272+ emptyOr160 _ = "\160"
273+ return . mconcat $ [startvalueprefix,
274+ emptyOr160 startvalueprefix,
275+ startvalue,
276+ emptyOr160 unit,
277+ unit,
278+ "\8211", -- An en-dash
279+ stopvalueprefix,
280+ emptyOr160 stopvalueprefix,
281+ stopvalue,
282+ emptyOr160 unit,
283+ unit]
284+
262285siUnit :: PandocMonad m => LP m Inlines
263286siUnit = do
264287 Tok _ (CtrlSeq name) _ <- anyControlSeq
@@ -1075,6 +1098,7 @@ inlineCommands = M.union inlineLanguageCommands $ M.fromList
10751098 , ("acsp", doAcronymPlural "abbrv")
10761099 -- siuntix
10771100 , ("SI", dosiunitx)
1101+ , ("SIRange", doSIRange)
10781102 -- hyphenat
10791103 , ("bshyp", lit "\\\173")
10801104 , ("fshyp", lit "/\173")