@@ -176,9 +176,9 @@ pandocToLaTeX options (Pandoc meta blocks) = do
176176 modify $ \s -> s{stCsquotes = True}
177177 let (blocks'', lastHeader) = if writerCiteMethod options == Citeproc then
178178 (blocks', [])
179− else case last blocks' of
180− Header 1 _ il -> (init blocks', il)
181− _ -> (blocks', [])
179+ else case reverse blocks' of
180+ Header 1 _ il : _ -> (init blocks', il)
181+ _ -> (blocks', [])
182182 beamer <- gets stBeamer
183183 blocks''' <- if beamer
184184 then toSlides blocks''