diff options
author | John MacFarlane <jgm@berkeley.edu> | 2016-11-20 21:17:41 +0100 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2016-11-20 21:17:41 +0100 |
commit | 8d7ecc27a19facf6c4b50a65ee1029c105aacdb2 (patch) | |
tree | e76f6a0749cd50d3a5cef9fcd7a3e386a7d8afeb /src/Text | |
parent | bd1917602658467ca2335244ea97f0b39f4f680a (diff) | |
download | pandoc-8d7ecc27a19facf6c4b50a65ee1029c105aacdb2.tar.gz |
Allow beamer-style <...> options in raw LaTeX (also in Markdown).
This allows use of things like `\only<2,3>{my content}` in
Markdown that is going to be converted to beamer.
Closes #3184.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 882609a13..acd17bd2a 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -423,7 +423,8 @@ inlineCommand = try $ do star <- option "" (string "*") let name' = name ++ star let raw = do - rawargs <- withRaw (skipopts *> option "" dimenarg *> many braced) + rawargs <- withRaw + (skipangles *> skipopts *> option "" dimenarg *> many braced) let rawcommand = '\\' : name ++ star ++ snd rawargs transformed <- applyMacros' rawcommand if transformed /= rawcommand @@ -886,6 +887,17 @@ rawopt = do skipopts :: LP () skipopts = skipMany rawopt +-- opts in angle brackets are used in beamer +rawangle :: LP () +rawangle = try $ do + char '<' + skipMany (noneOf ">") + char '>' + return () + +skipangles :: LP () +skipangles = skipMany rawangle + inlineText :: LP Inlines inlineText = str <$> many1 inlineChar |