git.iko.soy/typeable/pandoc
on master help sign in
Make raw content marked `beamer` work in `beamer` output.

See pandoc/lua-filters#40.

commit24a0d613a87245c193f7cc3b4a6bf1391a7eb6a8 authorJohn MacFarlane <jgm@berkeley.edu> dateThu 10 Jan 2019, 12:00 (8 years ago) parentdfd1796
1 file changed+18−14
src/Text/Pandoc/Writers/LaTeX.hs+18−14
src/Text/Pandoc/Writers/LaTeX.hs+18−14
@@ -693,12 +693,14 @@ blockToLaTeX (CodeBlock (identifier,classes,keyvalAttr) str) = do
693693 | not (null classes) && isJust (writerHighlightStyle opts)
694694 -> highlightedCodeBlock
695695 | otherwise -> rawCodeBlock
696−blockToLaTeX b@(RawBlock f x)
697− | f == Format "latex" || f == Format "tex"
698− = return $ text x
699− | otherwise = do
700− report $ BlockNotRendered b
701− return empty
696+blockToLaTeX b@(RawBlock f x) = do
697+ beamer <- gets stBeamer
698+ if (f == Format "latex" || f == Format "tex" ||
699+ (f == Format "beamer" && beamer))
700+ then return $ text x
701+ else do
702+ report $ BlockNotRendered b
703+ return empty
702704blockToLaTeX (BulletList []) = return empty -- otherwise latex error
703705blockToLaTeX (BulletList lst) = do
704706 incremental <- gets stIncremental
@@ -1189,14 +1191,16 @@ inlineToLaTeX (Math InlineMath str) = do
11891191inlineToLaTeX (Math DisplayMath str) = do
11901192 setEmptyLine False
11911193 return $ "\\[" <> text (handleMathComment str) <> "\\]"
1192−inlineToLaTeX il@(RawInline f str)
1193− | f == Format "latex" || f == Format "tex"
1194− = do
1195− setEmptyLine False
1196− return $ text str
1197− | otherwise = do
1198− report $ InlineNotRendered il
1199− return empty
1194+inlineToLaTeX il@(RawInline f str) = do
1195+ beamer <- gets stBeamer
1196+ if (f == Format "latex" || f == Format "tex" ||
1197+ (f == Format "beamer" && beamer))
1198+ then do
1199+ setEmptyLine False
1200+ return $ text str
1201+ else do
1202+ report $ InlineNotRendered il
1203+ return empty
12001204inlineToLaTeX LineBreak = do
12011205 emptyLine <- gets stEmptyLine
12021206 setEmptyLine True