TeX - LaTeX Asked by Johannes Reimer on January 23, 2021
I’m using the enotez
package to place my endnotes on the page margin.
But when inserting a hyperlink I want to tyeset the URL as a "standard" LaTeX footnote.
Nevertheless, the footnote/endnote counter should be continuous (1, 2, 3, …) and not as in the MWE interrupted (1, 1, 2, …), the "standard" footnote being the bold one here.
documentclass[12pt, a4paper]{article}
usepackage[a4paper,left=30mm,right=45mm]{geometry}
usepackage[english]{babel}
usepackage{blindtext}
usepackage{calc}
usepackage{enumitem}
setlist{%
labelindent=0pt,
font=bfseries,
labelwidth=1em,
leftmargin=0pt,
itemindent=2em,
labelsep=1em,
}
usepackage{hyperref}
newcommand{link}[3]{%
href{#1}{underline{#2}}%
footnote{URL:hspace{1em}href{#1}{#1} #3}%
}
usepackage{marginnote}
newcommand{minimarginnote}[1]{marginnote{footnotesize#1}}
setlength{marginparsep}{5mm}
setlength{marginparwidth}{30mm}
usepackage{enotez}
setenotez{backref = true}
% Formatting for endnotes in the 'list' style (option "sidenotes")
DeclareInstance{enotez-list}{sidenotes}{list}{%
heading = {footnotesizetextbf{#1:}},
format = footnotesize,
list-type = enumerate
}
% 'Sidenotes' will get printed as margin notes
newcommand{printsidenotes}{%
marginnote{%
printendnotes[sidenotes]
}
}
% -------------------------
begin{document}
Here, I'm writing some lines about my problem and what I'm intending to do. I hope you get what I mean. This is a ``before'' endnoteendnote{This is an endnote.}.
In this paragraph, I'm using a link{https://tex.stackexchange.com/}{hyperlink}{This footnote should be number textbf{2}.} with a ``standard'' footnote in order to demonstrate my problem.
Now I just need to insert the ``after'' endnoteendnote{This is another endnote. But it should be number textbf{3}.} in this paragraph.
printsidenotes[-5baselineskip]
end{document}
Is there any way to either
printendnotes
command orenotez
and footnote
, i. e. the referencing numbers are in the correct order?Teach LaTeX to use the same counter for footnotes and endnotes.
documentclass[12pt, a4paper]{article}
usepackage[a4paper,left=30mm,right=45mm]{geometry}
usepackage[english]{babel}
usepackage{blindtext}
usepackage{enumitem}
usepackage{marginnote}
usepackage{enotez}
usepackage{hyperref} % should be last
% enumitem
setlist{%
labelindent=0pt,
font=bfseries,
labelwidth=1em,
leftmargin=0pt,
itemindent=2em,
labelsep=1em,
}
% marginnote
newcommand{minimarginnote}[1]{marginnote{footnotesize#1}}
setlength{marginparsep}{5mm}
setlength{marginparwidth}{30mm}
% enotez
setenotez{backref = true}
% Formatting for endnotes in the 'list' style (option "sidenotes")
DeclareInstance{enotez-list}{sidenotes}{list}{%
heading = {footnotesizetextbf{#1:}},
format = footnotesize,
list-type = enumerate
}
% 'Sidenotes' will get printed as margin notes
newcommand{printsidenotes}{%
marginnote{%
printendnotes[sidenotes]
}%
}
makeatletter % make footnote use the same counter as endnote
letc@footnotec@endnote
makeatother
% links
newcommand{link}[3]{%
href{#1}{underline{#2}}%
footnote{URL:hspace{1em}href{#1}{#1} #3}%
}
%%%% just to make a smaller picture
setlength{textheight}{5cm}
begin{document}
Here, I'm writing some lines about my problem and what I'm intending to do. I hope
you get what I mean. This is a ``before'' endnoteendnote{This is an endnote.}.
In this paragraph, I'm using a
link{https://tex.stackexchange.com/}{hyperlink}{This footnote should be number textbf{2}.}
with a ``standard'' footnote in order to demonstrate my problem.
Now I just need to insert the ``after'' endnoteendnote{This is another endnote.
But it should be number textbf{3}.} in this paragraph.
printsidenotes[-5baselineskip]
end{document}
You'll notice that I rearranged the code. Having settings for a package just after loading it may seem more practical, but it clutters the preamble. Moreover, settings may be entangled and depend on other loaded packages.
Correct answer by egreg on January 23, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP