
Anteriormente usei o \footref
comando do footmisc
pacote para me referir a uma nota final. Isso funcionou bem em combinação com o endnotes
pacote:
\documentclass{article}
\usepackage{footmisc,endnotes}
\renewcommand{\footnote}{\endnote}
\begin{document}
\noindent Here is some text.\footnote{And here is an endnote.\label{foot.first}}\\
Here is more text.\footnote{And here is another endnote.\label{foot.second}}\\
Here is my final sentence.\footref{foot.first}\textsuperscript{,}\footref{foot.second}
\theendnotes
\end{document}
Mas agora mudei para o enotez
pacote e isso não funciona mais corretamente. No MWE abaixo, a referência à primeira nota final refere-se, em vez disso, à segunda nota final.
\documentclass{article}
\usepackage{footmisc,enotez}
\renewcommand{\footnote}{\endnote}
\begin{document}
\noindent Here is some text.\footnote{And here is an endnote.\label{foot.first}}\\
Here is more text.\footnote{And here is another endnote.\label{foot.second}}\\
Here is my final sentence.\footref{foot.first}\textsuperscript{,}\footref{foot.second}
\printendnotes
\end{document}
Como posso enotez
consultar a nota final correta?
Responder1
Com enotez
o \label
comando deve ficar fora do texto da nota final; veja o exemplo final na seção 3.1.
Você não precisa footmisc
, pois pode definir um \footref
comando com enotez
recursos:
\documentclass{article}
\usepackage{enotez}
\renewcommand{\footnote}{\endnote}
\newcommand{\footref}[1]{%
\enotezwritemark{\enmarkstyle\ref{#1}}%
}
\begin{document}
\noindent Here is some text.\footnote{And here is an endnote.}\label{foot.first}\\
Here is more text.\footnote{And here is another endnote.}\label{foot.second}\\
Here is my final sentence.\footref{foot.first}\textsuperscript{,}\footref{foot.second}
\printendnotes
\end{document}
Se você tiver várias instâncias de multiple \footref
, poderá considerar uma sintaxe abreviada:
\documentclass{article}
\usepackage{enotez}
\renewcommand{\footnote}{\endnote}
\ExplSyntaxOn
\NewDocumentCommand{\footref}{m}
{
\sverre_footref:n { #1 }
}
\seq_new:N \l_sverre_footrefs_seq
\cs_new_protected:Npn \sverre_footref:n #1
{
\seq_clear:N \l_sverre_footrefs_seq
\clist_map_inline:nn { #1 }
{
\seq_put_right:Nn \l_sverre_footrefs_seq
{ \enotezwritemark{\enmarkstyle\ref{##1}} }
}
\seq_use:Nn \l_sverre_footrefs_seq { \textsuperscript{,} }
}
\ExplSyntaxOff
\begin{document}
\noindent Here is some text.\footnote{And here is an endnote.}\label{foot.first}\\
Here is more text.\footnote{And here is another endnote.}\label{foot.second}\\
Here is my final sentence.\footref{foot.first,foot.second}
\printendnotes
\end{document}
Responder2
Ou (desde 2022), use postnotes
em vez disso, já que \label{...}
funciona de maneira típica/lógica, e o pacote tem um recurso de referência cruzada adicional que você pode gostar. Citando o manual:
A referência cruzada com postnotes funciona de uma maneira bastante padrão: defina um rótulo, faça referências a ele. No entanto, existem duas maneiras de definir um rótulo para uma nota. Pode-se definir um rótulo com a
label
opção\postnote
ou diretamente com o padrão\label
como parte do conteúdo da nota. Ambos são válidos, mas não são equivalentes, têm significados diferentes e, portanto, comportam-se de forma diferente. [¶] O rótulo definido com alabel
opção é definido no local onde\postnote
está. O rótulo definido com\label
no conteúdo da nota é apenas armazenado e só é expandido quando esse conteúdo é digitado, em\printpostnotes
. Em suma, alabel
opção pertence à “marca”, enquanto o\label
conjunto no conteúdo pertence ao “texto”.
\documentclass{article}
\usepackage{footmisc,postnotes}
\renewcommand{\footnote}{\postnote}
\begin{document}
\noindent Here is some text.\footnote{And here is an endnote.\label{foot.first}}\\
Here is more text.\footnote{And here is another endnote.\label{foot.second}}\\
Here is my final sentence.\footref{foot.first}\textsuperscript{,}\footref{foot.second}
\printpostnotes
\end{document}