@@ -513,8 +513,15 @@ listItemToLaTeX lst = blockListToLaTeX lst >>= return . (text "\\item" $$) .
513defListItemToLaTeX :: ([Inline], [[Block]]) -> State WriterState Doc
513defListItemToLaTeX :: ([Inline], [[Block]]) -> State WriterState Doc
514defListItemToLaTeX (term, defs) = do
514defListItemToLaTeX (term, defs) = do
515 term' <- inlineListToLaTeX term
515 term' <- inlineListToLaTeX term
516+ -- put braces around term if it contains an internal link,
517+ -- since otherwise we get bad bracket interactions: \item[\hyperref[..]
518+ let isInternalLink (Link _ ('#':_,_)) = True
519+ isInternalLink _ = False
520+ let term'' = if any isInternalLink term
516 def' <- liftM vsep $ mapM blockListToLaTeX defs
523 def' <- liftM vsep $ mapM blockListToLaTeX defs
517− return $ "\\item" <> brackets term' $$ def'
524+ return $ "\\item" <> brackets term'' $$ def'
519-- | Craft the section header, inserting the secton reference, if supplied.
526-- | Craft the section header, inserting the secton reference, if supplied.
520sectionHeader :: Bool -- True for unnumbered
527sectionHeader :: Bool -- True for unnumbered