git.iko.soy/typeable/pandoc
on master help sign in
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.

commit8d7ecc27a19facf6c4b50a65ee1029c105aacdb2 authorJohn MacFarlane <jgm@berkeley.edu> dateSun 20 Nov 2016, 21:17 (10 years ago) parentbd19176
1 file changed+13−1
src/Text/Pandoc/Readers/LaTeX.hs+13−1
src/Text/Pandoc/Readers/LaTeX.hs+13−1
@@ -423,7 +423,8 @@ inlineCommand = try $ do
423423 star <- option "" (string "*")
424424 let name' = name ++ star
425425 let raw = do
426− rawargs <- withRaw (skipopts *> option "" dimenarg *> many braced)
426+ rawargs <- withRaw
427+ (skipangles *> skipopts *> option "" dimenarg *> many braced)
427428 let rawcommand = '\\' : name ++ star ++ snd rawargs
428429 transformed <- applyMacros' rawcommand
429430 if transformed /= rawcommand
@@ -886,6 +887,17 @@ rawopt = do
886887skipopts :: LP ()
887888skipopts = skipMany rawopt
888889
890+-- opts in angle brackets are used in beamer
891+rawangle :: LP ()
892+rawangle = try $ do
893+ char '<'
894+ skipMany (noneOf ">")
895+ char '>'
896+ return ()
897+
898+skipangles :: LP ()
899+skipangles = skipMany rawangle
900+
889901inlineText :: LP Inlines
890902inlineText = str <$> many1 inlineChar
891903