LaTeX reader: improve parsing of \tiny
, scriptsize
, etc.
Parse as raw, but know that these font changing commands take no arguments.
This commit is contained in:
parent
5c643d535b
commit
681afbfaac
1 changed files with 18 additions and 4 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Reference in a new issue