diff options
author | John MacFarlane <jgm@berkeley.edu> | 2019-01-10 12:00:34 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-01-10 12:00:34 -0800 |
commit | 24a0d613a87245c193f7cc3b4a6bf1391a7eb6a8 (patch) | |
tree | 6f1ccb0d8882f62528260bd08c80d45e50a8a5e1 /src | |
parent | dfd1796cf2940a151145f96265d75904b7313493 (diff) | |
download | pandoc-24a0d613a87245c193f7cc3b4a6bf1391a7eb6a8.tar.gz |
Make raw content marked `beamer` work in `beamer` output.
See pandoc/lua-filters#40.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Writers/LaTeX.hs | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index 0b539d553..c9751e885 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -693,12 +693,14 @@ blockToLaTeX (CodeBlock (identifier,classes,keyvalAttr) str) = do | not (null classes) && isJust (writerHighlightStyle opts) -> highlightedCodeBlock | otherwise -> rawCodeBlock -blockToLaTeX b@(RawBlock f x) - | f == Format "latex" || f == Format "tex" - = return $ text x - | otherwise = do - report $ BlockNotRendered b - return empty +blockToLaTeX b@(RawBlock f x) = do + beamer <- gets stBeamer + if (f == Format "latex" || f == Format "tex" || + (f == Format "beamer" && beamer)) + then return $ text x + else do + report $ BlockNotRendered b + return empty blockToLaTeX (BulletList []) = return empty -- otherwise latex error blockToLaTeX (BulletList lst) = do incremental <- gets stIncremental @@ -1189,14 +1191,16 @@ inlineToLaTeX (Math InlineMath str) = do inlineToLaTeX (Math DisplayMath str) = do setEmptyLine False return $ "\\[" <> text (handleMathComment str) <> "\\]" -inlineToLaTeX il@(RawInline f str) - | f == Format "latex" || f == Format "tex" - = do - setEmptyLine False - return $ text str - | otherwise = do - report $ InlineNotRendered il - return empty +inlineToLaTeX il@(RawInline f str) = do + beamer <- gets stBeamer + if (f == Format "latex" || f == Format "tex" || + (f == Format "beamer" && beamer)) + then do + setEmptyLine False + return $ text str + else do + report $ InlineNotRendered il + return empty inlineToLaTeX LineBreak = do emptyLine <- gets stEmptyLine setEmptyLine True |