diff options
-rw-r--r-- | Master/texmf-dist/doc/latex/versonotes/README.md (renamed from Master/texmf-dist/doc/latex/versonotes/README) | 30 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/versonotes/sample.pdf | bin | 60265 -> 60735 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/versonotes/sample.tex | 27 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/versonotes/versonotes.pdf | bin | 137575 -> 54138 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/versonotes/versonotes.drv | 8 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/versonotes/versonotes.dtx | 137 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/versonotes/versonotes.sty | 36 |
7 files changed, 175 insertions, 63 deletions
diff --git a/Master/texmf-dist/doc/latex/versonotes/README b/Master/texmf-dist/doc/latex/versonotes/README.md index 6ff5b86d1ea..93e8923ad08 100644 --- a/Master/texmf-dist/doc/latex/versonotes/README +++ b/Master/texmf-dist/doc/latex/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/Master/texmf-dist/doc/latex/versonotes/sample.pdf b/Master/texmf-dist/doc/latex/versonotes/sample.pdf Binary files differindex 57d7fbc38fe..742f09f7912 100644 --- a/Master/texmf-dist/doc/latex/versonotes/sample.pdf +++ b/Master/texmf-dist/doc/latex/versonotes/sample.pdf diff --git a/Master/texmf-dist/doc/latex/versonotes/sample.tex b/Master/texmf-dist/doc/latex/versonotes/sample.tex index 6558462eb33..12f8b9329b9 100644 --- a/Master/texmf-dist/doc/latex/versonotes/sample.tex +++ b/Master/texmf-dist/doc/latex/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/Master/texmf-dist/doc/latex/versonotes/versonotes.pdf b/Master/texmf-dist/doc/latex/versonotes/versonotes.pdf Binary files differindex f5014748b1b..be3b191245d 100644 --- a/Master/texmf-dist/doc/latex/versonotes/versonotes.pdf +++ b/Master/texmf-dist/doc/latex/versonotes/versonotes.pdf diff --git a/Master/texmf-dist/source/latex/versonotes/versonotes.drv b/Master/texmf-dist/source/latex/versonotes/versonotes.drv index 33d8bed69d2..a018b4a4f5f 100644 --- a/Master/texmf-dist/source/latex/versonotes/versonotes.drv +++ b/Master/texmf-dist/source/latex/versonotes/versonotes.drv @@ -7,9 +7,9 @@ %% versonotes.dtx (with options: `driver') %% versonotes: Notes on verso pages %% -%% 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 @@ -28,12 +28,12 @@ %% %%%% File: versonotes.dtx -%%%% Source: 7d4f5fb7b19e, 2019-07-06T19:09:45+01:00 +%%%% Source: b86314fff92e, 2023-12-31T14:55:52+00:00 %% \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}} diff --git a/Master/texmf-dist/source/latex/versonotes/versonotes.dtx b/Master/texmf-dist/source/latex/versonotes/versonotes.dtx index afcdc70719f..e7b2eaaa893 100644 --- a/Master/texmf-dist/source/latex/versonotes/versonotes.dtx +++ b/Master/texmf-dist/source/latex/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/Master/texmf-dist/tex/latex/versonotes/versonotes.sty b/Master/texmf-dist/tex/latex/versonotes/versonotes.sty index 7d4db9bfb27..5dd599cc0cb 100644 --- a/Master/texmf-dist/tex/latex/versonotes/versonotes.sty +++ b/Master/texmf-dist/tex/latex/versonotes/versonotes.sty @@ -7,9 +7,9 @@ %% versonotes.dtx (with options: `package') %% versonotes: Notes on verso pages %% -%% 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 @@ -28,10 +28,10 @@ %% %%%% File: versonotes.dtx -%%%% Source: 7d4f5fb7b19e, 2019-07-06T19:09:45+01:00 +%%%% Source: b86314fff92e, 2023-12-31T14:55:52+00:00 %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{versonotes}[2019/07/06 v0.4] +\ProvidesPackage{versonotes}[2023/12/31 v0.5] \newif\if@verso@notesonleft \@verso@notesonlefttrue @@ -94,7 +94,15 @@ \advance\verso@pagebottom \headsep \advance\verso@pagebottom \textheight \newdimen\verso@currentposition -\pdfpageheight=\paperheight +\RequirePackage{iftex} +\ifluatex + \typeout{Detected LuaTeX} + \pageheight=\paperheight + \let\pdfsavepos=\savepos + \let\pdflastypos=\lastypos +\else + \pdfpageheight=\paperheight +\fi \long\def\verso@note#1#2#3{% \global\@verso@processversonotestrue \@tempcnta=#1 @@ -193,7 +201,13 @@ } \def\verso@mergenotelist{} \def\verso@mergenote#1{\xdef\verso@mergenotelist{\verso@mergenotelist #1,}} -\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} +\ifverso@Liii\else + \let\RawShipout\shipout +\fi \newcount\verso@pagestoskip \if@verso@notesonleft \verso@pagestoskip=1 @@ -204,7 +218,7 @@ \def\@tempa{#1} \ifnum\verso@pagestoskip=0 \ifx\@tempa\@empty - \verso@orig@shipout\vbox{} + \RawShipout\vbox{} \else \begingroup \let\protect\relax @@ -218,7 +232,7 @@ \vsize=1000mm % larger than any actual note \normalfont\normalsize \long\def\\##1{\verso@setnote ##1} - \verso@orig@shipout\vbox{ + \RawShipout\vbox{ \verso@currentposition=0pt #1} \endgroup @@ -234,7 +248,11 @@ \global\let\verso@processonepage\relax \fi } -\def\shipout{\verso@processonepage \verso@orig@shipout} +\ifverso@Liii + \AddToHook{shipout/before}{\verso@processonepage} +\else + \def\shipout{\verso@processonepage \RawShipout} +\fi \endinput %% %% End of file `versonotes.sty'. |