
Ich habe zuvor den \footref
Befehl aus dem footmisc
Paket verwendet, um auf eine Endnote zu verweisen. Dies hat in Kombination mit dem endnotes
Paket problemlos funktioniert:
\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}
Aber ich bin jetzt auf das Paket umgestiegen enotez
, und das funktioniert nicht mehr richtig. Im folgenden MWE bezieht sich der Verweis auf die erste Endnote stattdessen auf die zweite Endnote.
\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}
Wie kann ich enotez
auf die richtige Endnote verweisen?
Antwort1
Der enotez
Befehl \label
sollte außerhalb des Endnotentextes stehen; siehe das letzte Beispiel in Abschnitt 3.1.
Das ist nicht nötig , da Sie einen Befehl mit folgenden Funktionen footmisc
definieren können :\footref
enotez
\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}
Wenn Sie mehrere Instanzen von „multiple“ haben \footref
, können Sie eine verkürzte Syntax in Betracht ziehen:
\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}
Antwort2
Oder (seit 2022) verwenden Sie postnotes
stattdessen, da \label{...}
es auf die typische/logische Weise funktioniert und das Paket über eine weitere Querverweisfunktion verfügt, die Ihnen gefallen könnte. Zitat aus dem Handbuch:
Querverweise mit Postnotes funktionieren ziemlich standardmäßig: ein Label setzen, darauf verweisen. Es gibt jedoch zwei Möglichkeiten, einer Notiz ein Label zu setzen. Man kann entweder ein Label mit der
label
Option setzen\postnote
oder es direkt mit dem Standard\label
als Teil des Inhalts der Notiz setzen. Beide sind gültig, aber sie sind nicht gleichwertig, sie haben unterschiedliche Bedeutungen und verhalten sich dementsprechend unterschiedlich. [¶] Das mit derlabel
Option gesetzte Label wird an der Stelle gesetzt, an der\postnote
steht. Das mit im Inhalt der Notiz gesetzte Label\label
wird nur gespeichert und erst erweitert, wenn dieser 13Inhalt gesetzt wird, bei\printpostnotes
. Kurz gesagt, dielabel
Option gehört zur „Markierung“, während das\label
im Inhalt gesetzte zum „Text“ gehört.
\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}