@@ -24,7 +24,7 @@ module Text.Pandoc.Readers.LaTeX ( readLaTeX,
2424import Control.Applicative (many, optional, (<|>))
2525import Control.Monad
2626import Control.Monad.Except (throwError)
27−import Data.Char (isDigit, isLetter, toUpper, chr)
27+import Data.Char (isDigit, isLetter, isAlphaNum, toUpper, chr)
2828import Data.Default
2929import Data.List (intercalate)
3030import qualified Data.Map as M
@@ -300,7 +300,9 @@ inlineCommand' :: PandocMonad m => LP m Inlines
300300inlineCommand' = try $ do
301301 Tok _ (CtrlSeq name) cmd <- anyControlSeq
302302 guard $ name /= "begin" && name /= "end" && name /= "and"
303− star <- option "" ("*" <$ symbol '*' <* sp)
303+ star <- if T.all isAlphaNum name
304+ then option "" ("*" <$ symbol '*' <* sp)
305+ else pure ""
304306 overlay <- option "" overlaySpecification
305307 let name' = name <> star <> overlay
306308 let names = ordNub [name', name] -- check non-starred as fallback