mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-28 17:20:47 +08:00
@@ -144,7 +144,8 @@ rawLaTeXBlock = do
|
||||
toks <- getInputTokens
|
||||
snd <$> (
|
||||
rawLaTeXParser toks
|
||||
(macroDef (const mempty) <|>
|
||||
(makeAtLetterSection <|>
|
||||
macroDef (const mempty) <|>
|
||||
do choice (map controlSeq
|
||||
["include", "input", "subfile", "usepackage"])
|
||||
skipMany opt
|
||||
@@ -154,6 +155,17 @@ rawLaTeXBlock = do
|
||||
(void (environment <|> blockCommand))
|
||||
(mconcat <$> many (block <|> beginOrEndCommand)))
|
||||
|
||||
makeAtLetterSection :: PandocMonad m => LP m ()
|
||||
makeAtLetterSection = try $ do
|
||||
controlSeq "makeatletter"
|
||||
void $ manyTill
|
||||
( whitespace
|
||||
<|> newlineTok
|
||||
<|> macroDef (const ())
|
||||
<|> void environment
|
||||
<|> void blockCommand
|
||||
) (controlSeq "makeatother")
|
||||
|
||||
-- See #4667 for motivation; sometimes people write macros
|
||||
-- that just evaluate to a begin or end command, which blockCommand
|
||||
-- won't accept.
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
```
|
||||
% pandoc -f markdown -t native -s
|
||||
---
|
||||
header-includes: |
|
||||
\makeatletter
|
||||
\beamer@ignorenonframefalse
|
||||
\makeatother
|
||||
...
|
||||
|
||||
^D
|
||||
Pandoc
|
||||
Meta
|
||||
{ unMeta =
|
||||
fromList
|
||||
[ ( "header-includes"
|
||||
, MetaBlocks
|
||||
[ RawBlock
|
||||
(Format "tex")
|
||||
"\\makeatletter\n\\beamer@ignorenonframefalse\n\\makeatother"
|
||||
]
|
||||
)
|
||||
]
|
||||
}
|
||||
[]
|
||||
```
|
||||
Reference in New Issue
Block a user