git.iko.soy/typeable/pandoc
on master help sign in
LaTeX reader: allow beamer overlays for all commands in all raw tex.
42b915eJohn MacFarlane
src/Text/Pandoc/Readers/LaTeX.hs+10−10
@@ -773,7 +773,8 @@ inlineCommand' = try $ do
773 Tok _ (CtrlSeq name) cmd <- anyControlSeq
773 Tok _ (CtrlSeq name) cmd <- anyControlSeq
774 guard $ name /= "begin" && name /= "end"
774 guard $ name /= "begin" && name /= "end"
775 star <- option "" ("*" <$ symbol '*' <* optional sp)
775 star <- option "" ("*" <$ symbol '*' <* optional sp)
776+ overlay <- option "" overlaySpecification
776− let name' = name <> star
777+ let name' = name <> star <> overlay
777 let names = ordNub [name', name] -- check non-starred as fallback
778 let names = ordNub [name', name] -- check non-starred as fallback
778 let raw = do
779 let raw = do
779 guard $ isInlineCommand name || not (isBlockCommand name)
780 guard $ isInlineCommand name || not (isBlockCommand name)
@@ -802,19 +803,18 @@ rawopt = try $ do
802 return $ "[" <> inner <> "]"
803 return $ "[" <> inner <> "]"
803
804
804skipopts :: PandocMonad m => LP m ()
805skipopts :: PandocMonad m => LP m ()
805−skipopts = skipMany (overlaySpecification <|> void rawopt)
806+skipopts = skipMany (void overlaySpecification <|> void rawopt)
806
807
807-- opts in angle brackets are used in beamer
808-- opts in angle brackets are used in beamer
808−overlaySpecification :: PandocMonad m => LP m ()
809+overlaySpecification :: PandocMonad m => LP m Text
809overlaySpecification = try $ do
810overlaySpecification = try $ do
810 symbol '<'
811 symbol '<'
811− ts <- manyTill overlayTok (symbol '>')
812+ t <- untokenize <$> manyTill overlayTok (symbol '>')
812− guard $ case ts of
813− -- see issue #3368
813+ -- see issue #3368
814− [Tok _ Word s] | T.all isLetter s -> s `elem`
814+ guard $ not (T.all isLetter t) ||
815− ["beamer","presentation", "trans",
815+ t `elem` ["beamer","presentation", "trans",
816− "handout","article", "second"]
816+ "handout","article", "second"]
817− _ -> True
817+ return $ "<" <> t <> ">"
818
818
819overlayTok :: PandocMonad m => LP m Tok
819overlayTok :: PandocMonad m => LP m Tok
820overlayTok =
820overlayTok =
test/command/6043.mdnew file+8
@@ -0,0 +1,8 @@
1+```
2+% pandoc -t beamer
3+\textbf<1>{Bold Text On Slide1}
4+^D
5+\begin{frame}
6+\textbf<1>{Bold Text On Slide1}
7+\end{frame}
8+```