summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/endnotes-hy/examples/exmpl-endnotes.tex
blob: ab523dfffe7a82882427a54b09179394e1dcd76e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
\documentclass{article}
\usepackage{xcolor}
\usepackage{endnotes-hy}

\usepackage{hyperref}
\hypersetup{colorlinks,linkcolor=red}

\usepackage{fancyvrb}

\def\cs#1{\texttt{\char`\\#1}}

% used to create verbatim endnotes
\newbox\enbox
\setbox\enbox\hbox{\verb!%^$^&$%^&!}
\edef\VertTxti{\unhbox\enbox}

% Use to get indentation in multi-paragraph endnotes
\def\enPAR{\par\hskip15pt}

\makeatletter
% the use of \everypar is to get proper alignment of the left margin
% in multi-paragraph endnotes.
\def\enoteformat{%
  \rightskip\z@ \leftskip\z@ \parindent=1.8em
  \everypar{\hangindent=\parindent \hangafter=1}%
  \leavevmode\llap{\makeenmark}}
\makeatother

% Modify how the endnote mark looks at the end.
\patchcmd{\theendnotes}
    {\makeatletter}
    {\makeatletter
     \renewcommand\makeenmark{\textbf{\theenmark{}.} }}
    {}{}

\usepackage{lipsum}

\begin{document}

%\show\enoteformat

\section{Making endnotes clickable}\label{MkClk}

The new syntax for the \cs{endnote} command is,
\begin{Verbatim}[xleftmargin=15pt]
\endnote*[<num>]{<note-text>}\label{<name>}
\end{Verbatim}
The use of \texttt* causes the endnote mark not to appear. If \verb!\label{<name>}! appears,
a hypertext links is created pointing to the placement of the endnote at the end of the document.

\begin{itemize}

\item Some beginning text.\endnote{My endnote text.}\label{judy}

\item Refer to endnote.\endnote{Tom Terrific!}\label{tom}

\item Another method is to use the \texttt*-form and use
\verb~\autoref~\endnote*{Alex-tastic!}\label{alex} to display
the reference to \autoref{alex}.

\item Now make another endnote.\endnote{Kira's endnote is a very long one.
      Kira's endnote is a very long one. Kira's endnote is a very long one.\enPAR
      Kira's endnote is a very long one. Kira's endnote is a very long one.
      Kira's endnote is a very long one.}\label{kira}

\item This is an endnote with two paragraphs\endnote*{Don is good.\par Tom is better.}\label{multipar} in endnote~\ref{multipar}.

\item Here, we try \verb!\Nameref!, \verb~\nameref~, \verb~\autoref~: \Nameref{tom}, \nameref{tom}, \autoref{tom}.

\item This is a specially number endnote.{\def\theendnote{N\arabic{endnote}}\endnote[1]{A special end note, verbatim: \VertTxti.}\label{cusNum}}

\item We reference endnote\endnote{Don's endnote is here!}\label{don} on page~\pageref{don}.

\end{itemize}
\lipsum[1]

\newpage

\theendnotes

\end{document}