From 7ecd3c9fef7acbaf8f22ce67409122655ad704a3 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 6 Jul 2019 20:41:23 +0000 Subject: versonotes (6jul19) git-svn-id: svn://tug.org/texlive/trunk@51568 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/versonotes/README | 31 ++++--- Master/texmf-dist/doc/latex/versonotes/sample.pdf | Bin 61287 -> 60265 bytes .../texmf-dist/doc/latex/versonotes/versonotes.pdf | Bin 118875 -> 137575 bytes .../source/latex/versonotes/versonotes.drv | 10 +-- .../source/latex/versonotes/versonotes.dtx | 97 ++++++++++++++++----- .../texmf-dist/tex/latex/versonotes/versonotes.sty | 28 +++--- 6 files changed, 111 insertions(+), 55 deletions(-) diff --git a/Master/texmf-dist/doc/latex/versonotes/README b/Master/texmf-dist/doc/latex/versonotes/README index 5249aa42b56..6ff5b86d1ea 100644 --- a/Master/texmf-dist/doc/latex/versonotes/README +++ b/Master/texmf-dist/doc/latex/versonotes/README @@ -1,7 +1,7 @@ Package versonotes ================== -Version 0.3, 2015 December 8 +Version 0.4, 2019 July 6 This package allows you to place notes on the verso pages of an otherwise single-sided document. @@ -13,33 +13,40 @@ 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. -The source is at https://bitbucket.org/nxg/versonotes , +The source is at [bitbucket][bitbucket], and the package is distributed on CTAN in [macros/latex/contrib/versonotes/][ctan] +Copyright 2014, 2015, 2019, 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. -Release notes -------------- +Acknowledgements, and release notes +----------------------------------- + +Thanks to Thomas H. Luxon for permission to include the +“Paradise Lost” notes in the sample text. + +Version 0.4, 2019 July 6 + Support changing the initial page number (thanks to P J + Couch for the suggestion). Version 0.3, 2015 December 8 * Minor documentation adjustments. - * Added the [rectonotes] option. -Version 0.2, 2015 February 16 - - * Fixed a few formatting and distribution infelicities. + * Added the [rectonotes] option (thanks to Axel Berger for + this suggestion). -Version 0.1, 2015 February 14 +Version 0.2, 2015 February 16 + Initial public release. - * Initial release Norman Gray -http://nxg.me.uk - +https://nxg.me.uk +[bitbucket]: https://bitbucket.org/nxg/versonotes [ctan]: http://www.ctan.org/pkg/versonotes diff --git a/Master/texmf-dist/doc/latex/versonotes/sample.pdf b/Master/texmf-dist/doc/latex/versonotes/sample.pdf index 18edbf6041a..57d7fbc38fe 100644 Binary files a/Master/texmf-dist/doc/latex/versonotes/sample.pdf and b/Master/texmf-dist/doc/latex/versonotes/sample.pdf differ diff --git a/Master/texmf-dist/doc/latex/versonotes/versonotes.pdf b/Master/texmf-dist/doc/latex/versonotes/versonotes.pdf index fdd9ce89f64..f5014748b1b 100644 Binary files a/Master/texmf-dist/doc/latex/versonotes/versonotes.pdf and b/Master/texmf-dist/doc/latex/versonotes/versonotes.pdf differ diff --git a/Master/texmf-dist/source/latex/versonotes/versonotes.drv b/Master/texmf-dist/source/latex/versonotes/versonotes.drv index 6e4278644e9..33d8bed69d2 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.3, 2015 December 8. +%% Release version 0.4, 2019 July 6. %% -%% Copyright 2014, 2015 Norman Gray +%% Copyright 2014, 2015, 2019 Norman Gray %% %% 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: 1ce01fd3d4fc, 2015-09-16T13:05:15+01:00 +%%%% Source: 7d4f5fb7b19e, 2019-07-06T19:09:45+01:00 %% \documentclass{ltxdoc} \title{versonotes: Notes on verso pages} -\author{Norman Gray\\\url{http://nxg.me.uk}} -\date{Release 0.3, 2015 December 8} +\author{Norman Gray\\\url{https://nxg.me.uk}} +\date{Release 0.4, 2019 July 6} \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 8711ded03f7..afcdc70719f 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.3, 2015 December 8. +%% Release version 0.4, 2019 July 6. %% -%% Copyright 2014, 2015 Norman Gray +%% Copyright 2014, 2015, 2019 Norman Gray %% %% 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: 1ce01fd3d4fc, 2015-09-16T13:05:15+01:00 +%<+package|driver|example>%%%% Source: 7d4f5fb7b19e, 2019-07-06T19:09:45+01:00 %% %<+package>\NeedsTeXFormat{LaTeX2e} -%<+package>\ProvidesPackage{versonotes}[2015/12/08 v0.3] +%<+package>\ProvidesPackage{versonotes}[2019/07/06 v0.4] % %<*driver> \documentclass{ltxdoc} \title{versonotes: Notes on verso pages} -\author{Norman Gray\\\url{http://nxg.me.uk}} -\date{Release 0.3, 2015 December 8} +\author{Norman Gray\\\url{https://nxg.me.uk}} +\date{Release 0.4, 2019 July 6} \usepackage{url} \newcommand\Lopt[1]{\textsf {#1}} % options \newcommand\file[1]{\texttt {#1}} @@ -64,7 +64,6 @@ \def\bs{$\backslash$} -%\OnlyDescription \begin{document} \maketitle %\tableofcontents @@ -93,6 +92,11 @@ % % To invoke the package, use the command |\usepackage{versonotes}|. % +% It is possible to start the document other than on page one. To do +% this, you can call |\setcounter{page}{|\emph{n}|}| as usual, but it +% must be done \emph{before} the line |\usepackage{versonotes}|. The +% package may get confused if the page number is changed at other times. +% % If two notes come too close after one another, the second would % overprint the first if we did not take steps to avoid this. By % default, they are separated from each other by a short horizontal @@ -112,7 +116,7 @@ % The dimensions |\versoleftmargin| and |\versotextwidth| specify the % position of the text block on the verso page. The defaults for % these are based on the |\textwidth| and |\evensidemargin| of the -% document at the time the package is loaded. +% document \emph{at the time the package is loaded}. % By default, verso paragraphs are set ragged-left; with the % declarations in |\versolayout| setting the paragraph parameters. % You may reset the first two dimensions with for example @@ -147,6 +151,9 @@ % located opposite the position where the |\versonote| macro was % called on the \emph{previous} run. % +% \item If notes collide, you may well have to re-run \LaTeX\ several +% times. There is quite a lot of state in the |.aux| file. +% % \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 @@ -154,10 +161,28 @@ % % \end{itemize} % -% \subsection*{Acknowledgements} -% -% Thanks to Thomas H.\ Luxon for permission to include the `Paradise -% Lost' notes in the sample text, and to Axel Berger for suggesting the `rectonotes' option. +% \subsection*{Acknowledgements, and release notes} +% +% \iffalse @RELEASENOTES@ \fi +% +% +% Thanks to Thomas H. Luxon for permission to include the +% ‘Paradise Lost’ notes in the sample text. +% +% \begin{description} +% \item[Version 0.4, 2019 July 6]\relax +% Support changing the initial page number +% (thanks to P J Couch for the suggestion). +% \item[Version 0.3, 2015 December 8]\relax +% \leavevmode\begin{itemize} +% \item Minor documentation adjustments. +% \item Added the [rectonotes] option +% (thanks to Axel Berger for this suggestion). +% \end{itemize} +% \item[Version 0.2, 2015 February 16]\relax +% Initial public release. +% \end{description} +% % % \StopEventually{} @@ -252,8 +277,16 @@ % before being transferred as a unit into |\verso@pages|. % \begin{macrocode} \newtoks\verso@currentpage +% \end{macrocode} +% We keep track of page numbers when invoking |\verso@note| below. We +% initialise this to be the current page number (typically~1). Doing +% this this way means that if the document sets the current page +% number using |\setcounter{page}{n}| \emph{before} loading the +% package, then we will respect that. We will get confused if the +% page number is changed at other points. +% \begin{macrocode} \newcount\verso@currentpagenum - \verso@currentpagenum=1 + \verso@currentpagenum=\c@page \newcount\verso@currentnotenum \verso@currentnotenum=0 \newdimen\verso@spacerskip @@ -298,14 +331,14 @@ \long\def\verso@note#1#2#3{% \global\@verso@processversonotestrue % \end{macrocode} -% Store the target page number, and issue a warning if this was +% Store the target page number. It would be nice to issue a warning if this is % indicated to appear on the (ignored) first page; such notes are -% silently discarded below. +% silently discarded below. However detecting this here requires that +% |\@tempcnta| is equal to~1 on the call of this, and we can't +% guarantee this if we support calling |\setcounter{page}{x}| before +% loading the package. % \begin{macrocode} \@tempcnta=#1 - \ifnum\@tempcnta=1 - \PackageWarning{versopages}{page 1 verso text will be ignored} - \fi % \end{macrocode} % Gather pages from the .aux file, assembling them into a single list % in |\verso@pages| with one group per page, each containing a @@ -518,6 +551,22 @@ % must similarly do nothing on pages~1 and~2. This works because % in the latter case we have initialised |\verso@pages| with an extra % leading |{{}}|. +% +% We manage the page skipping by decrementing a `pages to skip' +% counter. The more obvious way of doing that it to test the value of +% |\@tempcnta|, which at this point holds the current page number, but +% this produces the wrong answer if the document starts at other than +% page~1 (perhaps because the document includes |\setcounter{page}{99}|). +% \begin{macrocode} +\newcount\verso@pagestoskip +\if@verso@notesonleft + \verso@pagestoskip=1 +\else + \verso@pagestoskip=2 +\fi +% \end{macrocode} +% +% Define |\verso@processonepage@|. % \begin{macrocode} \long\def\verso@processonepage@#1#2\@nil{ \def\@tempa{#1} @@ -526,12 +575,7 @@ % recto case). Any notes which would appear in such a position are % silently discarded. % \begin{macrocode} - \if@verso@notesonleft - \@tempcnta=1 - \else - \@tempcnta=2 - \fi - \ifnum\c@page>\@tempcnta + \ifnum\verso@pagestoskip=0 % \end{macrocode} % If there are no verso-notes on this page, then ship out an empty box. % \begin{macrocode} @@ -575,6 +619,11 @@ #1} \endgroup \fi + \else +% \end{macrocode} +% The |\verso@pagestoskip| counter is still positive, so decrement it. +% \begin{macrocode} + \global\advance\verso@pagestoskip -1 \fi % \end{macrocode} % Finally, set |\verso@pages| to the tail of the list. diff --git a/Master/texmf-dist/tex/latex/versonotes/versonotes.sty b/Master/texmf-dist/tex/latex/versonotes/versonotes.sty index 34c8998dd3f..7d4db9bfb27 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.3, 2015 December 8. +%% Release version 0.4, 2019 July 6. %% -%% Copyright 2014, 2015 Norman Gray +%% Copyright 2014, 2015, 2019 Norman Gray %% %% 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: 1ce01fd3d4fc, 2015-09-16T13:05:15+01:00 +%%%% Source: 7d4f5fb7b19e, 2019-07-06T19:09:45+01:00 %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{versonotes}[2015/12/08 v0.3] +\ProvidesPackage{versonotes}[2019/07/06 v0.4] \newif\if@verso@notesonleft \@verso@notesonlefttrue @@ -79,7 +79,7 @@ \fi \newtoks\verso@currentpage \newcount\verso@currentpagenum - \verso@currentpagenum=1 + \verso@currentpagenum=\c@page \newcount\verso@currentnotenum \verso@currentnotenum=0 \newdimen\verso@spacerskip @@ -98,9 +98,6 @@ \long\def\verso@note#1#2#3{% \global\@verso@processversonotestrue \@tempcnta=#1 - \ifnum\@tempcnta=1 - \PackageWarning{versopages}{page 1 verso text will be ignored} - \fi \@tempdima=#2 % #2 < 0pt is the end-of-document flag \loop \@tempswafalse @@ -197,14 +194,15 @@ \def\verso@mergenotelist{} \def\verso@mergenote#1{\xdef\verso@mergenotelist{\verso@mergenotelist #1,}} \let\verso@orig@shipout\shipout +\newcount\verso@pagestoskip +\if@verso@notesonleft + \verso@pagestoskip=1 +\else + \verso@pagestoskip=2 +\fi \long\def\verso@processonepage@#1#2\@nil{ \def\@tempa{#1} - \if@verso@notesonleft - \@tempcnta=1 - \else - \@tempcnta=2 - \fi - \ifnum\c@page>\@tempcnta + \ifnum\verso@pagestoskip=0 \ifx\@tempa\@empty \verso@orig@shipout\vbox{} \else @@ -225,6 +223,8 @@ #1} \endgroup \fi + \else + \global\advance\verso@pagestoskip -1 \fi \global\verso@pages={#2}} \def\verso@processonepage{ -- cgit v1.2.3