summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/doc/latex/versonotes/README28
-rw-r--r--Master/texmf-dist/doc/latex/versonotes/sample.pdfbin61447 -> 61287 bytes
-rw-r--r--Master/texmf-dist/doc/latex/versonotes/sample.tex38
-rw-r--r--Master/texmf-dist/doc/latex/versonotes/versonotes.pdfbin113031 -> 118875 bytes
-rw-r--r--Master/texmf-dist/source/latex/versonotes/versonotes.drv7
-rw-r--r--Master/texmf-dist/source/latex/versonotes/versonotes.dtx174
-rw-r--r--Master/texmf-dist/tex/latex/versonotes/versonotes.sty62
7 files changed, 222 insertions, 87 deletions
diff --git a/Master/texmf-dist/doc/latex/versonotes/README b/Master/texmf-dist/doc/latex/versonotes/README
index d85f9eda6aa..5249aa42b56 100644
--- a/Master/texmf-dist/doc/latex/versonotes/README
+++ b/Master/texmf-dist/doc/latex/versonotes/README
@@ -1,10 +1,10 @@
Package versonotes
==================
-Version 0.2, 2015 February 16
+Version 0.3, 2015 December 8
This package allows you to place notes on the verso pages of an
-otherwise single-sided document.
+otherwise single-sided document.
If, in the run of text, you include a call to the macro
`\versonote{This is a remark}`, then that text will be placed on the
@@ -14,12 +14,32 @@ 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 ,
-and the package is distributed on CTAN at ... *TBC*, but probably
-http://www.ctan.org/pkg/versonotes
+and the package is distributed on CTAN in
+[macros/latex/contrib/versonotes/][ctan]
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
+-------------
+
+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.
+
+Version 0.1, 2015 February 14
+
+ * Initial release
+
+
Norman Gray
http://nxg.me.uk
+
+
+[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 8212e76ce6b..18edbf6041a 100644
--- a/Master/texmf-dist/doc/latex/versonotes/sample.pdf
+++ b/Master/texmf-dist/doc/latex/versonotes/sample.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/versonotes/sample.tex b/Master/texmf-dist/doc/latex/versonotes/sample.tex
index 11d912509c4..6558462eb33 100644
--- a/Master/texmf-dist/doc/latex/versonotes/sample.tex
+++ b/Master/texmf-dist/doc/latex/versonotes/sample.tex
@@ -7,6 +7,8 @@
\setmainfont[Ligatures=TeX]{Hoefler Text}
\fi
+\def\UrlFont{\ttfamily \small}
+
\usepackage[mergecollisions]{versonotes}
% Adjust the layout of the notes to make them more compact.
@@ -16,7 +18,7 @@
\def\N#1#2{#1\versonote{\emph{#1}: #2}}
\parindent=0pt
-\parskip\medskipamount
+\parskip\bigskipamount
\begin{document}
\textbf{\Large Paradise Lost}
@@ -24,28 +26,23 @@
\emph{John Milton}
This excerpt comprises the first couple of stanzas of \emph{Paradise
- Lost}, with notes. The text derives from
+ 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
+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/}.
-The general editor of this edition is Thomas H. Luxon, and the text is
+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}.
-The notes are quoted here (without explicit permission, but I hope permissibly)
-to illustrate one use of the versonotes package (\url{http://www.ctan.org/pkg/versonotes}),
-and its response to collisions of notes.
-%% I hope that this excerpt is sufficiently small
-%% that it counts as ‘fair use’, and not as a ‘derived work’ in the terms
-%% of the original's Attribution-NoDerivs Creative Commons licence.
-Also, because a day with \emph{Paradise Lost} in
-it is a day improved.
-
\pagebreak
\textbf{\Large Book 1}
-%\medskip
\emph{The Argument}
-%\medskip
\emph{\emph{This first Book proposes, first in brief, the whole
Subject}, Mans
@@ -82,7 +79,6 @@ Associates thence attempt. \N{\emph{Pandemonium}}{Literally, ``all the
Satan rises, suddenly built out of the Deep: The infernal Peers there
sit in Councel.}
-\bigskip
Of Mans First Disobedience, and the Fruit\\
Of that Forbidden Tree, whose mortal tast\\
@@ -98,17 +94,17 @@ See also the Perseus Project edition of this passage.},\\
With loss of \emph{Eden}, till \N{one greater Man}{The messiah.}\\
Restore us, and regain the blissful Seat, \\
Sing \N{Heav'nly Muse}{Is the ``Heavenly Muse'' invoked here the same as the ``Urania,'' traditionally the muse of astronomy, invoked at book 7.1? More likely, contemporary readers would have first thought of the ``Holy Spirit,'' as the inspiration of Moses.}, that on the secret top\\
-Of \N{\emph{Oreb}}{Moses, ``That Shepherd,'' received the Law on Mt. Horeb (Deuteronomy 4: 10) or its spur, Mt. Sinai (Exodus 19: 20).}, or of \emph{Sinai}, didst inspire\\
+Of \N{\emph{Oreb}}{Moses, ``That Shepherd,'' received the Law on Mt.\ Horeb (Deuteronomy 4: 10) or its spur, Mt.\ Sinai (Exodus 19: 20).}, or of \emph{Sinai}, didst inspire\\
That Shepherd, who first taught the \N{chosen Seed}{The people of Israel. See Exodus 19-20.},\\
\N{In the Beginning}{The opening words of both Genesis (Geneva) and the Gospel of John (Geneva).} how the Heav'ns and Earth\\
-Rose \N{out of Chaos}{One of Milton's several heterodox positions. Orthodoxy held that God created everything ex nihilo, out of nothing (the ``void'' of Genesis 1:2; See Calvin's Commentary on Genesis). Milton borrows the concept of chaos, or unformed matter, from Hesiod and Platonic philosophy (especially the Timaeus 53b). Milton was also a monist, holding that all things were created out of God; see book 5.468-490.}: Or if \N{\emph{Sion}}{To the haunts of the classical muses near the Castalian spring on Mt. Parnassus, Milton prefers to claim Mt. Sion and its brooks Kidron and Siloa, a kind of biblically authorized Parnassus.} Hill \\
+Rose \N{out of Chaos}{One of Milton's several heterodox positions. Orthodoxy held that God created everything ex nihilo, out of nothing (the ``void'' of Genesis 1:2; See Calvin's Commentary on Genesis). Milton borrows the concept of chaos, or unformed matter, from Hesiod and Platonic philosophy (especially the Timaeus 53b). Milton was also a monist, holding that all things were created out of God; see book 5.468–490.}: Or if \N{\emph{Sion}}{To the haunts of the classical muses near the Castalian spring on Mt.\ Parnassus, Milton prefers to claim Mt.\ Sion and its brooks Kidron and Siloa, a kind of biblically authorized Parnassus.} Hill \\
Delight thee more, and \N{\emph{Siloa's Brook}}{``The Pool of Siloam (Hebrew:
-% בריכת השילוח‎,
+% בריכת השילוח‎,
Breikhat Hashiloah) is a rock-cut pool on the southern slope of the City of David, the original site of Jerusalem, located outside the walls of the Old City to the southeast. The pool was fed by the waters of the Gihon Spring, carried there by two aqueducts'' (Wikipedia, ``Pool of Siloam.'')} that flow'd\\
Fast by the Oracle of God; I thence\\
Invoke thy aid to my \N{adventrous Song}{Note the similarities between Milton's opening and the opening lines of Virgil's Aeneid and of Homer's Odyssey. Milton wants not only to compare his project to the ancient epics, but also himself to those poets and his main character, Adam, to their celebrated heroes. All of these comparisons raise interesting and complicated questions of authority, heroism, and nationalism in art.},\\
That with no middle flight intends to soar\\
-Above th' \N{Aonian Mount}{Mt. Helicon, in Aonia, sacred to the classical muses.}, while it pursues \\
+Above th' \N{Aonian Mount}{Mt.\ Helicon, in Aonia, sacred to the classical muses.}, while it pursues \\
Things unattempted yet \N{in Prose or Rhime}{The line ironically (maybe even sarcastically?) recalls the stanza 2 of canto 1 of Ariosto's Orlando Furioso.}.\\
And chiefly Thou O Spirit, that dost prefer\\
Before all Temples th' upright heart and pure,\\
@@ -119,8 +115,8 @@ And mad'st it \N{pregnant}{Milton invites us to imagine the Holy Spirit copulati
Illumin, what is low raise and support;\\
That to the highth of this great Argument\\
I may assert Eternal Providence, \\
-And justifie the wayes of God to men.\\
-\bigskip
+And justifie the wayes of God to men.
+
\N{Say first}{Compare this with Homer's invocation to the muse in the Iliad 1.8.}, for Heav'n hides nothing from thy view\\
Nor the deep Tract of Hell, say first what cause\\
Mov'd our Grand Parents in that happy State,\\
diff --git a/Master/texmf-dist/doc/latex/versonotes/versonotes.pdf b/Master/texmf-dist/doc/latex/versonotes/versonotes.pdf
index 391041740cc..fdd9ce89f64 100644
--- a/Master/texmf-dist/doc/latex/versonotes/versonotes.pdf
+++ b/Master/texmf-dist/doc/latex/versonotes/versonotes.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/versonotes/versonotes.drv b/Master/texmf-dist/source/latex/versonotes/versonotes.drv
index c819d13be10..6e4278644e9 100644
--- a/Master/texmf-dist/source/latex/versonotes/versonotes.drv
+++ b/Master/texmf-dist/source/latex/versonotes/versonotes.drv
@@ -7,7 +7,7 @@
%% versonotes.dtx (with options: `driver')
%% versonotes: Notes on verso pages
%%
-%% Release version 0.2, 2015 February 16.
+%% Release version 0.3, 2015 December 8.
%%
%% Copyright 2014, 2015 Norman Gray <http://nxg.me.uk>
%%
@@ -28,12 +28,12 @@
%%
%%%% File: versonotes.dtx
-%%%% Source: c64b7a550082, 2015-02-16T18:33:46+00:00
+%%%% Source: 1ce01fd3d4fc, 2015-09-16T13:05:15+01:00
%%
\documentclass{ltxdoc}
\title{versonotes: Notes on verso pages}
\author{Norman Gray\\\url{http://nxg.me.uk}}
-\date{Release 0.2}
+\date{Release 0.3, 2015 December 8}
\usepackage{url}
\newcommand\Lopt[1]{\textsf {#1}} % options
\newcommand\file[1]{\texttt {#1}}
@@ -51,7 +51,6 @@
\def\bs{$\backslash$}
-\OnlyDescription
\begin{document}
\maketitle
\DocInput{versonotes.dtx}
diff --git a/Master/texmf-dist/source/latex/versonotes/versonotes.dtx b/Master/texmf-dist/source/latex/versonotes/versonotes.dtx
index 7ee6b20abe5..8711ded03f7 100644
--- a/Master/texmf-dist/source/latex/versonotes/versonotes.dtx
+++ b/Master/texmf-dist/source/latex/versonotes/versonotes.dtx
@@ -2,10 +2,10 @@
% This is versonotes.dtx, which supports adding notes on verso pages,
% opposite annotation on the recto pages. Still sketchy
%%
-%% Release version 0.2, 2015 February 16.
+%% Release version 0.3, 2015 December 8.
%%
%% Copyright 2014, 2015 Norman Gray <http://nxg.me.uk>
-%%
+%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
@@ -13,26 +13,26 @@
%% http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
-%%
+%%
%% This work has the LPPL maintenance status `maintained'.
-%%
+%%
%% The Current Maintainer of this work is Norman Gray
-%%
+%%
%% This work consists of the files versonotes.dtx and versonotes.ins
%% and the derived file versonotes.sty.
%%
%%%% File: versonotes.dtx
-%<+package|driver|example>%%%% Source: c64b7a550082, 2015-02-16T18:33:46+00:00
+%<+package|driver|example>%%%% Source: 1ce01fd3d4fc, 2015-09-16T13:05:15+01:00
%%
%<+package>\NeedsTeXFormat{LaTeX2e}
-%<+package>\ProvidesPackage{versonotes}[2015/02/16 v0.2]
+%<+package>\ProvidesPackage{versonotes}[2015/12/08 v0.3]
%
%<*driver>
\documentclass{ltxdoc}
\title{versonotes: Notes on verso pages}
\author{Norman Gray\\\url{http://nxg.me.uk}}
-\date{Release 0.2}
+\date{Release 0.3, 2015 December 8}
\usepackage{url}
\newcommand\Lopt[1]{\textsf {#1}} % options
\newcommand\file[1]{\texttt {#1}}
@@ -64,8 +64,7 @@
\def\bs{$\backslash$}
-% Uncomment \OnlyDescription to skip the implementation
-\OnlyDescription
+%\OnlyDescription
\begin{document}
\maketitle
%\tableofcontents
@@ -94,19 +93,6 @@
%
% To invoke the package, use the command |\usepackage{versonotes}|.
%
-% 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.
-% 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
-% |\versoleftmargin=4cm|, and use |\renewcommand\versolayout{...}| to
-% override the paragraph formatting (this will typically require
-% changing |\rightskip|, |\leftskip| and |\parfillskip|). For more
-% elaborate effects (for example changing the note font size and
-% spacing), you will need to redefine |\versolayout|.
-%
% 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
@@ -123,17 +109,56 @@
% \Lpackage{eledmac}
% package.\footnote{\texttt{http://www.ctan.org/pkg/eledmac}}
%
+% 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.
+% 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
+% |\versoleftmargin=4cm|, and use |\renewcommand\versolayout{...}| to
+% override the paragraph formatting (this will typically require
+% changing |\rightskip|, |\leftskip| and |\parfillskip|). For more
+% elaborate effects (for example changing the note font size and
+% spacing), you will need to redefine |\versolayout|.
+%
+% \subsection*{Recto notes}
+%
+% If the package is invoked with the \Lopt{rectonotes} option, then it
+% runs in a complementary mode in which the notes are placed on the
+% recto page (the right-hand one) instead of the verso. The default
+% |\versolayout| in this case (which of course is really a recto
+% layout) is slightly different, and is based on the preexisting
+% document |\oddsidemargin|. All the pages in the document (apart
+% from the front page) are then formatted as verso pages, though still
+% only the non-note pages are numbered.
+%
+% In this mode, the `add a note' command is still called
+% |\versonote|. You may find it convenient to rename that with
+% |\let\rectonote = \versonote| or |\let\sidenote = \versonote|.
+%
% \subsection*{Notes}
% \begin{itemize}
% \item The package uses the |\pdfsavepos| primitive, and so requires
-% \texttt{pdflatex} or \texttt{xelatex} (and \texttt{luatex}?).
+% \texttt{pdflatex}, \texttt{xelatex}, or \texttt{luatex}.
%
% \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
% located opposite the position where the |\versonote| macro was
% called on the \emph{previous} run.
%
+% \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.
+%
% \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.
+%
% \StopEventually{}
% \newpage
@@ -146,10 +171,18 @@
% The package contains a single user-visible command, and three
% configuration parameters.
%
+% The normal behaviour of this package is to place notes on the verso
+% page (ahem, hence the name). But we can swap that around.
+% \begin{macrocode}
+\newif\if@verso@notesonleft
+\@verso@notesonlefttrue
+% \end{macrocode}
+%
% Configuration options:
% \begin{macrocode}
\def\verso@resetmergestate{\verso@mergestate=2}
\DeclareOption{mergecollisions}{\def\verso@resetmergestate{\verso@mergestate=0}}
+\DeclareOption{rectonotes}{\@verso@notesonleftfalse}
\ProcessOptions
% \end{macrocode}
%
@@ -173,16 +206,26 @@
\newdimen\versoleftmargin
\versoleftmargin=\paperwidth
\advance\versoleftmargin -\textwidth
- \advance\versoleftmargin -\evensidemargin
\advance\versoleftmargin -\hoffset
\advance\versoleftmargin -1in
-\def\versolayout{
- \leftskip=0pt plus 1fil
- \rightskip=0pt
- \parfillskip=0pt
- \parindent=0pt
- \parskip=\medskipamount
-}
+\if@verso@notesonleft
+ \advance\versoleftmargin -\evensidemargin
+ \def\versolayout{
+ \leftskip=0pt plus 1fil
+ \rightskip=0pt
+ \parfillskip=0pt
+ \parindent=0pt
+ \parskip=\medskipamount
+ }
+\else
+ \advance\versoleftmargin -\oddsidemargin
+ \def\versolayout{
+ \leftskip=0pt
+ \rightskip=0pt plus 4em
+ \parindent=0pt
+ \parskip=\medskipamount
+ }
+\fi
% \end{macrocode}
%
% Add a sentinel at the end of the document
@@ -193,8 +236,21 @@
% \end{macrocode}
%
% Define various bits of working storage.
+%
+% The |\verso@pages| token list needs to have an extra leading `page'
+% since the logic in |\verso@processonepage@| can skip it.
% \begin{macrocode}
\newtoks\verso@pages
+ \if@verso@notesonleft
+ \verso@pages={}
+ \else
+ \verso@pages={{}}
+ \fi
+% \end{macrocode}
+% Notes on a single page (which is kept track of by
+% |\verso@currentpagenum| are assembled into |\verso@currentpage|
+% before being transferred as a unit into |\verso@pages|.
+% \begin{macrocode}
\newtoks\verso@currentpage
\newcount\verso@currentpagenum
\verso@currentpagenum=1
@@ -259,8 +315,13 @@
\@tempdima=#2 % #2 < 0pt is the end-of-document flag
\loop
\@tempswafalse
- \ifnum\@tempcnta>\verso@currentpagenum \@tempswatrue \fi
- \ifdim\@tempdima < 0pt \@tempswatrue \@tempdima=0pt \fi
+ \ifnum\@tempcnta > \verso@currentpagenum
+ \@tempswatrue
+ \fi
+ \ifdim\@tempdima < 0pt
+ \@tempswatrue
+ \@tempdima=0pt
+ \fi
\if@tempswa
\edef\@tempa{\the\verso@pages {\the\verso@currentpage}}
\global\verso@pages=\expandafter{\@tempa}
@@ -268,6 +329,14 @@
\verso@currentpage={}
\repeat
\verso@currentpage=\expandafter{\the\verso@currentpage \\{{#1}{#2}{#3}}}
+% \end{macrocode}
+% The last time around, add an extra pair of tokens at the end of the
+% |\verso@pages| list. These provide the arguments to
+% |\verso@processonepage@| on the last time it's called.
+% \begin{macrocode}
+ \ifdim\@tempdima=0pt
+ \global\verso@pages=\expandafter{\the\verso@pages {}{}}
+ \fi
}
% \end{macrocode}
%
@@ -353,7 +422,7 @@
% \begin{macrocode}
\setbox0=\vtop{
\versolayout
- \the\verso@accumulatenote
+ \the\verso@accumulatenote
#3\par}
\verso@accumulatenote={}
% \end{macrocode}
@@ -433,16 +502,36 @@
%
%
% Process a single page of verso-notes.
+%
% Macro |\verso@processonepage@| consumes the next group in the
-% |\verso@pages| list. This is invoked as part of the redefined |\shipout|.
+% |\verso@pages| list. This is invoked as part of the redefined
+% |\shipout|.
+%
+% 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
+% 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.
+% If, on the other hand, we are putting notes on recto pages, then we
+% must instead ship out the notes for page~2 just before shipping out page~3, and
+% 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 |{{}}|.
% \begin{macrocode}
\long\def\verso@processonepage@#1#2\@nil{
\def\@tempa{#1}
% \end{macrocode}
-% We can't have verso-notes opposite the first page. Any notes
-% which would appear in such a position are silently discarded.
+% Do nothing on page~1 (in the verso case), or pages~1 and~2 (in the
+% recto case). Any notes which would appear in such a position are
+% silently discarded.
% \begin{macrocode}
- \ifnum\c@page>1
+ \if@verso@notesonleft
+ \@tempcnta=1
+ \else
+ \@tempcnta=2
+ \fi
+ \ifnum\c@page>\@tempcnta
% \end{macrocode}
% If there are no verso-notes on this page, then ship out an empty box.
% \begin{macrocode}
@@ -497,9 +586,11 @@
% \begin{macrocode}
\def\verso@processonepage{
\if@verso@processversonotes
- \expandafter\verso@processonepage@\the\verso@pages{}{}\@nil
+ \expandafter\verso@processonepage@\the\verso@pages\@nil
\else
- % we don't seem to have any versonotes in this file: don't come here again
+% \end{macrocode}
+% We don't seem to have any versonotes in this file, so don't come here again.
+% \begin{macrocode}
\global\let\verso@processonepage\relax
\fi
}
@@ -510,7 +601,6 @@
\def\shipout{\verso@processonepage \verso@orig@shipout}
% \end{macrocode}
%
-% That's all.
% \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 e9c4808afca..34c8998dd3f 100644
--- a/Master/texmf-dist/tex/latex/versonotes/versonotes.sty
+++ b/Master/texmf-dist/tex/latex/versonotes/versonotes.sty
@@ -7,7 +7,7 @@
%% versonotes.dtx (with options: `package')
%% versonotes: Notes on verso pages
%%
-%% Release version 0.2, 2015 February 16.
+%% Release version 0.3, 2015 December 8.
%%
%% Copyright 2014, 2015 Norman Gray <http://nxg.me.uk>
%%
@@ -28,13 +28,16 @@
%%
%%%% File: versonotes.dtx
-%%%% Source: c64b7a550082, 2015-02-16T18:33:46+00:00
+%%%% Source: 1ce01fd3d4fc, 2015-09-16T13:05:15+01:00
%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{versonotes}[2015/02/16 v0.2]
+\ProvidesPackage{versonotes}[2015/12/08 v0.3]
+\newif\if@verso@notesonleft
+\@verso@notesonlefttrue
\def\verso@resetmergestate{\verso@mergestate=2}
\DeclareOption{mergecollisions}{\def\verso@resetmergestate{\verso@mergestate=0}}
+\DeclareOption{rectonotes}{\@verso@notesonleftfalse}
\ProcessOptions
\long\def\versonote#1{\@bsphack
\pdfsavepos
@@ -45,20 +48,35 @@
\newdimen\versoleftmargin
\versoleftmargin=\paperwidth
\advance\versoleftmargin -\textwidth
- \advance\versoleftmargin -\evensidemargin
\advance\versoleftmargin -\hoffset
\advance\versoleftmargin -1in
-\def\versolayout{
- \leftskip=0pt plus 1fil
- \rightskip=0pt
- \parfillskip=0pt
- \parindent=0pt
- \parskip=\medskipamount
-}
+\if@verso@notesonleft
+ \advance\versoleftmargin -\evensidemargin
+ \def\versolayout{
+ \leftskip=0pt plus 1fil
+ \rightskip=0pt
+ \parfillskip=0pt
+ \parindent=0pt
+ \parskip=\medskipamount
+ }
+\else
+ \advance\versoleftmargin -\oddsidemargin
+ \def\versolayout{
+ \leftskip=0pt
+ \rightskip=0pt plus 4em
+ \parindent=0pt
+ \parskip=\medskipamount
+ }
+\fi
\def\end@versonote{%
\write\@auxout{\string\verso@note{\the\c@page}{-1pt}{}}}
\AtEndDocument{\end@versonote}
\newtoks\verso@pages
+ \if@verso@notesonleft
+ \verso@pages={}
+ \else
+ \verso@pages={{}}
+ \fi
\newtoks\verso@currentpage
\newcount\verso@currentpagenum
\verso@currentpagenum=1
@@ -86,8 +104,13 @@
\@tempdima=#2 % #2 < 0pt is the end-of-document flag
\loop
\@tempswafalse
- \ifnum\@tempcnta>\verso@currentpagenum \@tempswatrue \fi
- \ifdim\@tempdima < 0pt \@tempswatrue \@tempdima=0pt \fi
+ \ifnum\@tempcnta > \verso@currentpagenum
+ \@tempswatrue
+ \fi
+ \ifdim\@tempdima < 0pt
+ \@tempswatrue
+ \@tempdima=0pt
+ \fi
\if@tempswa
\edef\@tempa{\the\verso@pages {\the\verso@currentpage}}
\global\verso@pages=\expandafter{\@tempa}
@@ -95,6 +118,9 @@
\verso@currentpage={}
\repeat
\verso@currentpage=\expandafter{\the\verso@currentpage \\{{#1}{#2}{#3}}}
+ \ifdim\@tempdima=0pt
+ \global\verso@pages=\expandafter{\the\verso@pages {}{}}
+ \fi
}
\AtEndDocument{\long\def\verso@note#1#2#3{}}
\def\verso@testmergenote#1,#2\@nil{
@@ -173,7 +199,12 @@
\let\verso@orig@shipout\shipout
\long\def\verso@processonepage@#1#2\@nil{
\def\@tempa{#1}
- \ifnum\c@page>1
+ \if@verso@notesonleft
+ \@tempcnta=1
+ \else
+ \@tempcnta=2
+ \fi
+ \ifnum\c@page>\@tempcnta
\ifx\@tempa\@empty
\verso@orig@shipout\vbox{}
\else
@@ -198,9 +229,8 @@
\global\verso@pages={#2}}
\def\verso@processonepage{
\if@verso@processversonotes
- \expandafter\verso@processonepage@\the\verso@pages{}{}\@nil
+ \expandafter\verso@processonepage@\the\verso@pages\@nil
\else
- % we don't seem to have any versonotes in this file: don't come here again
\global\let\verso@processonepage\relax
\fi
}