Estilizar notas de rodapé sem footmisc (conflito de hiperref)

Estilizar notas de rodapé sem footmisc (conflito de hiperref)

Recebi um modelo e stydocumento com este código que oferece um layout de nota de rodapé melhor do que o padrão:

\usepackage[hang, flushmargin,splitrule,multiple]{footmisc}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\@makefntext}{
    \ifFN@hangfoot
    \bgroup
    }{
    \ifFN@hangfoot
    \bgroup\def\@makefnmark{
        \rlap{\normalfont\@thefnmark.}
    }
}{}{}
\patchcmd{\@makefntext}{
    \ifdim\footnotemargin>\z@
    \hb@xt@ \footnotemargin{\hss\@makefnmark}
    }{
    \ifdim\footnotemargin>\z@
    \hb@xt@ \footnotemargin{\@makefnmark\hss}
}{}{}
\makeatother
\setlength{\footnotemargin}{1.25em} % Between marker and text
\setlength{\skip\footins}{1\baselineskip} % Between main text and note rule
\setlength{\footnotesep}{\skip\footins} % Between footnotes [= previous]
\renewcommand{\hangfootparskip}{0pt}
\renewcommand{\hangfootparindent}{1em}

Mas, usando o suporte de footmiscbreaks† hyperrefpara marcadores de notas de rodapé embutidos.

MWE - remova o comentário do commentambiente para ver o estilo de layout de nota de rodapé desejado, comente-o para ver o padrão com links funcionais para notas de rodapé:

\documentclass{article}

\usepackage{verbatim} % to allow commenting code section

% hyperref options as per my uni's thesis class
\usepackage[pdfpagemode={UseOutlines},bookmarks=true,bookmarksopen=true,
bookmarksopenlevel=0,bookmarksnumbered=true,hypertexnames=true, plainpages=false,
colorlinks,linkcolor={blue},citecolor={green},urlcolor={red},
pdfstartview={FitV},unicode,breaklinks=true,pdfpagelabels]{hyperref}

%\begin{comment}
\usepackage[hang, flushmargin,splitrule,multiple]{footmisc}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\@makefntext}{
    \ifFN@hangfoot
    \bgroup
}{
    \ifFN@hangfoot
    \bgroup\def\@makefnmark{
        \rlap{\normalfont\@thefnmark.}
    }
}{}{}
\patchcmd{\@makefntext}{
    \ifdim\footnotemargin>\z@
    \hb@xt@ \footnotemargin{\hss\@makefnmark}
}{
    \ifdim\footnotemargin>\z@
    \hb@xt@ \footnotemargin{\@makefnmark\hss}
}{}{}
\makeatother
\setlength{\footnotemargin}{1.25em} % Between marker and text
\setlength{\skip\footins}{1\baselineskip} % Between main text and note rule
\setlength{\footnotesep}{\skip\footins} % Between footnotes [= previous]
\renewcommand{\hangfootparskip}{0pt}
\renewcommand{\hangfootparindent}{1em}
%\end{comment}

\begin{document}
Lorem ipsum dolor\footnote{A note} sit amet, consectetur adipiscing elit. Nam posuere risus\footnote{Another note} risus, et lobortis nunc egestas eu.
\end{document}

Existe uma maneira de obter o melhor layout das notas de rodapé, sem usar footmiscou adicionar mais nada que interrompa as funções hipertextuais?

Na verdade, existe uma maneira de fornecer às notas de rodapé um link para sua âncora embutida.

Portanto, estamos ansiosos pelo dia em que deixaremos de usar formatos legados (papel) para documentos digitais nativos. Especialmente irônico quando se escreve sobre hipertexto. Até então, é LaTeX.

† FWIW, etoolboxparece ser usado em outro lugar (código de classe que não escrevi!) mas não quebra o hipertexto do hyperref.

Responder1

dê uma chance ao hyperref: carregue-o mais tarde para que ele possa injetar seu código:

\documentclass{article}

\usepackage{verbatim} % to allow commenting code section

%\begin{comment}
\usepackage[hang, flushmargin,splitrule,multiple]{footmisc}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\@makefntext}{
    \ifFN@hangfoot
    \bgroup
}{
    \ifFN@hangfoot
    \bgroup\def\@makefnmark{
        \rlap{\normalfont\@thefnmark.}
    }
}{}{}
\patchcmd{\@makefntext}{
    \ifdim\footnotemargin>\z@
    \hb@xt@ \footnotemargin{\hss\@makefnmark}
}{
    \ifdim\footnotemargin>\z@
    \hb@xt@ \footnotemargin{\@makefnmark\hss}
}{}{}
\makeatother
\setlength{\footnotemargin}{1.25em} % Between marker and text
\setlength{\skip\footins}{1\baselineskip} % Between main text and note rule
\setlength{\footnotesep}{\skip\footins} % Between footnotes [= previous]
\renewcommand{\hangfootparskip}{0pt}
\renewcommand{\hangfootparindent}{1em}
%\end{comment}
% hyperref options as per my uni's thesis class
\usepackage[pdfpagemode={UseOutlines},bookmarks=true,bookmarksopen=true,
bookmarksopenlevel=0,bookmarksnumbered=true,hypertexnames=true, plainpages=false,
colorlinks,linkcolor={blue},citecolor={green},urlcolor={red},
pdfstartview={FitV},unicode,breaklinks=true,pdfpagelabels]{hyperref}


\begin{document}
Lorem ipsum dolor\footnote{A note} sit amet, consectetur adipiscing elit. Nam posuere risus\footnote{Another note} risus, et lobortis nunc egestas eu.
\end{document}

informação relacionada