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