summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/versonotes
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-01-01 03:01:00 +0000
committerNorbert Preining <norbert@preining.info>2024-01-01 03:01:00 +0000
commit094e5f512c4ea5981db967dd89c47363a603529b (patch)
tree2e855fa79ed8735bd940510f1de1153a836cb30b /macros/latex/contrib/versonotes
parent5acd803fa16526d48d5c8e990dc509df22d856b7 (diff)
CTAN sync 202401010300
Diffstat (limited to 'macros/latex/contrib/versonotes')
-rw-r--r--macros/latex/contrib/versonotes/README.md (renamed from macros/latex/contrib/versonotes/README)30
-rw-r--r--macros/latex/contrib/versonotes/sample.pdfbin60265 -> 60735 bytes
-rw-r--r--macros/latex/contrib/versonotes/sample.tex27
-rw-r--r--macros/latex/contrib/versonotes/versonotes.dtx137
-rw-r--r--macros/latex/contrib/versonotes/versonotes.pdfbin137575 -> 54138 bytes
5 files changed, 144 insertions, 50 deletions
diff --git a/macros/latex/contrib/versonotes/README b/macros/latex/contrib/versonotes/README.md
index 6ff5b86d1e..93e8923ad0 100644
--- a/macros/latex/contrib/versonotes/README
+++ b/macros/latex/contrib/versonotes/README.md
@@ -1,7 +1,7 @@
Package versonotes
==================
-Version 0.4, 2019 July 6
+Version 0.5, 2023 December 31
This package allows you to place notes on the verso pages of an
otherwise single-sided document.
@@ -11,23 +11,35 @@ If, in the run of text, you include a call to the macro
opposite (ie, ‘verso’) page, lined up with the macro call.
You can see a sample of how to use the package, and its results, in
-sample.tex and sample.pdf.
+[sample.tex](sample.tex) and [sample.pdf](sample.pdf).
-The source is at [bitbucket][bitbucket],
+The source is available at [the code home page][nxg],
and the package is distributed on CTAN in
[macros/latex/contrib/versonotes/][ctan]
-Copyright 2014, 2015, 2019, Norman Gray.
+Copyright 2014, 2015, 2019, 2023, Norman Gray.
The package is distributed under the conditions of the LaTeX Project
-Public License, either version 1.3 of this license or (at your option)
-any later version.
+Public License, either version 1.3 of this licence or (at your option)
+any later version; see the file `lppl.txt` for details.
Acknowledgements, and release notes
-----------------------------------
+
Thanks to Thomas H. Luxon for permission to include the
-“Paradise Lost” notes in the sample text.
+Dartmouth Milton text of “Paradise Lost” notes in the sample
+text.
+
+Version 0.5, 2023 December 31
+
+ * Now compatible with LuaTeX.
+
+ * Now uses L3‐style hooks, but retains compatibility with
+ pre‐2020 engines.
+
+ * Updated the links to the repository, and to the Dart‐
+ mouth Milton text.
Version 0.4, 2019 July 6
Support changing the initial page number (thanks to P J
@@ -48,5 +60,5 @@ Version 0.2, 2015 February 16
Norman Gray
https://nxg.me.uk
-[bitbucket]: https://bitbucket.org/nxg/versonotes
-[ctan]: http://www.ctan.org/pkg/versonotes
+[nxg]: https://heptapod.host/nxg/versonotes
+[ctan]: https://ctan.org/pkg/versonotes
diff --git a/macros/latex/contrib/versonotes/sample.pdf b/macros/latex/contrib/versonotes/sample.pdf
index 57d7fbc38f..742f09f791 100644
--- a/macros/latex/contrib/versonotes/sample.pdf
+++ b/macros/latex/contrib/versonotes/sample.pdf
Binary files differ
diff --git a/macros/latex/contrib/versonotes/sample.tex b/macros/latex/contrib/versonotes/sample.tex
index 6558462eb3..12f8b9329b 100644
--- a/macros/latex/contrib/versonotes/sample.tex
+++ b/macros/latex/contrib/versonotes/sample.tex
@@ -1,10 +1,20 @@
\documentclass{scrartcl}
-\usepackage{url,ifxetex}
+\usepackage{iftex}
+\usepackage[implicit=false]{hyperref}
+
+\newif\ifusefontspec
\ifxetex
-\usepackage{fontspec}
-\setmainfont[Ligatures=TeX]{Hoefler Text}
+ \usefontspectrue
+\else\ifluatex
+ \usefontspectrue
+\else
+ \usefontspecfalse
+\fi\fi
+\ifusefontspec
+ \usepackage{fontspec}
+ \setmainfont[Ligatures=TeX]{Hoefler Text}
\fi
\def\UrlFont{\ttfamily \small}
@@ -28,15 +38,18 @@
This excerpt comprises the first couple of stanzas of \emph{Paradise
Lost}, with notes. The text and notes are quoted here (with
permission) to illustrate one use of the versonotes package
-(\url{http://www.ctan.org/pkg/versonotes}), and its response to
+(\url{https://www.ctan.org/pkg/versonotes}), and its response to
collisions of notes. Also, because a day with \emph{Paradise Lost} in
it is a day improved.
The text is from
-\url{https://www.dartmouth.edu/~milton/reading_room/pl/book_1/}.
+\url{https://milton.host.dartmouth.edu} (Book 1).
The general editor of this edition is Thomas H. Luxon, and the notes are
-Copyright Trustees of Dartmouth College, 1997-2014; see the colophon
-at \url{https://www.dartmouth.edu/~milton/reading_room/contents/about_mrr.shtml}.
+Copyright 1997-2023, Trustees of Dartmouth College, with a
+\href{https://creativecommons.org/licenses/by-nd/3.0/us/}{CC BY-ND 3.0 licence};
+see the
+\href{https://milton.host.dartmouth.edu/reading_room/contents/about_mrr.shtml}{colophon}
+at that site.
\pagebreak
diff --git a/macros/latex/contrib/versonotes/versonotes.dtx b/macros/latex/contrib/versonotes/versonotes.dtx
index afcdc70719..e7b2eaaa89 100644
--- a/macros/latex/contrib/versonotes/versonotes.dtx
+++ b/macros/latex/contrib/versonotes/versonotes.dtx
@@ -2,9 +2,9 @@
% This is versonotes.dtx, which supports adding notes on verso pages,
% opposite annotation on the recto pages. Still sketchy
%%
-%% Release version 0.4, 2019 July 6.
+%% Release version 0.5, 2023 December 31.
%%
-%% Copyright 2014, 2015, 2019 Norman Gray <https://nxg.me.uk>
+%% Copyright 2014, 2015, 2019, 2023 Norman Gray <https://nxg.me.uk>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
@@ -23,16 +23,16 @@
%%
%%%% File: versonotes.dtx
-%<+package|driver|example>%%%% Source: 7d4f5fb7b19e, 2019-07-06T19:09:45+01:00
+%<+package|driver|example>%%%% Source: b86314fff92e, 2023-12-31T14:55:52+00:00
%%
%<+package>\NeedsTeXFormat{LaTeX2e}
-%<+package>\ProvidesPackage{versonotes}[2019/07/06 v0.4]
+%<+package>\ProvidesPackage{versonotes}[2023/12/31 v0.5]
%
%<*driver>
\documentclass{ltxdoc}
\title{versonotes: Notes on verso pages}
\author{Norman Gray\\\url{https://nxg.me.uk}}
-\date{Release 0.4, 2019 July 6}
+\date{Release 0.5, 2023 December 31}
\usepackage{url}
\newcommand\Lopt[1]{\textsf {#1}} % options
\newcommand\file[1]{\texttt {#1}}
@@ -110,8 +110,17 @@
% finds a stable state. If you find yourself inconvenienced by this,
% it sounds as if you are preparing a critical edition, and you might
% want to venture into a closer relationship with the
-% \Lpackage{eledmac}
-% package.\footnote{\texttt{http://www.ctan.org/pkg/eledmac}}
+% \Lpackage{reledmac}
+% package.\footnote{\texttt{https://www.ctan.org/pkg/reledmac} -- this
+% is the current incarnation, as of 2023, of the eledmac, ledmac and
+% edmac packages for scholarly editions.}.
+%
+% \emph{Note}:
+% If we have a long versonote at the bottom of a page, then we
+% don't try to spill over onto the next (that would be possible to
+% implement, but would be a significant jump in complication). We
+% regard this situation as one for the user to work out for themself,
+% perhaps with some strategic page-breaks.
%
% The dimensions |\versoleftmargin| and |\versotextwidth| specify the
% position of the text block on the verso page. The defaults for
@@ -143,8 +152,10 @@
%
% \subsection*{Notes}
% \begin{itemize}
-% \item The package uses the |\pdfsavepos| primitive, and so requires
-% \texttt{pdflatex}, \texttt{xelatex}, or \texttt{luatex}.
+% \item The package uses the |\pdfsavepos| primitive (or the
+% Lua\TeX\ equivalent), and so requires \texttt{pdflatex},
+% \texttt{xelatex}, or \texttt{lualatex}. In practice, this should
+% mean that it will work with any reasonably current \LaTeX\ engine.
%
% \item The notes are handled using the |.aux| file, and so (i) they will
% only appear on the second and subsequent runs; and (ii) they will be
@@ -156,8 +167,7 @@
%
% \item The package is available on CTAN at
% \texttt{macros/latex/contrib/versonotes/}. The source is hosted at
-% \url{https://bitbucket.org/nxg/versonotes}, where you can also find
-% an issues list.
+% \url{https://heptapod.host/nxg/versonotes/}.
%
% \end{itemize}
%
@@ -167,9 +177,16 @@
%
%
% Thanks to Thomas H. Luxon for permission to include the
+% Dartmouth Milton text\footnote{\url{https://milton.host.dartmouth.edu/}} of
% ‘Paradise Lost’ notes in the sample text.
%
% \begin{description}
+% \item[Version 0.5, 2023 December 31]\relax
+% \leavevmode\begin{itemize}
+% \item Now compatible with LuaTeX.
+% \item Now uses L3-style hooks, but retains compatibility with pre-2020 engines.
+% \item Updated the links to the repository, and to the Dartmouth Milton text.
+% \end{itemize}
% \item[Version 0.4, 2019 July 6]\relax
% Support changing the initial page number
% (thanks to P J Couch for the suggestion).
@@ -203,7 +220,7 @@
\@verso@notesonlefttrue
% \end{macrocode}
%
-% Configuration options:
+% Define configuration options for the user:
% \begin{macrocode}
\def\verso@resetmergestate{\verso@mergestate=2}
\DeclareOption{mergecollisions}{\def\verso@resetmergestate{\verso@mergestate=0}}
@@ -221,6 +238,8 @@
\@esphack}
% \end{macrocode}
%
+% \subsection{Housekeeping: sizes and sentinels}
+%
% Now the layout parameters, and defaults.
% The dimensions |\versoleftmargin| and |\versotextwidth| specify the
% position of the text block on the verso page, and the declarations
@@ -318,12 +337,25 @@
% The paper size options to class files set |\paperheight| but not (or
% not necessarily) |\pdfpageheight|. If we don't set this, then
% output vertical positions will come out incorrectly if the latter
-% parameter doesn't default to the right value. The code in this package is
-% specific to pdf\TeX and friends, so we don't have to conditionalise.
-% \begin{macrocode}
-\pdfpageheight=\paperheight
+% parameter doesn't default to the right value. Lua\TeX\ and pdf\TeX\
+% (which includes Xe\TeX\ for this purpose) have slightly different
+% ways of organising page sizes, so we do have to conditionalise.
+% Here, we assume that everything that isn't Lua\TeX\ is pdf\TeX-like
+% enough that it has |\pdfpageheight|.
+% \begin{macrocode}
+\RequirePackage{iftex}
+\ifluatex
+ \typeout{Detected LuaTeX}
+ \pageheight=\paperheight
+ \let\pdfsavepos=\savepos
+ \let\pdflastypos=\lastypos
+\else
+ \pdfpageheight=\paperheight
+\fi
% \end{macrocode}
%
+% \subsection{Core logic}
+%
% Macro |\verso@note| is what's written to the aux file, and so is
% what we process on the next run, to discover the set of verso-notes
% we need to produce.
@@ -525,24 +557,53 @@
\def\verso@mergenote#1{\xdef\verso@mergenotelist{\verso@mergenotelist #1,}}
% \end{macrocode}
%
-% Save the original definition of |\shipout|, prior to our
-% redefining it below. We could do this perfectly well using the
-% \Lpackage{everyshi} package, but we do it by hand in order to avoid
-% the extra dependency.
+% \subsection{Overall processing logic, and shipout}
+%
+% We want to use the current shipout mechanism, but also to remain
+% compatible with pre-2020 \LaTeX, so conditionalise appropriately.
+% Note that we can't use the (apparently preferable)
+% |\IfFormatAtLeastTF| command to do this test: we want to continue to
+% work even when we're using a \LaTeX\ which is too old for this
+% command to be defined.
% \begin{macrocode}
-\let\verso@orig@shipout\shipout
+\newif\ifverso@Liii
+\@ifl@t@r\fmtversion{2020/10/01}\verso@Liiitrue\verso@Liiifalse
+\PackageInfo{versonotes}
+ {choosing support for \ifverso@Liii L3\else pre-L3\fi}
% \end{macrocode}
%
+% For the L3 case, we will use the |shipout/before| hook, and use
+% |\RawShipout| to output the separate versonotes pages.
+% See the \texttt{ltshipout-doc} documentation for details.
+% But in the pre-L3 case, save the original definition of |\shipout|
+% (using the L3 |\RawShipout| name for clarity),
+% prior to our redefining it below.
+% We could do this perfectly well using the \Lpackage{everyshi} package,
+% but we do it by hand in order to avoid the extra dependency.
+% \begin{macrocode}
+\ifverso@Liii\else
+ \let\RawShipout\shipout
+\fi
+% \end{macrocode}
%
-% Process a single page of verso-notes.
+% We process the versonotes a page at a time. We don't have to do
+% anything clever, because the page that a versonote lands on is
+% governed by the page that the |\versonote| call appears on. If we
+% have a long versonote at the bottom of a page, then we don't try to
+% spill over onto the next (that would presumably be possible, using
+% the inserts mechanism, but would be a significant jump in
+% complication). We regard this situation as one for the user to work
+% out for themself.
%
% Macro |\verso@processonepage@| consumes the next group in the
-% |\verso@pages| list. This is invoked as part of the redefined
-% |\shipout|.
+% |\verso@pages| list.
%
% Macro |\verso@processonepage| is called just before each shipout of
-% a `real' page. If we are putting notes on verso pages (the usual
-% case), then \emph{before} we ship out page~2, we must construct and
+% a `real' page, as the content of the \texttt{shipout/before} hook
+% (or as part of the redefined |\shipout| in the pre-L3 case).
+% If we are putting notes on verso pages
+% (ie, the usual case, as opposed to recto notes),
+% then \emph{before} we ship out page~2, we must construct and
% ship out the notes for page~2; we will have a set of notes for
% page~1 (which we expect will be empty), which we must discard; we
% achieve this by simply doing nothing if the current page is page~1.
@@ -580,7 +641,7 @@
% If there are no verso-notes on this page, then ship out an empty box.
% \begin{macrocode}
\ifx\@tempa\@empty
- \verso@orig@shipout\vbox{}
+ \RawShipout\vbox{}
% \end{macrocode}
% This is the normal case:
% create a box containing the |\\{...}| contents of the
@@ -614,15 +675,17 @@
% Construct and ship out the page contents.
% \begin{macrocode}
\long\def\\##1{\verso@setnote ##1}
- \verso@orig@shipout\vbox{
+ \RawShipout\vbox{
\verso@currentposition=0pt
#1}
\endgroup
\fi
- \else
% \end{macrocode}
-% The |\verso@pagestoskip| counter is still positive, so decrement it.
+% Otherwise, the |\verso@pagestoskip| counter is still positive,
+% indicating that we are skipping pages.
+% Decrement the counter and do nothing else.
% \begin{macrocode}
+ \else
\global\advance\verso@pagestoskip -1
\fi
% \end{macrocode}
@@ -636,20 +699,26 @@
\def\verso@processonepage{
\if@verso@processversonotes
\expandafter\verso@processonepage@\the\verso@pages\@nil
- \else
% \end{macrocode}
-% We don't seem to have any versonotes in this file, so don't come here again.
+% If this test is false, then we don't seem to have any versonotes in this file,
+% so don't come here again.
% \begin{macrocode}
+ \else
\global\let\verso@processonepage\relax
\fi
}
% \end{macrocode}
%
-% And finally, redefine |\shipout|.
+% And finally, do the |\shipout| gymnastics.
% \begin{macrocode}
-\def\shipout{\verso@processonepage \verso@orig@shipout}
+\ifverso@Liii
+ \AddToHook{shipout/before}{\verso@processonepage}
+\else
+ \def\shipout{\verso@processonepage \RawShipout}
+\fi
% \end{macrocode}
%
+% All done!
% \begin{macrocode}
%</package>
% \end{macrocode}
diff --git a/macros/latex/contrib/versonotes/versonotes.pdf b/macros/latex/contrib/versonotes/versonotes.pdf
index f5014748b1..be3b191245 100644
--- a/macros/latex/contrib/versonotes/versonotes.pdf
+++ b/macros/latex/contrib/versonotes/versonotes.pdf
Binary files differ