summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/versonotes
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/versonotes
Initial commit
Diffstat (limited to 'macros/latex/contrib/versonotes')
-rw-r--r--macros/latex/contrib/versonotes/LICENCE.txt416
-rw-r--r--macros/latex/contrib/versonotes/README52
-rw-r--r--macros/latex/contrib/versonotes/sample.pdfbin0 -> 60265 bytes
-rw-r--r--macros/latex/contrib/versonotes/sample.tex178
-rw-r--r--macros/latex/contrib/versonotes/versonotes.dtx658
-rw-r--r--macros/latex/contrib/versonotes/versonotes.ins12
-rw-r--r--macros/latex/contrib/versonotes/versonotes.pdfbin0 -> 137575 bytes
7 files changed, 1316 insertions, 0 deletions
diff --git a/macros/latex/contrib/versonotes/LICENCE.txt b/macros/latex/contrib/versonotes/LICENCE.txt
new file mode 100644
index 0000000000..2244313901
--- /dev/null
+++ b/macros/latex/contrib/versonotes/LICENCE.txt
@@ -0,0 +1,416 @@
+The LaTeX Project Public License
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+
+LPPL Version 1.3c 2008-05-04
+
+Copyright 1999 2002-2008 LaTeX3 Project
+ Everyone is allowed to distribute verbatim copies of this
+ license document, but modification of it is not allowed.
+
+
+PREAMBLE
+========
+
+The LaTeX Project Public License (LPPL) is the primary license under
+which the LaTeX kernel and the base LaTeX packages are distributed.
+
+You may use this license for any work of which you hold the copyright
+and which you wish to distribute. This license may be particularly
+suitable if your work is TeX-related (such as a LaTeX package), but
+it is written in such a way that you can use it even if your work is
+unrelated to TeX.
+
+The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE',
+below, gives instructions, examples, and recommendations for authors
+who are considering distributing their works under this license.
+
+This license gives conditions under which a work may be distributed
+and modified, as well as conditions under which modified versions of
+that work may be distributed.
+
+We, the LaTeX3 Project, believe that the conditions below give you
+the freedom to make and distribute modified versions of your work
+that conform with whatever technical specifications you wish while
+maintaining the availability, integrity, and reliability of
+that work. If you do not see how to achieve your goal while
+meeting these conditions, then read the document `cfgguide.tex'
+and `modguide.tex' in the base LaTeX distribution for suggestions.
+
+
+DEFINITIONS
+===========
+
+In this license document the following terms are used:
+
+ `Work'
+ Any work being distributed under this License.
+
+ `Derived Work'
+ Any work that under any applicable law is derived from the Work.
+
+ `Modification'
+ Any procedure that produces a Derived Work under any applicable
+ law -- for example, the production of a file containing an
+ original file associated with the Work or a significant portion of
+ such a file, either verbatim or with modifications and/or
+ translated into another language.
+
+ `Modify'
+ To apply any procedure that produces a Derived Work under any
+ applicable law.
+
+ `Distribution'
+ Making copies of the Work available from one person to another, in
+ whole or in part. Distribution includes (but is not limited to)
+ making any electronic components of the Work accessible by
+ file transfer protocols such as FTP or HTTP or by shared file
+ systems such as Sun's Network File System (NFS).
+
+ `Compiled Work'
+ A version of the Work that has been processed into a form where it
+ is directly usable on a computer system. This processing may
+ include using installation facilities provided by the Work,
+ transformations of the Work, copying of components of the Work, or
+ other activities. Note that modification of any installation
+ facilities provided by the Work constitutes modification of the Work.
+
+ `Current Maintainer'
+ A person or persons nominated as such within the Work. If there is
+ no such explicit nomination then it is the `Copyright Holder' under
+ any applicable law.
+
+ `Base Interpreter'
+ A program or process that is normally needed for running or
+ interpreting a part or the whole of the Work.
+
+ A Base Interpreter may depend on external components but these
+ are not considered part of the Base Interpreter provided that each
+ external component clearly identifies itself whenever it is used
+ interactively. Unless explicitly specified when applying the
+ license to the Work, the only applicable Base Interpreter is a
+ `LaTeX-Format' or in the case of files belonging to the
+ `LaTeX-format' a program implementing the `TeX language'.
+
+
+
+CONDITIONS ON DISTRIBUTION AND MODIFICATION
+===========================================
+
+1. Activities other than distribution and/or modification of the Work
+are not covered by this license; they are outside its scope. In
+particular, the act of running the Work is not restricted and no
+requirements are made concerning any offers of support for the Work.
+
+2. You may distribute a complete, unmodified copy of the Work as you
+received it. Distribution of only part of the Work is considered
+modification of the Work, and no right to distribute such a Derived
+Work may be assumed under the terms of this clause.
+
+3. You may distribute a Compiled Work that has been generated from a
+complete, unmodified copy of the Work as distributed under Clause 2
+above, as long as that Compiled Work is distributed in such a way that
+the recipients may install the Compiled Work on their system exactly
+as it would have been installed if they generated a Compiled Work
+directly from the Work.
+
+4. If you are the Current Maintainer of the Work, you may, without
+restriction, modify the Work, thus creating a Derived Work. You may
+also distribute the Derived Work without restriction, including
+Compiled Works generated from the Derived Work. Derived Works
+distributed in this manner by the Current Maintainer are considered to
+be updated versions of the Work.
+
+5. If you are not the Current Maintainer of the Work, you may modify
+your copy of the Work, thus creating a Derived Work based on the Work,
+and compile this Derived Work, thus creating a Compiled Work based on
+the Derived Work.
+
+6. If you are not the Current Maintainer of the Work, you may
+distribute a Derived Work provided the following conditions are met
+for every component of the Work unless that component clearly states
+in the copyright notice that it is exempt from that condition. Only
+the Current Maintainer is allowed to add such statements of exemption
+to a component of the Work.
+
+ a. If a component of this Derived Work can be a direct replacement
+ for a component of the Work when that component is used with the
+ Base Interpreter, then, wherever this component of the Work
+ identifies itself to the user when used interactively with that
+ Base Interpreter, the replacement component of this Derived Work
+ clearly and unambiguously identifies itself as a modified version
+ of this component to the user when used interactively with that
+ Base Interpreter.
+
+ b. Every component of the Derived Work contains prominent notices
+ detailing the nature of the changes to that component, or a
+ prominent reference to another file that is distributed as part
+ of the Derived Work and that contains a complete and accurate log
+ of the changes.
+
+ c. No information in the Derived Work implies that any persons,
+ including (but not limited to) the authors of the original version
+ of the Work, provide any support, including (but not limited to)
+ the reporting and handling of errors, to recipients of the
+ Derived Work unless those persons have stated explicitly that
+ they do provide such support for the Derived Work.
+
+ d. You distribute at least one of the following with the Derived Work:
+
+ 1. A complete, unmodified copy of the Work;
+ if your distribution of a modified component is made by
+ offering access to copy the modified component from a
+ designated place, then offering equivalent access to copy
+ the Work from the same or some similar place meets this
+ condition, even though third parties are not compelled to
+ copy the Work along with the modified component;
+
+ 2. Information that is sufficient to obtain a complete,
+ unmodified copy of the Work.
+
+7. If you are not the Current Maintainer of the Work, you may
+distribute a Compiled Work generated from a Derived Work, as long as
+the Derived Work is distributed to all recipients of the Compiled
+Work, and as long as the conditions of Clause 6, above, are met with
+regard to the Derived Work.
+
+8. The conditions above are not intended to prohibit, and hence do not
+apply to, the modification, by any method, of any component so that it
+becomes identical to an updated version of that component of the Work as
+it is distributed by the Current Maintainer under Clause 4, above.
+
+9. Distribution of the Work or any Derived Work in an alternative
+format, where the Work or that Derived Work (in whole or in part) is
+then produced by applying some process to that format, does not relax or
+nullify any sections of this license as they pertain to the results of
+applying that process.
+
+10. a. A Derived Work may be distributed under a different license
+ provided that license itself honors the conditions listed in
+ Clause 6 above, in regard to the Work, though it does not have
+ to honor the rest of the conditions in this license.
+
+ b. If a Derived Work is distributed under a different license, that
+ Derived Work must provide sufficient documentation as part of
+ itself to allow each recipient of that Derived Work to honor the
+ restrictions in Clause 6 above, concerning changes from the Work.
+
+11. This license places no restrictions on works that are unrelated to
+the Work, nor does this license place any restrictions on aggregating
+such works with the Work by any means.
+
+12. Nothing in this license is intended to, or may be used to, prevent
+complete compliance by all parties with all applicable laws.
+
+
+NO WARRANTY
+===========
+
+There is no warranty for the Work. Except when otherwise stated in
+writing, the Copyright Holder provides the Work `as is', without
+warranty of any kind, either expressed or implied, including, but not
+limited to, the implied warranties of merchantability and fitness for a
+particular purpose. The entire risk as to the quality and performance
+of the Work is with you. Should the Work prove defective, you assume
+the cost of all necessary servicing, repair, or correction.
+
+In no event unless required by applicable law or agreed to in writing
+will The Copyright Holder, or any author named in the components of the
+Work, or any other party who may distribute and/or modify the Work as
+permitted above, be liable to you for damages, including any general,
+special, incidental or consequential damages arising out of any use of
+the Work or out of inability to use the Work (including, but not limited
+to, loss of data, data being rendered inaccurate, or losses sustained by
+anyone as a result of any failure of the Work to operate with any other
+programs), even if the Copyright Holder or said author or said other
+party has been advised of the possibility of such damages.
+
+
+MAINTENANCE OF THE WORK
+=======================
+
+The Work has the status `author-maintained' if the Copyright Holder
+explicitly and prominently states near the primary copyright notice in
+the Work that the Work can only be maintained by the Copyright Holder
+or simply that it is `author-maintained'.
+
+The Work has the status `maintained' if there is a Current Maintainer
+who has indicated in the Work that they are willing to receive error
+reports for the Work (for example, by supplying a valid e-mail
+address). It is not required for the Current Maintainer to acknowledge
+or act upon these error reports.
+
+The Work changes from status `maintained' to `unmaintained' if there
+is no Current Maintainer, or the person stated to be Current
+Maintainer of the work cannot be reached through the indicated means
+of communication for a period of six months, and there are no other
+significant signs of active maintenance.
+
+You can become the Current Maintainer of the Work by agreement with
+any existing Current Maintainer to take over this role.
+
+If the Work is unmaintained, you can become the Current Maintainer of
+the Work through the following steps:
+
+ 1. Make a reasonable attempt to trace the Current Maintainer (and
+ the Copyright Holder, if the two differ) through the means of
+ an Internet or similar search.
+
+ 2. If this search is successful, then enquire whether the Work
+ is still maintained.
+
+ a. If it is being maintained, then ask the Current Maintainer
+ to update their communication data within one month.
+
+ b. If the search is unsuccessful or no action to resume active
+ maintenance is taken by the Current Maintainer, then announce
+ within the pertinent community your intention to take over
+ maintenance. (If the Work is a LaTeX work, this could be
+ done, for example, by posting to comp.text.tex.)
+
+ 3a. If the Current Maintainer is reachable and agrees to pass
+ maintenance of the Work to you, then this takes effect
+ immediately upon announcement.
+
+ b. If the Current Maintainer is not reachable and the Copyright
+ Holder agrees that maintenance of the Work be passed to you,
+ then this takes effect immediately upon announcement.
+
+ 4. If you make an `intention announcement' as described in 2b. above
+ and after three months your intention is challenged neither by
+ the Current Maintainer nor by the Copyright Holder nor by other
+ people, then you may arrange for the Work to be changed so as
+ to name you as the (new) Current Maintainer.
+
+ 5. If the previously unreachable Current Maintainer becomes
+ reachable once more within three months of a change completed
+ under the terms of 3b) or 4), then that Current Maintainer must
+ become or remain the Current Maintainer upon request provided
+ they then update their communication data within one month.
+
+A change in the Current Maintainer does not, of itself, alter the fact
+that the Work is distributed under the LPPL license.
+
+If you become the Current Maintainer of the Work, you should
+immediately provide, within the Work, a prominent and unambiguous
+statement of your status as Current Maintainer. You should also
+announce your new status to the same pertinent community as
+in 2b) above.
+
+
+WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE
+======================================================
+
+This section contains important instructions, examples, and
+recommendations for authors who are considering distributing their
+works under this license. These authors are addressed as `you' in
+this section.
+
+Choosing This License or Another License
+----------------------------------------
+
+If for any part of your work you want or need to use *distribution*
+conditions that differ significantly from those in this license, then
+do not refer to this license anywhere in your work but, instead,
+distribute your work under a different license. You may use the text
+of this license as a model for your own license, but your license
+should not refer to the LPPL or otherwise give the impression that
+your work is distributed under the LPPL.
+
+The document `modguide.tex' in the base LaTeX distribution explains
+the motivation behind the conditions of this license. It explains,
+for example, why distributing LaTeX under the GNU General Public
+License (GPL) was considered inappropriate. Even if your work is
+unrelated to LaTeX, the discussion in `modguide.tex' may still be
+relevant, and authors intending to distribute their works under any
+license are encouraged to read it.
+
+A Recommendation on Modification Without Distribution
+-----------------------------------------------------
+
+It is wise never to modify a component of the Work, even for your own
+personal use, without also meeting the above conditions for
+distributing the modified component. While you might intend that such
+modifications will never be distributed, often this will happen by
+accident -- you may forget that you have modified that component; or
+it may not occur to you when allowing others to access the modified
+version that you are thus distributing it and violating the conditions
+of this license in ways that could have legal implications and, worse,
+cause problems for the community. It is therefore usually in your
+best interest to keep your copy of the Work identical with the public
+one. Many works provide ways to control the behavior of that work
+without altering any of its licensed components.
+
+How to Use This License
+-----------------------
+
+To use this license, place in each of the components of your work both
+an explicit copyright notice including your name and the year the work
+was authored and/or last substantially modified. Include also a
+statement that the distribution and/or modification of that
+component is constrained by the conditions in this license.
+
+Here is an example of such a notice and statement:
+
+ %% pig.dtx
+ %% Copyright 2005 M. Y. Name
+ %
+ % 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.
+ % The latest version of this license is in
+ % 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 M. Y. Name.
+ %
+ % This work consists of the files pig.dtx and pig.ins
+ % and the derived file pig.sty.
+
+Given such a notice and statement in a file, the conditions
+given in this license document would apply, with the `Work' referring
+to the three files `pig.dtx', `pig.ins', and `pig.sty' (the last being
+generated from `pig.dtx' using `pig.ins'), the `Base Interpreter'
+referring to any `LaTeX-Format', and both `Copyright Holder' and
+`Current Maintainer' referring to the person `M. Y. Name'.
+
+If you do not want the Maintenance section of LPPL to apply to your
+Work, change `maintained' above into `author-maintained'.
+However, we recommend that you use `maintained', as the Maintenance
+section was added in order to ensure that your Work remains useful to
+the community even when you can no longer maintain and support it
+yourself.
+
+Derived Works That Are Not Replacements
+---------------------------------------
+
+Several clauses of the LPPL specify means to provide reliability and
+stability for the user community. They therefore concern themselves
+with the case that a Derived Work is intended to be used as a
+(compatible or incompatible) replacement of the original Work. If
+this is not the case (e.g., if a few lines of code are reused for a
+completely different task), then clauses 6b and 6d shall not apply.
+
+
+Important Recommendations
+-------------------------
+
+ Defining What Constitutes the Work
+
+ The LPPL requires that distributions of the Work contain all the
+ files of the Work. It is therefore important that you provide a
+ way for the licensee to determine which files constitute the Work.
+ This could, for example, be achieved by explicitly listing all the
+ files of the Work near the copyright notice of each file or by
+ using a line such as:
+
+ % This work consists of all files listed in manifest.txt.
+
+ in that place. In the absence of an unequivocal list it might be
+ impossible for the licensee to determine what is considered by you
+ to comprise the Work and, in such a case, the licensee would be
+ entitled to make reasonable conjectures as to which files comprise
+ the Work.
+
diff --git a/macros/latex/contrib/versonotes/README b/macros/latex/contrib/versonotes/README
new file mode 100644
index 0000000000..6ff5b86d1e
--- /dev/null
+++ b/macros/latex/contrib/versonotes/README
@@ -0,0 +1,52 @@
+Package versonotes
+==================
+
+Version 0.4, 2019 July 6
+
+This package allows you to place notes on the verso pages of an
+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
+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 [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.
+
+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 (thanks to Axel Berger for
+ this suggestion).
+
+Version 0.2, 2015 February 16
+ Initial public release.
+
+
+
+Norman Gray
+https://nxg.me.uk
+
+[bitbucket]: https://bitbucket.org/nxg/versonotes
+[ctan]: http://www.ctan.org/pkg/versonotes
diff --git a/macros/latex/contrib/versonotes/sample.pdf b/macros/latex/contrib/versonotes/sample.pdf
new file mode 100644
index 0000000000..57d7fbc38f
--- /dev/null
+++ 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
new file mode 100644
index 0000000000..6558462eb3
--- /dev/null
+++ b/macros/latex/contrib/versonotes/sample.tex
@@ -0,0 +1,178 @@
+\documentclass{scrartcl}
+
+\usepackage{url,ifxetex}
+
+\ifxetex
+\usepackage{fontspec}
+\setmainfont[Ligatures=TeX]{Hoefler Text}
+\fi
+
+\def\UrlFont{\ttfamily \small}
+
+\usepackage[mergecollisions]{versonotes}
+
+% Adjust the layout of the notes to make them more compact.
+\let\origversolayout\versolayout
+\renewcommand\versolayout{\origversolayout \footnotesize \baselineskip=10pt }
+% And a macro to wrap the versonote.
+\def\N#1#2{#1\versonote{\emph{#1}: #2}}
+
+\parindent=0pt
+\parskip\bigskipamount
+
+\begin{document}
+\textbf{\Large Paradise Lost}
+
+\emph{John Milton}
+
+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
+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 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}.
+
+\pagebreak
+
+\textbf{\Large Book 1}
+
+\emph{The Argument}
+
+\emph{\emph{This first Book proposes, first in brief, the whole
+ Subject}, Mans
+disobedience, and the loss thereupon of Paradise wherein he was
+plac't: \emph{Then touches} the prime cause of his fall, the Serpent, or
+rather Satan in the Serpent; who revolting from God, and drawing to
+his side many Legions of Angels, was by the command of God driven out
+of Heaven with all his Crew into the great Deep. \emph{Which action past
+over, the Poem hasts into \N{the midst of things}{Milton
+ announces that he intends to follow classical precedents by
+ beginning his epic \emph{in medeas res}, in the middle of things,
+ and only later coming back, by reported action, to the action ``past
+ over'' here. The story of the rebel angels being ``driven out of
+ Heaven\dots into the great Deep,'' for example, comes in book 6.}},
+presenting Satan with his Angels now fallen into Hell, \emph{describ'd here}, not in the Center
+\emph{(for Heaven and Earth may be suppos'd as yet not made, certainly not
+yet accurst)} but in a place of utter darkness, fitliest call'd \emph{Chaos:}
+Here \emph{Satan} with his Angels lying on the burning Lake, thunder-struck
+and astonisht, after a certain space recovers, as from confusion,
+calls up him who next in Order and Dignity lay by him; they confer of
+thir miserable fall. \emph{Satan} awakens all his Legions, who lay till then
+in the same manner confounded; They rise, thir Numbers, array of
+Battel, thir chief Leaders nam'd, according to the Idols known
+afterwards in \emph{Canaan} and the Countries adjoyning. To these \emph{Satan}
+directs his Speech, comforts them with hope yet of regaining Heaven,
+but tells them lastly of a new World and new kind of Creature to be
+created, according to an ancient Prophesie or report in Heaven; \emph{for
+that Angels were long before this visible Creation, was the opinion of
+many ancient Fathers}. To find out the truth of this Prophesie, and
+what to determin thereon he refers to a full Councel. What his
+Associates thence attempt. \N{\emph{Pandemonium}}{Literally, ``all the
+ demons.'' Milton coins the name for the assembly hall of devils
+ whose erection is recounted at the end of book 1.} the Palace of
+Satan rises, suddenly built out of the Deep: The infernal Peers there
+sit in Councel.}
+
+
+Of Mans First Disobedience, and the Fruit\\
+Of that Forbidden Tree, whose mortal tast\\
+Brought \N{Death into the World, and all our woe}{This locution echoes fairly closely Virgil's narrative voice in \emph{Aeneid} book 4, announcing that death and woe followed the ersatz nuptials of Aeneas and Dido:\begin{quotation}
+To the same cave come Dido and the Trojan chief. Primal earth and
+nuptial Juno give the sign; fires flashed in heaven, the witness to
+their bridal, and on the mountain-top screamed the Nymphs. That day
+was the first day of death, that the first cause of
+woe. (Trans. H. Rushton Fairclough in \emph{Virgil} vol. 1 [Cambridge, MA:
+ Harvard University Press, 1935] 407)
+ \end{quotation}
+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\\
+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 \\
+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 \\
+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,\\
+Instruct me, for Thou know'st; Thou from the first\\
+Wast present, and with mighty wings outspread \\
+\N{Dove-like}{The Holy Spirit appears as a dove in John 1: 32. See also Paradise Regain'd 1.30-1.} satst \N{brooding on the vast Abyss}{Milton's ``brooding'' is a better translation of the Hebrew than the familiar ``moved upon the face of the waters'' of the Authorized version of Genesis 1:2.}\\
+And mad'st it \N{pregnant}{Milton invites us to imagine the Holy Spirit copulating with the unformed matter of Chaos (``the vast Abyss''). In Milton's monism, distinctions between spirit and matter are not absolute.}: What in me is dark\\
+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.
+
+\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,\\
+Favour'd of Heav'n so highly, to fall off \\
+From thir Creator, and transgress his Will\\
+For \N{one restraint}{That is, the single injunction against eating from the tree of the knowledge of good and evil (Genesis 2: 17).}, \N{Lords of the World}{According to Genesis 1:28, human beings were created to ``have dominion'' over the rest of creation.} besides?\\
+Who first seduc'd them to that foul revolt?\\
+Th' infernal Serpent; he it was, whose guile\\
+Stird up with Envy and Revenge, deceiv'd \\
+The Mother of Mankind, what time his Pride\\
+Had cast him out from Heav'n, with all his Host\\
+Of Rebel Angels, by whose aid aspiring\\
+To set himself in Glory above his Peers,\\
+He trusted to have equal'd the most High, \\
+If he oppos'd; and with ambitious aim\\
+Against the Throne and Monarchy of God\\
+Rais'd impious War in Heav'n and Battel proud\\
+With vain attempt. Him the Almighty Power\\
+\N{Hurld headlong flaming}{This description recalls Pieter Bruegel's Fall of the Rebel Angels (about 1562). See also William Blake's 1808 watercolor illustration of the rebel angels' fall (told by Raphael at 6.864-66).} from th' Ethereal Skie \\
+With hideous ruine and combustion down\\
+To bottomless perdition, there to dwell\\
+In \N{Adamantine}{Unbreakable, rocklike.} Chains and penal Fire,\\
+Who durst defie th' Omnipotent to Arms.\\
+\N{Nine times the Space}{In Hesiod's Theogony 664-735, the Titans take a similar fall at the hands of Zeus. Interestingly, though Milton alludes to the fall of the Titans here, he likens their nine-day fall, not to the fall of the rebel angels, but to the time they spent lying vanquished on the fiery gulf after their fall. Raphael, in book 6, line 871, however, tells Adam that the rebel angels fell for ``Nine dayes''.} that measures Day and Night \\
+To mortal men, he with his horrid crew\\
+Lay vanquisht, rowling in the fiery Gulfe\\
+Confounded though immortal: But his doom\\
+Reserv'd him to more wrath; for now the thought\\
+Both of lost happiness and lasting pain \\
+Torments him; round he throws his baleful eyes\\
+That witness'd huge affliction and dismay\\
+Mixt with obdurate pride and stedfast hate:\\
+At once as far as Angels \N{kenn}{Range, which in the case of angels must be presumed to be nearly limitless.} he views\\
+The dismal Situation waste and wilde, \\
+A Dungeon horrible, on all sides round\\
+As one great Furnace flam'd, yet from those flames\\
+No light, but rather darkness visible\\
+Serv'd onely to discover sights of woe,\\
+Regions of sorrow, doleful shades, where peace \\
+And rest can never dwell, \N{hope never comes}{A deliberate echo of Dante's Inferno 3.9: ``All hope abandon ye who enter here.''}\\
+That comes to all; but torture without end\\
+Still urges, and a fiery Deluge, fed\\
+With ever-burning Sulphur unconsum'd:\\
+Such place Eternal Justice had prepar'd \\
+For those rebellious, here \N{thir}{Their. Milton's preferred spelling was ``thir,'' and Flannagan reports that ``their'' was changed to ``thir'' in later stages of the 1674 edition. The same is true of line 499 and other lines.} Prison ordain'd\\
+In utter darkness, and thir portion set\\
+As far remov'd from God and light of Heav'n\\
+As \N{from the Center thrice to th' utmost Pole}{Milton asks us to refer to the Ptolemaic model of the universe with the earth at the center of nine concentric spheres. On Milton's cosmology, Ptolemaic or Copernican, see also book 8. 119-68.}.\\
+O how unlike the place from whence they fell! \\
+There the companions of his fall, o'rewhelm'd\\
+With Floods and Whirlwinds of tempestuous fire,\\
+He soon discerns, and weltring by his side\\
+One next himself in power, and next in crime,\\
+Long after known in Palestine, and nam'd \\
+\N{Beelzebub}{``God of the flies'' or ``Chief of the devils.'' See Matthew 10: 25, Mark 3: 22, and Luke 11: 15. See also Christopher Marlowe's Doctor Faustus and Burton's Anatomy of Melancholy 1.2.1-2; see also the Wikipedia entry.}. To whom th' Arch-Enemy,\\
+And thence in Heav'n \N{call'd Satan}{Originally Lucifer, ``bringer of light,'' his name in heaven is changed to Satan, ``enemy.''}, with bold words\\
+Breaking the horrid silence thus began.
+
+\end{document}
diff --git a/macros/latex/contrib/versonotes/versonotes.dtx b/macros/latex/contrib/versonotes/versonotes.dtx
new file mode 100644
index 0000000000..afcdc70719
--- /dev/null
+++ b/macros/latex/contrib/versonotes/versonotes.dtx
@@ -0,0 +1,658 @@
+% \iffalse
+% 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.
+%%
+%% Copyright 2014, 2015, 2019 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
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% 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: 7d4f5fb7b19e, 2019-07-06T19:09:45+01:00
+%%
+%<+package>\NeedsTeXFormat{LaTeX2e}
+%<+package>\ProvidesPackage{versonotes}[2019/07/06 v0.4]
+%
+%<*driver>
+\documentclass{ltxdoc}
+\title{versonotes: Notes on verso pages}
+\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}}
+\newcommand\Lcount[1]{\textsl {\small#1}}
+\newcommand\Lenv[1]{\texttt{\{#1\}}} %environments
+\newcommand\Lpackage[1]{\{\textsf{#1}\}} %packages
+%Make command strings easier to write
+%{\catcode`\<=\active \gdef<#1>{\meta{#1}}}
+{\catcode`\<=\active
+ \gdef<#1>{{\ensuremath\langle\normalfont\textsl{#1}\ensuremath\rangle}}}
+\def\cmd{\begingroup
+ \catcode`\\=12 \catcode`\{=12 \catcode`\}=12
+ \catcode`\<=\active \catcode`\|=12
+ \docmd}
+\def\docmd|#1|{\texttt{#1}\endgroup}
+%%% \url macro (url.sty does this better)
+%\def\setpathdots{\discretionary{.}{}{.}}
+%\def\setpathslash{\discretionary{/}{}{/}}
+%{\catcode`\.=\active
+% \catcode`\/=\active
+% \gdef\pathcats{%
+% \catcode`\%=12 \catcode`\~=12
+% \catcode`\.=\active \let.\setpathdots
+% \catcode`\/=\active \let/\setpathslash
+% \catcode`\#=12 \catcode`\_=12}%
+% }
+%\def\setpath#1{\ttfamily <\nobreak #1\nobreak>\endgroup}
+%\def\url{\begingroup\pathcats\setpath}
+
+\def\bs{$\backslash$}
+
+\begin{document}
+\maketitle
+%\tableofcontents
+%\bigskip
+\DocInput{versonotes.dtx}
+\end{document}
+%</driver>
+%
+% \fi
+%
+% \noindent This package allows you to place notes on the verso pages
+% of an 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 opposite (ie, `verso') page,
+% lined up with the macro call.
+% The notes may contain more than one paragraph.
+%
+% All the pages in the document appear as recto pages
+% (ie, right-hand pages),
+% and are numbered as such;
+% the document should be formatted with that in mind.
+%
+% Since there is no page opposite the first page, any notes which are
+% positioned to appear opposite page 1 are silently discarded.
+%
+% 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
+% line, but if the \Lopt{mergecollisions} option is provided when
+% loading the package, then such notes are instead merged into a
+% single block of text. If a sequence of notes needs to be merged,
+% then they will be added to the merged block one at a time in
+% successive \LaTeX\ runs, since merging one note may make it
+% unnecessary to merge the next. If a large block of such notes need
+% to be merged, it will therefore take several runs before the package
+% 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}}
+%
+% 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 \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
+% |\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}, \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 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
+% an issues list.
+%
+% \end{itemize}
+%
+% \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{}
+
+% \newpage
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% 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}
+%
+% The single user-visible command is |\versonote|.
+% Use |\unexpanded| (from e-\TeX) so that macros in the argument are
+% not expanded into the aux file.
+% \begin{macrocode}
+\long\def\versonote#1{\@bsphack
+ \pdfsavepos
+ \write\@auxout{\string\verso@note{\the\c@page}{\the\pdflastypos sp}\unexpanded{{#1}}}%
+ \@esphack}
+% \end{macrocode}
+%
+% 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
+% in |\versolayout| set the paragraph parameters.
+% \begin{macrocode}
+\newdimen\versotextwidth
+ \versotextwidth=\textwidth
+\newdimen\versoleftmargin
+ \versoleftmargin=\paperwidth
+ \advance\versoleftmargin -\textwidth
+ \advance\versoleftmargin -\hoffset
+ \advance\versoleftmargin -1in
+\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
+% \begin{macrocode}
+\def\end@versonote{%
+ \write\@auxout{\string\verso@note{\the\c@page}{-1pt}{}}}
+\AtEndDocument{\end@versonote}
+% \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
+% \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=\c@page
+\newcount\verso@currentnotenum
+ \verso@currentnotenum=0
+\newdimen\verso@spacerskip
+ \verso@spacerskip=10pt
+% \end{macrocode}
+% Flag |\if@verso@processversonotes| is set true if there are any
+% |\verso@note|s found in the aux file. If there are none -- so that
+% this is still false at the first |\shipout| -- then the package
+% carefully does nothing.
+% \begin{macrocode}
+\newif\if@verso@processversonotes
+ \@verso@processversonotesfalse
+% \end{macrocode}
+%
+% We need to be able to calculate our position on the page.
+% The |\verso@pagebottom| is the position of the bottom of the page,
+% in the same coordinates as |\verso@currentposition|, and is
+% (textheight + top margin + \dots).
+% \begin{macrocode}
+\newdimen\verso@pagebottom
+ \verso@pagebottom=1in
+ \advance\verso@pagebottom \topskip
+ \advance\verso@pagebottom \topmargin
+ \advance\verso@pagebottom \headheight
+ \advance\verso@pagebottom \headsep
+ \advance\verso@pagebottom \textheight
+\newdimen\verso@currentposition
+% \end{macrocode}
+% 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
+% \end{macrocode}
+%
+% 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.
+% \begin{macrocode}
+\long\def\verso@note#1#2#3{%
+ \global\@verso@processversonotestrue
+% \end{macrocode}
+% 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. 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
+% \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
+% sequence of |\\{...}| note specifications. This inserts empty
+% groups for pages which have no verso-notes.
+% \begin{macrocode}
+ \@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
+ \if@tempswa
+ \edef\@tempa{\the\verso@pages {\the\verso@currentpage}}
+ \global\verso@pages=\expandafter{\@tempa}
+ \advance\verso@currentpagenum 1
+ \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}
+%
+% Disable |\verso@note| in time for the end-document aux reading.
+% This isn't quite necessary, but it's tidy.
+% \begin{macrocode}
+\AtEndDocument{\long\def\verso@note#1#2#3{}}
+% \end{macrocode}
+%
+% Test whether we want to merge the current note with the following
+% one. The arguments to this macro are the contents of
+% |\verso@mergenotelist|, which is assembled from the
+% |\verso@mergenote| commands read from the aux file.
+% \begin{macrocode}
+\def\verso@testmergenote#1,#2\@nil{
+ \def\@tempa{#1}
+ \ifx\@tempa\@empty
+ \@tempcnta=-1
+ \else
+ \@tempcnta=#1
+ \fi
+ \advance\@tempcnta -1
+ \ifnum\@tempcnta=\verso@currentnotenum
+% \end{macrocode}
+% Set |\if@tempswa| true, set |\verso@mergenotelist| to the tail of
+% the list, and ensure that this note is merged next time round.
+% \begin{macrocode}
+ \@tempswatrue
+ \xdef\verso@mergenotelist{#2}
+ \immediate\write\@auxout{\string\verso@mergenote{#1}}
+ \else
+ \@tempswafalse
+ \fi
+}
+% \end{macrocode}
+%
+% The macro |\verso@setnote| is the one which does the work of
+% positioning a single note on the (verso) page. We potentially work
+% quite hard to avoid notes overwriting each other here. If
+% |\verso@mergestate| is greater than one (by default, it's
+% initialised to~2, but any number greater than~1 would be equivalent)
+% then when two notes collide, we simply put a horizontal bar between
+% them, and hope for the best. Each time we have a collision we
+% increment this number, and if we find it has a value~1 (ie, the
+% first collision) we we record in the aux file that this note should
+% be merged with its predecessor, by writing a |\verso@mergenote|
+% command. Next time round, when we are about to set the note
+% \emph{before} that one, we avoid setting it, and instead start
+% accumulating the text of such merged notes, in the token register
+% |\verso@accumulatenote|. We only add a single note to the list of
+% merged notes on each \LaTeX\ run, since merging one note may make it
+% unnecessary to merge any more. The only way to delete the
+% collections of merged notes is to delete the aux file.
+% \begin{macrocode}
+\newcount\verso@mergestate
+ \verso@resetmergestate
+\newtoks\verso@accumulatenote
+ \verso@accumulatenote={}
+% \end{macrocode}
+%
+% Set the note. The arguments are (1) the page number, (2) the
+% position on the page, and (3) the text of the note.
+% \begin{macrocode}
+\long\def\verso@setnote#1#2#3{
+ \@tempdima=\paperheight \advance\@tempdima -#2
+ % target position; will become skip to add
+ \@tempdimb=\verso@currentposition
+ \global\advance\verso@currentnotenum 1
+% \end{macrocode}
+% Check whether we're to merge the following note into this one.
+% \begin{macrocode}
+ \expandafter\verso@testmergenote\verso@mergenotelist,\@nil
+ \if@tempswa
+ \verso@accumulatenote=\expandafter{%
+ \the\verso@accumulatenote
+ #3%
+ \quad\P~\nobreak}
+ %\PackageInfo{versonotes}{\typeout{Merging notes on p#1}}
+ \else
+% \end{macrocode}
+% No merging: set the current note, possibly along with any
+% accumulated notes, in a box, and then start to work out where to put it.
+% \begin{macrocode}
+ \setbox0=\vtop{
+ \versolayout
+ \the\verso@accumulatenote
+ #3\par}
+ \verso@accumulatenote={}
+% \end{macrocode}
+% We now know how big this box is (|\ht0|), how far down the page the
+% accumulated boxes are (|\verso@currentposition|), and where the box
+% is to appear, as an offset from the top of the paper (|\@tempdima|).
+% Work how how much of a skip we have to add to get there.
+% \begin{macrocode}
+ \ifdim\@tempdima>\verso@currentposition
+% \end{macrocode}
+% The target position is below the current position; add a skip. This
+% is the straightforward case, and leaves the skip in |\@tempdima| and
+% the new current position in |\@tempdimb|.
+% \begin{macrocode}
+ \advance\@tempdima -\verso@currentposition
+ \advance\@tempdima -\ht0
+ \advance\@tempdimb \@tempdima
+ \verso@resetmergestate
+ \else
+% \end{macrocode}
+% Or the target position is above the current position;
+% thus the new material will have to be moved down
+% (I'm not sure how best to handle the case where this skip results
+% in the note hitting the bottom of the page. Should it be merged
+% with that case below, somehow?).
+% \begin{macrocode}
+ % note: \PackageWarning seems to produce odd effects here
+ \message{^^Jversonotes warning: Moved versonote text on p.#1.}
+ \advance\verso@mergestate 1
+ \ifnum\verso@mergestate=1
+ \immediate\write\@auxout{\string\verso@mergenote{\the\verso@currentnotenum}}
+ \fi
+ \nointerlineskip
+ \vbox to \verso@spacerskip{\vfil
+ \hbox to \hsize{\hfil\vrule height 0.4pt width 10em}
+ \vfil}
+ \advance\@tempdimb \verso@spacerskip
+ \@tempdima=0pt % ...so don't add any more skip
+ \fi
+ \advance\@tempdimb \ht0
+ \advance\@tempdimb \dp0
+% \end{macrocode}
+% Parameter |\@tempdimb| now holds the expected new value of
+% |\verso@currentposition|. Check to see if this would be beyond the bottom
+% of the page, and move the text upwards in that case.
+% \begin{macrocode}
+ \ifdim\@tempdimb>\verso@pagebottom
+ \message{^^Jversonotes warning: versonote text on p.#1 hit bottom of page.}
+ \advance\@tempdima -\@tempdimb
+ \advance\@tempdima \verso@pagebottom
+ \@tempdimb=\verso@pagebottom
+ \fi
+% \end{macrocode}
+% Finally, do the skip and add the box.
+% \begin{macrocode}
+ \vskip\@tempdima
+ \verso@currentposition=\@tempdimb
+ \nointerlineskip
+ \box0
+ \fi
+}
+% \end{macrocode}
+%
+% Log notes where a previous run has discovered they collide.
+% \begin{macrocode}
+\def\verso@mergenotelist{}
+\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.
+% \begin{macrocode}
+\let\verso@orig@shipout\shipout
+% \end{macrocode}
+%
+%
+% 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|.
+%
+% 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 |{{}}|.
+%
+% 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}
+% \end{macrocode}
+% 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\verso@pagestoskip=0
+% \end{macrocode}
+% If there are no verso-notes on this page, then ship out an empty box.
+% \begin{macrocode}
+ \ifx\@tempa\@empty
+ \verso@orig@shipout\vbox{}
+% \end{macrocode}
+% This is the normal case:
+% create a box containing the |\\{...}| contents of the
+% current page's verso-notes
+% \begin{macrocode}
+ \else
+ \begingroup
+% \end{macrocode}
+% Within the box we're about to create, we have to `un-protect' things.
+% Robust commands (including for example |\emph| and other font-changing commands) are
+% defined using |\protect|, which in the present context, inside
+% |\@outputpage|, is |\let| equal to |\noexpand|.
+% We must set this to be simply |\relax|,
+% as it is in the normal run of text elsewhere
+% (see \url{http://tex.stackexchange.com/questions/206673/}).
+% \begin{macrocode}
+ \let\protect\relax
+% \end{macrocode}
+% Set everything up for setting the verso page.
+% \begin{macrocode}
+ \hoffset=-1in \advance\hoffset \versoleftmargin
+ \voffset=-1in
+ \hsize=\versotextwidth
+ \topskip=0pt
+ \topmargin=0pt
+ \headheight=0pt
+ \headsep=0pt
+ \vsize=1000mm % larger than any actual note
+ \normalfont\normalsize
+% \end{macrocode}
+% Construct and ship out the page contents.
+% \begin{macrocode}
+ \long\def\\##1{\verso@setnote ##1}
+ \verso@orig@shipout\vbox{
+ \verso@currentposition=0pt
+ #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.
+% \begin{macrocode}
+ \global\verso@pages={#2}}
+% \end{macrocode}
+%
+% The command |\verso@processonepage| is invoked once on every |\shipout|.
+% \begin{macrocode}
+\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.
+% \begin{macrocode}
+ \global\let\verso@processonepage\relax
+ \fi
+}
+% \end{macrocode}
+%
+% And finally, redefine |\shipout|.
+% \begin{macrocode}
+\def\shipout{\verso@processonepage \verso@orig@shipout}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+% \Finale
+%
+\endinput
diff --git a/macros/latex/contrib/versonotes/versonotes.ins b/macros/latex/contrib/versonotes/versonotes.ins
new file mode 100644
index 0000000000..40361568b2
--- /dev/null
+++ b/macros/latex/contrib/versonotes/versonotes.ins
@@ -0,0 +1,12 @@
+\input docstrip
+\preamble
+ versonotes: Notes on verso pages
+\endpreamble
+\keepsilent
+\askforoverwritefalse
+
+\generate{\file{versonotes.drv}{\from{versonotes.dtx}{driver}}
+ \file{versonotes.sty}{\from{versonotes.dtx}{package}}
+ }
+
+\endbatchfile
diff --git a/macros/latex/contrib/versonotes/versonotes.pdf b/macros/latex/contrib/versonotes/versonotes.pdf
new file mode 100644
index 0000000000..f5014748b1
--- /dev/null
+++ b/macros/latex/contrib/versonotes/versonotes.pdf
Binary files differ