summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/endnotes
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-01-05 03:00:30 +0000
committerNorbert Preining <norbert@preining.info>2020-01-05 03:00:30 +0000
commitd703bc2777b69363e791c0ec50045947b1a399da (patch)
tree518c616bdf53da2c5dccf1bbd0a17ba14d4b7c7a /macros/latex/contrib/endnotes
parent46d85b2b8e0282e241f8a41c6c0cd190c495eab0 (diff)
CTAN sync 202001050300
Diffstat (limited to 'macros/latex/contrib/endnotes')
-rw-r--r--macros/latex/contrib/endnotes/README.md2
-rw-r--r--macros/latex/contrib/endnotes/endnotes.pdfbin267875 -> 276021 bytes
-rw-r--r--macros/latex/contrib/endnotes/endnotes.sty27
-rw-r--r--macros/latex/contrib/endnotes/endnotes.tex15
4 files changed, 38 insertions, 6 deletions
diff --git a/macros/latex/contrib/endnotes/README.md b/macros/latex/contrib/endnotes/README.md
new file mode 100644
index 0000000000..3c4ca3c020
--- /dev/null
+++ b/macros/latex/contrib/endnotes/README.md
@@ -0,0 +1,2 @@
+# endnotes
+Place footnotes at the end
diff --git a/macros/latex/contrib/endnotes/endnotes.pdf b/macros/latex/contrib/endnotes/endnotes.pdf
index cf5f5cecaf..f1ea18f1c1 100644
--- a/macros/latex/contrib/endnotes/endnotes.pdf
+++ b/macros/latex/contrib/endnotes/endnotes.pdf
Binary files differ
diff --git a/macros/latex/contrib/endnotes/endnotes.sty b/macros/latex/contrib/endnotes/endnotes.sty
index d3ef6514ba..7d428d167d 100644
--- a/macros/latex/contrib/endnotes/endnotes.sty
+++ b/macros/latex/contrib/endnotes/endnotes.sty
@@ -4,9 +4,10 @@
% * ENDNOTES *
% ****************************************
%
-% Date of this version: 15 January 2003.
+% Date of this version: 02 January 2020.
%
%% Copyright 2002 John Lavagnino
+%% Copyright 2019-2020 LaTeX3 Project
%%
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.2
@@ -114,6 +115,11 @@
% Frank's updates.
%
%
+% Jürgen Spitzmüller 2019-08-17: just warn if \verb|\theendnotes| is
+% used, but noendnotes have been inserted yet.
+%
+% Jürgen Spitzmüller 2020-01-02: ensure .ent file is cleared.
+%
% ****************************************
% * ENDNOTE COMMANDS *
% ****************************************
@@ -254,6 +260,8 @@
% ****************************************
%
+\ProvidesPackage{endnotes}[2020-01-02 endnotes package]
+
\@definecounter{endnote}
\def\theendnote{\@arabic\c@endnote}
@@ -283,6 +291,7 @@
\newwrite\@enotes
\newif\if@enotesopen \global\@enotesopenfalse
+\newif\if@haveenotes \global\@haveenotesfalse
\def\@openenotes{\immediate\openout\@enotes=\jobname.ent\relax
\global\@enotesopentrue}
@@ -296,6 +305,7 @@
% of the lines wind up being quite short.
\long\def\@endnotetext#1{%
+ \global\@haveenotestrue
\if@enotesopen \else \@openenotes \fi
\immediate\write\@enotes{\@doanenote{\@theenmark}}%
\begingroup
@@ -309,6 +319,7 @@
% have, requiring the use of \protect for fragile commands.
\long\def\addtoendnotes#1{%
+ \global\@haveenotestrue
\if@enotesopen \else \@openenotes \fi
\begingroup
\newlinechar='40
@@ -316,6 +327,16 @@
\immediate\write\@enotes{#1}%
\endgroup}
+% Check at document end if endnotes have been inserted;
+% if not, assure the *.ent file is cleared if it exists.
+\AtEndDocument{%
+ \if@haveenotes\else
+ \IfFileExists{\jobname.ent}{
+ \if@enotesopen\else\@openenotes\fi
+ \addtoendnotes{}}{}
+ \fi
+}
+
% End of unique endnote code
\def\endnotemark{%
@@ -411,7 +432,9 @@
\def\@endanenote{\par\endgroup}%
\enoteheading
\enotesize
- \input{\jobname.ent}%
+ \InputIfFileExists{\jobname.ent}{}{%
+ \PackageWarning{endnotes}{No endnotes found (file \jobname.ent does not exist)\MessageBreak}
+ }%
\endgroup}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/macros/latex/contrib/endnotes/endnotes.tex b/macros/latex/contrib/endnotes/endnotes.tex
index a2ded227a1..4c87fba024 100644
--- a/macros/latex/contrib/endnotes/endnotes.tex
+++ b/macros/latex/contrib/endnotes/endnotes.tex
@@ -1,7 +1,5 @@
\documentclass[pagesize=auto]{scrartcl}
-\usepackage{fixltx2e}
-\usepackage{etex}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
@@ -23,8 +21,9 @@
\addtokomafont{title}{\rmfamily}
\title{The \pkg{endnotes} package}
-\author{John Lavagnino\thanks{Centre for Computing in the Humanities, King's College London}~~(\mail{John.Lavagnino@kcl.ac.uk})}
-\date{15 January 2003}
+\author{John Lavagnino\thanks{Centre for Computing in the Humanities, King's College London}\thanks{Now Maintained by the \LaTeX3 project, \url{https://github.com/rf-latex/endnotes}}}
+
+\date{2020-01-02}
\begin{document}
@@ -142,6 +141,14 @@ by itself will work.)
\item[JL] John Lavagnino, 15 January 2003: fix my garbled version of
Frank's updates.
+
+\item[JS] Modification by Jürgen Spitzmüller, 17.\,8.\,2019:
+
+ Do not break but just warn if \verb|\theendnotes| is used, but no
+ endnotes have been inserted yet.
+
+ If the last remaining \verb|\endnote| is removed, clear the \verb|*.ent|
+ auxiliary file.
\end{labeling}