
O seguinte MWE
\documentclass{article}
\usepackage{titlesec}
\usepackage{footnotebackref}
\begin{document}
\section{Whatever\protect\footnote{Problematic footnote}}
\end{document}
gera um erro se os pacotes titlesec
e footnotebackref
forem carregados (embora funcione como esperado se algum deles for removido). Tentei usar \footnotemark
e \footnotetext
, sem sucesso. Alguma ideia do que pode estar acontecendo e como consertar? (Eu sei que não é aconselhável usar notas de rodapé nos cabeçalhos, mas de qualquer forma...)
Responder1
SeguindoComo usar o pacote footnotebackref com \footnotemark e \footnotetext?, a solução é usar \footnotemark
e \footnotetext
com a seguinte redefinição:
\makeatletter
\LetLtxMacro{\BHFN@Old@footnotemark}{\@footnotemark}
\renewcommand*{\@footnotemark}{%
\refstepcounter{BackrefHyperFootnoteCounter}%
\xdef\BackrefFootnoteTag{bhfn:\theBackrefHyperFootnoteCounter}%
\label{\BackrefFootnoteTag}%
\BHFN@Old@footnotemark
}
\makeatother
(Um também tem para \protect
o \footnotemark
). MWE completo:
\documentclass{article}
\usepackage{titlesec}
\usepackage{footnotebackref}
\makeatletter
\LetLtxMacro{\BHFN@Old@footnotemark}{\@footnotemark}
\renewcommand*{\@footnotemark}{%
\refstepcounter{BackrefHyperFootnoteCounter}%
\xdef\BackrefFootnoteTag{bhfn:\theBackrefHyperFootnoteCounter}%
\label{\BackrefFootnoteTag}%
\BHFN@Old@footnotemark
}
\makeatother
\begin{document}
\section{Whatever\protect\footnotemark}
\footnotetext{Problematic footnote}
\end{document}