diff options
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 1d35cd662..7d2d62762 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -1297,12 +1297,26 @@ getRawCommand name txt = do void $ count 4 braced "def" -> void $ manyTill anyTok braced - _ -> do - skipopts - option "" (try (optional sp *> dimenarg)) - void $ many braced + _ | isFontSizeCommand name -> return () + | otherwise -> do + skipopts + option "" (try (optional sp *> dimenarg)) + void $ many braced return $ T.unpack (txt <> untokenize rawargs) +isFontSizeCommand :: Text -> Bool +isFontSizeCommand "tiny" = True +isFontSizeCommand "scriptsize" = True +isFontSizeCommand "footnotesize" = True +isFontSizeCommand "small" = True +isFontSizeCommand "normalsize" = True +isFontSizeCommand "large" = True +isFontSizeCommand "Large" = True +isFontSizeCommand "LARGE" = True +isFontSizeCommand "huge" = True +isFontSizeCommand "Huge" = True +isFontSizeCommand _ = False + isBlockCommand :: Text -> Bool isBlockCommand s = s `M.member` (blockCommands :: M.Map Text (LP PandocPure Blocks)) |