@@ -572,7 +572,13 @@ tableCellToLaTeX header (width, align, blocks) = do
572 $ reverse ns)
572 $ reverse ns)
574listItemToLaTeX :: [Block] -> State WriterState Doc
574listItemToLaTeX :: [Block] -> State WriterState Doc
576+ -- we need to put some text before a header if it's the first
577+ -- element in an item. This will look ugly in LaTeX regardless, but
578+ -- this will keep the typesetter from throwing an error.
579+ | ((Header _ _ _) :_) <- lst =
580+ blockListToLaTeX lst >>= return . (text "\\item ~" $$) . (nest 2)
575−listItemToLaTeX lst = blockListToLaTeX lst >>= return . (text "\\item" $$) .
581+ | otherwise = blockListToLaTeX lst >>= return . (text "\\item" $$) .
578defListItemToLaTeX :: ([Inline], [[Block]]) -> State WriterState Doc
584defListItemToLaTeX :: ([Inline], [[Block]]) -> State WriterState Doc
@@ -586,7 +592,11 @@ defListItemToLaTeX (term, defs) = do
586 then braces term'
592 then braces term'
587 else term'
593 else term'
588 def' <- liftM vsep $ mapM blockListToLaTeX defs
594 def' <- liftM vsep $ mapM blockListToLaTeX defs
595+ return $ case defs of
596+ (((Header _ _ _) : _) : _) ->
597+ "\\item" <> brackets term'' <> " ~ " $$ def'
589− return $ "\\item" <> brackets term'' $$ def'
599+ "\\item" <> brackets term'' $$ def'
591-- | Craft the section header, inserting the secton reference, if supplied.
601-- | Craft the section header, inserting the secton reference, if supplied.
592sectionHeader :: Bool -- True for unnumbered
602sectionHeader :: Bool -- True for unnumbered