@@ -555,6 +555,7 @@ sectionHeader :: Bool -- True for unnumbered
555 -> State WriterState Doc
555 -> State WriterState Doc
556sectionHeader unnumbered ref level lst = do
556sectionHeader unnumbered ref level lst = do
557 txt <- inlineListToLaTeX lst
557 txt <- inlineListToLaTeX lst
558+ plain <- stringToLaTeX TextString $ foldl (++) "" $ map stringify lst
558 let noNote (Note _) = Str ""
559 let noNote (Note _) = Str ""
559 noNote x = x
560 noNote x = x
560 let lstNoNotes = walk noNote lst
561 let lstNoNotes = walk noNote lst
@@ -567,7 +568,9 @@ sectionHeader unnumbered ref level lst = do
567 then return empty
568 then return empty
569 return $ brackets txtNoNotes
570 return $ brackets txtNoNotes
570− let stuffing = star <> optional <> braces txt
571+ let stuffing = star <> optional <> braces (text "\\texorpdfstring"
573+ <> braces (text plain))
571 book <- gets stBook
574 book <- gets stBook
572 opts <- gets stOptions
575 opts <- gets stOptions
573 let level' = if book || writerChapters opts then level - 1 else level
576 let level' = if book || writerChapters opts then level - 1 else level