@@ -181,6 +181,7 @@ pPageUnit = roman <|> plainUnit
181181 plainUnit = do
182182 ts <- many1 (notFollowedBy pSpace >>
183183 notFollowedBy pLocatorPunct >>
184+ notFollowedBy pMath >>
184185 anyToken)
185186 let s = stringify ts
186187 -- otherwise look for actual digits or -s
@@ -211,6 +212,12 @@ pMatchChar msg f = satisfyTok f' <?> msg
211212pSpace :: LocatorParser Inline
212213pSpace = satisfyTok (\t -> isSpacey t || t == Str "\160") <?> "space"
213214
215+pMath :: LocatorParser Inline
216+pMath = satisfyTok isMath
217+ where
218+ isMath (Math{}) = True
219+ isMath _ = False
220+
214221satisfyTok :: (Inline -> Bool) -> LocatorParser Inline
215222satisfyTok f = tokenPrim show (\sp _ _ -> sp) (\tok -> if f tok
216223 then Just tok