@@ -105,7 +105,7 @@ import Text.Pandoc.Error (PandocError (PandocMacroLoop))
105105import Text.Pandoc.Logging
106106import Text.Pandoc.Options
107107import Text.Pandoc.Parsing hiding (blankline, many, mathDisplay, mathInline,
108− optional, space, spaces, withRaw, (<|>))
108+ space, spaces, withRaw, (<|>))
109109import Text.Pandoc.Readers.LaTeX.Types (ExpansionPoint (..), Macro (..),
110110 ArgSpec (..), Tok (..), TokType (..))
111111import Text.Pandoc.Shared
@@ -668,13 +668,19 @@ parenWrapped parser = try $ do
668668
669669dimenarg :: PandocMonad m => LP m Text
670670dimenarg = try $ do
671+ optional sp
671672 ch <- option False $ True <$ symbol '='
672− Tok _ _ s <- satisfyTok isWordTok
673− guard $ T.take 2 (T.reverse s) `elem`
673+ Tok _ _ s1 <- satisfyTok isWordTok
674+ s2 <- option "" $ try $ do
675+ symbol '.'
676+ Tok _ _ t <- satisfyTok isWordTok
677+ return ("." <> t)
678+ let s = s1 <> s2
679+ guard $ T.takeEnd 2 s `elem`
674680 ["pt","pc","in","bp","cm","mm","dd","cc","sp"]
675− let num = T.take (T.length s - 2) s
681+ let num = T.dropEnd 2 s
676682 guard $ T.length num > 0
677− guard $ T.all isDigit num
683+ guard $ T.all (\c -> isDigit c || c == '.') num
678684 return $ T.pack ['=' | ch] <> s
679685
680686ignore :: (Monoid a, PandocMonad m) => String -> ParserT s u m a