Debian Codegraph @

texmf-dist/doc/latex/endnotes-hy/examples/exmpl-endnotes.tex

raw
1 \documentclass{article}
2 \usepackage{xcolor}
3 \usepackage{endnotes-hy}
4
5 \usepackage{hyperref}
6 \hypersetup{colorlinks,linkcolor=red}
7
8 \usepackage{fancyvrb}
9
10 \def\cs#1{\texttt{\char`\\#1}}
11
12 % used to create verbatim endnotes
13 \newbox\enbox
14 \setbox\enbox\hbox{\verb!%^$^&$%^&!}
15 \edef\VertTxti{\unhbox\enbox}
16
17 % Use to get indentation in multi-paragraph endnotes
18 \def\enPAR{\par\hskip15pt}
19
20 \makeatletter
21 % the use of \everypar is to get proper alignment of the left margin
22 % in multi-paragraph endnotes.
23 \def\enoteformat{%
24 \rightskip\z@ \leftskip\z@ \parindent=1.8em
25 \everypar{\hangindent=\parindent \hangafter=1}%
26 \leavevmode\llap{\makeenmark}}
27 \makeatother
28
29 % Modify how the endnote mark looks at the end.
30 \patchcmd{\theendnotes}
31 {\makeatletter}
32 {\makeatletter
33 \renewcommand\makeenmark{\textbf{\theenmark{}.} }}
34 {}{}
35
36 \usepackage{lipsum}
37
38 \begin{document}
39
40 %\show\enoteformat
41
42 \section{Making endnotes clickable}\label{MkClk}
43
44 The new syntax for the \cs{endnote} command is,
45 \begin{Verbatim}[xleftmargin=15pt]
46 \endnote*[<num>]{<note-text>}\label{<name>}
47 \end{Verbatim}
48 The use of \texttt* causes the endnote mark not to appear. If \verb!\label{<name>}! appears,
49 a hypertext links is created pointing to the placement of the endnote at the end of the document.
50
51 \begin{itemize}
52
53 \item Some beginning text.\endnote{My endnote text.}\label{judy}
54
55 \item Refer to endnote.\endnote{Tom Terrific!}\label{tom}
56
57 \item Another method is to use the \texttt*-form and use
58 \verb~\autoref~\endnote*{Alex-tastic!}\label{alex} to display
59 the reference to \autoref{alex}.
60
61 \item Now make another endnote.\endnote{Kira's endnote is a very long one.
62 Kira's endnote is a very long one. Kira's endnote is a very long one.\enPAR
63 Kira's endnote is a very long one. Kira's endnote is a very long one.
64 Kira's endnote is a very long one.}\label{kira}
65
66 \item This is an endnote with two paragraphs\endnote*{Don is good.\par Tom is better.}\label{multipar} in endnote~\ref{multipar}.
67
68 \item Here, we try \verb!\Nameref!, \verb~\nameref~, \verb~\autoref~: \Nameref{tom}, \nameref{tom}, \autoref{tom}.
69
70 \item This is a specially number endnote.{\def\theendnote{N\arabic{endnote}}\endnote[1]{A special end note, verbatim: \VertTxti.}\label{cusNum}}
71
72 \item We reference endnote\endnote{Don's endnote is here!}\label{don} on page~\pageref{don}.
73
74 \end{itemize}
75 \lipsum[1]
76
77 \newpage
78
79 \theendnotes
80
81 \end{document}