diff options
author | John MacFarlane <jgm@berkeley.edu> | 2012-01-25 17:50:03 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2012-01-25 17:51:52 -0800 |
commit | 60bf741d689700554ca971dc87417f05a32e3981 (patch) | |
tree | a59ab58c569349ef2540cad2be5e85d1d47bff0e /src/Text/Pandoc/Writers/LaTeX.hs | |
parent | 2c4a55d160a52b01e208b19c5d42521dcca35e78 (diff) | |
download | pandoc-60bf741d689700554ca971dc87417f05a32e3981.tar.gz |
Added --slide-level option to override default.
This allows users to select a slide level below the first
header level with content.
Note that content under sections above the slide level will not appear
in slides (either in beamer or in HTML slide shows).
This is primarily useful for creating documents that can be made
into both slides and handouts (which contain additional content
outside the slides).
Diffstat (limited to 'src/Text/Pandoc/Writers/LaTeX.hs')
-rw-r--r-- | src/Text/Pandoc/Writers/LaTeX.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index bf1ad91d9..140ef171d 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -201,7 +201,8 @@ inCmd cmd contents = char '\\' <> text cmd <> braces contents toSlides :: [Block] -> State WriterState [Block] toSlides bs = do - let slideLevel = getSlideLevel bs + opts <- gets stOptions + let slideLevel = maybe (getSlideLevel bs) id $ writerSlideLevel opts let bs' = prepSlides slideLevel bs concat `fmap` (mapM (elementToBeamer slideLevel) $ hierarchicalize bs') @@ -214,7 +215,10 @@ elementToBeamer slideLevel (Sec lvl _num _ident tit elts) : tit ++ [RawInline "latex" "}"] ) : bs ++ [RawBlock "latex" "\\end{block}"] | lvl < slideLevel = do + let isSec (Sec _ _ _ _ _) = True + isSec (Blk _) = False bs <- concat `fmap` mapM (elementToBeamer slideLevel) elts + -- (filter isSec elts) return $ (Header lvl tit) : bs | otherwise = do -- lvl == slideLevel -- note: [fragile] is required or verbatim breaks |