Debian Codegraph @

texmf-dist/doc/latex/enotez/enotez_split_example.tex

raw
1 % --------------------------------------------------------------------------
2 % the ENOTEZ package
3 %
4 % Endnotes for LaTeX2e
5 %
6 % --------------------------------------------------------------------------
7 % Clemens Niederberger
8 % Web: https://github.com/cgnieder/enotez/
9 % E-Mail: [email protected]
10 % --------------------------------------------------------------------------
11 % Copyright 2012--2020 Clemens Niederberger
12 %
13 % This work may be distributed and/or modified under the
14 % conditions of the LaTeX Project Public License, either version 1.3
15 % of this license or (at your option) any later version.
16 % The latest version of this license is in
17 % http://www.latex-project.org/lppl.txt
18 % and version 1.3 or later is part of all distributions of LaTeX
19 % version 2005/12/01 or later.
20 %
21 % This work has the LPPL maintenance status `maintained'.
22 %
23 % The Current Maintainer of this work is Clemens Niederberger.
24 % --------------------------------------------------------------------------
25 % The enotez package consists of the files
26 % - enotez.sty, enotez_en.tex, enotez_en.pdf, README
27 % --------------------------------------------------------------------------
28 % If you have any ideas, questions, suggestions or bugs to report, please
29 % feel free to contact me.
30 % --------------------------------------------------------------------------
31
32 \documentclass{article}
33 % \documentclass{scrartcl}
34 % \documentclass{memoir}
35 \usepackage[english]{babel}
36 % \usepackage{caption}
37 \usepackage[T1]{fontenc}
38 \usepackage{libertine}
39
40 \usepackage{enotez}
41 \usepackage{kantlipsum}
42
43 \DeclareInstance{enotez-list}{itemize}{list}{list-type=itemize,heading=\section{#1}}
44 \setenotez{
45 split=section,
46 list-style=section,
47 % reset,
48 backref
49 % customize the titles in between, e.g.:
50 % split-sectioning=addsec,
51 % split-title=\par\noindent<name> <ref>:
52 }
53
54 \usepackage{fnpct}
55
56 \usepackage{mwe}
57 \usepackage[colorlinks]{hyperref}
58
59 \begin{document}
60
61 \tableofcontents
62
63 \section{Test}
64 Text\endnote{\kant[1]}. Text\endnote{\kant[2]}. Text\endnote{This time
65 with a \textbf{nested}\multendnote{\kant[3];\kant[4]} endnote.}.
66 Text\multendnote{\kant[5];\kant[6]}.
67
68 \begin{figure}[htp]
69 \centering
70 \includegraphics[width=.4\linewidth]{example-image-a}
71 % \addtocounter{endnote}{-1} % <<< need this in memoir class and with
72 % `caption' package when using an endnote
73 % inside a caption
74 \caption[caption]{Some text\endnotemark.}
75 \endnotetext{An endnote with a nested endnote\endnote{\kant[7]} inside a
76 figure caption.}
77 \end{figure}
78
79 \appendix
80 \printendnotes[itemize]
81
82 \end{document}
83
84 \tableofcontents
85
86 \section{Test}
87 Text\endnote{\kant[1]}. Text\endnote{\kant[2]}. Text\endnote{This time
88 with a \textbf{nested}\multendnote{\kant[3];\kant[4]} endnote.}.
89 Text\multendnote{\kant[5];\kant[6]}.
90 \begin{figure}[htp]
91 \centering
92 \includegraphics[width=.4\linewidth]{example-image-a}
93 \caption[caption]{Some text\endnote{An endnote with a nested endnote\endnote{\kant[7]}
94 inside a figure caption.}.}
95 \end{figure}
96
97 \section{Test}
98 Text\endnote{\kant[8]}. Text\endnote{\kant[9]}. Text\endnote{This time
99 with a \textbf{nested}\endnote{\kant[10]} endnote.}. Text\endnote{\kant[11]}.
100
101 \appendix
102 \printendnotes
103
104 \end{document}