@@ -498,14 +498,15 @@ sectionHeader unnumbered ref level lst = do
498498 let noNote (Note _) = Str ""
499499 noNote x = x
500500 let lstNoNotes = walk noNote lst
501+ txtNoNotes <- inlineListToLaTeX lstNoNotes
501502 let star = if unnumbered then text "*" else empty
502− -- footnotes in sections don't work unless you specify an optional
503− -- argument: \section[mysec]{mysec\footnote{blah}}
504− optional <- if lstNoNotes == lst
503+ -- footnotes in sections don't work (except for starred variants)
504+ -- unless you specify an optional argument:
505+ -- \section[mysec]{mysec\footnote{blah}}
506+ optional <- if unnumbered || lstNoNotes == lst
505507 then return empty
506508 else do
507− res <- inlineListToLaTeX lstNoNotes
508− return $ char '[' <> res <> char ']'
509+ return $ brackets txtNoNotes
509510 let stuffing = star <> optional <> braces txt
510511 book <- gets stBook
511512 opts <- gets stOptions
@@ -536,7 +537,7 @@ sectionHeader unnumbered ref level lst = do
536537 $$ if unnumbered
537538 then "\\addcontentsline{toc}" <>
538539 braces (text sectionType) <>
539− braces txt
540+ braces txtNoNotes
540541 else empty
541542
542543-- | Convert list of inline elements to LaTeX.