@@ -228,15 +228,16 @@ blockToLaTeX (Header level lst) = do
228228 return $ char '[' <> res <> char ']'
229229 let stuffing = optional <> char '{' <> txt <> char '}'
230230 book <- liftM stBook get
231− return $ case (book, level) of
232− (True, 1) -> text "\\chapter" <> stuffing <> char '\n'
233− (True, 2) -> text "\\section" <> stuffing <> char '\n'
234− (True, 3) -> text "\\subsection" <> stuffing <> char '\n'
235− (True, 4) -> text "\\subsubsection" <> stuffing <> char '\n'
236− (False, 1) -> text "\\section" <> stuffing <> char '\n'
237− (False, 2) -> text "\\subsection" <> stuffing <> char '\n'
238− (False, 3) -> text "\\subsubsection" <> stuffing <> char '\n'
239− _ -> txt <> char '\n'
231+ let level' = if book then level - 1 else level
232+ let headerWith x y = text x <> y <> char '\n'
233+ return $ case level' of
234+ 0 -> headerWith "\\chapter" stuffing
235+ 1 -> headerWith "\\section" stuffing
236+ 2 -> headerWith "\\subsection" stuffing
237+ 3 -> headerWith "\\subsubsection" stuffing
238+ 4 -> headerWith "\\paragraph" stuffing
239+ 5 -> headerWith "\\subparagraph" stuffing
240+ _ -> txt <> char '\n'
240241blockToLaTeX (Table caption aligns widths heads rows) = do
241242 headers <- if all null heads
242243 then return empty