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