texlive[76151] Master/texmf-dist: leporello (26aug25)

commits+karl at tug.org commits+karl at tug.org
Tue Aug 26 22:02:50 CEST 2025


Revision: 76151
          https://tug.org/svn/texlive?view=revision&revision=76151
Author:   karl
Date:     2025-08-26 22:02:49 +0200 (Tue, 26 Aug 2025)
Log Message:
-----------
leporello (26aug25)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/leporello/README.md
    trunk/Master/texmf-dist/doc/latex/leporello/doc/layout.tex
    trunk/Master/texmf-dist/doc/latex/leporello/leporello-doc.pdf
    trunk/Master/texmf-dist/doc/latex/leporello/leporello-doc.tex
    trunk/Master/texmf-dist/tex/latex/leporello/leporello.cls

Modified: trunk/Master/texmf-dist/doc/latex/leporello/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/leporello/README.md	2025-08-26 20:02:39 UTC (rev 76150)
+++ trunk/Master/texmf-dist/doc/latex/leporello/README.md	2025-08-26 20:02:49 UTC (rev 76151)
@@ -1,4 +1,4 @@
-![Version 0.9.5](https://img.shields.io/badge/version-0.9.5-blue)
+![Version 1.0.0](https://img.shields.io/badge/version-1.0.0-blue)
 
 ![leporello](https://github.com/user-attachments/assets/51cf990a-7894-4e56-a4de-87e3be7ad592)
 

Modified: trunk/Master/texmf-dist/doc/latex/leporello/doc/layout.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/leporello/doc/layout.tex	2025-08-26 20:02:39 UTC (rev 76150)
+++ trunk/Master/texmf-dist/doc/latex/leporello/doc/layout.tex	2025-08-26 20:02:49 UTC (rev 76151)
@@ -16,9 +16,11 @@
   show ids
 ]{leporello}
 
-\leporellosetstyle{align bottom}{
-  align parent={l,b},
-  align self={l,b}
+\leporellosetstyle{box/align bottom}{
+  box={
+    align parent={l,b},
+    align self={l,b}
+  }
 }
 
 \begin{leporellocolumn}{example-a}

Modified: trunk/Master/texmf-dist/doc/latex/leporello/leporello-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/leporello/leporello-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/leporello/leporello-doc.tex	2025-08-26 20:02:39 UTC (rev 76150)
+++ trunk/Master/texmf-dist/doc/latex/leporello/leporello-doc.tex	2025-08-26 20:02:49 UTC (rev 76151)
@@ -11,8 +11,8 @@
 % This work has the LPPL maintenance status `maintained'.
 %
 \documentclass[a4paper]{article}
-\def\leporellofileversion{0.9.5}
-\def\leporellofiledate{25 August 2025}
+\def\leporellofileversion{1.0.0}
+\def\leporellofiledate{27 August 2025}
 
 \usepackage[T1]{fontenc}
 \usepackage{Alegreya}
@@ -268,6 +268,7 @@
 \changes{v0.9.2}{2025/08/18}{Various improvements and bug fixes.}
 \changes{v0.9.3}{2025/08/22}{Stretch mechanism fixed.}
 \changes{v0.9.5}{2025/08/25}{Improved alignment mechanism.}
+\changes{v1.0.0}{2025/08/27}{Improved key management and flow mechanism. Added note mechanism.}
 
 \begin{document}
 \vspace*{-2.5em}
@@ -297,21 +298,23 @@
 
 \section{Loading the document class}
 
-Use \macro{\documentclass{leporello}} to load the document class. The document class loads the \macro{geometry}, the \macro{graphicx} and the \macro{l3draw} package.
+Use \macro{\documentclass{leporello}} to load the document class. The document class loads the \macro{graphicx} and the \macro{l3draw} package.
 
+The document class is based on the \macro{article} class to enable basic typesetting commands. But due to the redefinition of the layout, certain functions of the \macro{article} class, such as placing material into the header, the footer or the margin (which do not exist in the leporello layout) or using floats or footnotes won't work. Instead of floats, the document class provides a sophisticated alignment mechanism for boxes. Instead of footnotes, it provides its own note mechanism.
+
 \begin{macrodef}
-|\leporelloset|{<options>}
+|\leporelloset|[<prefix>]{<options>}
 \end{macrodef}
-Use \macro{\leporelloset} or use the optional argument of the \macro{\documentclass} command to globally set the document layout. The following options are available:
+Use \macro{\leporelloset} or use the optional argument of the \macro{\documentclass} command to globally set the document layout. The optional argument can be used to set a common prefix to all options. Options should be used without the \macro{global/} prefix when used as option to the \macro{\documentclass} command. The following options are available:
 
 \begin{macrodef}
-|columns|={<list of dimensions>}
-|two columns|
-|three columns|
-|four columns|
-|four columns wrap|
-|five columns|
-|six columns|
+global/|columns|={<list of dimensions>}
+global/|two columns|
+global/|three columns|
+global/|four columns|
+global/|four columns wrap|
+global/|five columns|
+global/|six columns|
 \end{macrodef}
 Expects a comma-separated list of dimensions that describe the widths of the columns in the layout. If \macro{columns} is not specified, the class assumes the default value of \macro{97mm, 100mm, 100mm}. The width of the document layout is automatically calculated from the dimensions set via \macro{columns}.
 
@@ -336,37 +339,37 @@
 \end{longtable}
 
 \begin{macrodef}
-|layout height|={<dimension>}
+global/|layout height|={<dimension>}
 \end{macrodef}
 Expects a dimension that sets the height of the final layout. If \macro{layout height} is not specified, the class assumes the default value of \macro{210mm} (the height of A4 landscape).
 
 \begin{macrodef}
-|auto typeset|
+global/|auto typeset|
 \end{macrodef}
 If set, the columns are automatically typeset according to the order of the definition of the columns. This means that in a three-column layout for example, the first three defined columns will be placed on the first PDF page followed by the next three defined columns on the next PDF page. This key does not expect a value.
 
 \begin{macrodef}
-|show frames|
+global/|show frames|
 \end{macrodef}
 If set, frames around the single pages (columns) are shown. This key does not expect a value.
 
 \begin{macrodef}
-|show ids|
+global/|show ids|
 \end{macrodef}
 If set, the IDs of the boxes are shown. This key does not expect a value. The IDs of the boxes are integers starting from 1 and increasing in the order of typesetting of the boxes.
 
 \begin{macrodef}
-|prepress|
+global/|prepress|
 \end{macrodef}
 If set, the paper size is increased at all four edges by the width of the info area and crop marks are placed at the corners. This key does not expect a value.
 
 \begin{macrodef}
-|info area|={<dimension>}
+global/|info area|={<dimension>}
 \end{macrodef}
 Expects a dimension for the width of the info area that is shown if \macro{prepress} is set. If \macro{info area} is not specified, the class assumes the default value of \macro{10mm}.
 
 \begin{macrodef}
-|bleed|={<dimension>}
+global/|bleed|={<dimension>}
 \end{macrodef}
 Expects a dimension for the width of the bleed that is added to boxes with background and other material reaching to the edges of the document layout. If \macro{bleed} is not specified, the class assumes the default value of \macro{3mm}.
 
@@ -398,20 +401,20 @@
   <body>
 \end{|leporellobox|}
 \end{macrodef}
-Boxes can be positioned inside of columns. They can contain anything that can be placed in a TeX box in general. A box is defined by the \macro{leporellobox} environment which takes one optional argument to set box-specific options. These are the following:
+Boxes can be positioned inside of columns. They can contain anything that can be placed in a TeX box in general. A box is defined by the \macro{leporellobox} environment which takes one optional argument to set box-specific options. Options should be used without the \macro{box/} prefix when used as option to the \macro{leporellobox} environment. These are the following:
 
 \begin{macrodef}
-|name|={<string>}
+box/|name|={<string>}
 \end{macrodef}
 Expects a (unique) string denoting the name of the box which can be used for attaching boxes to each other or assigning boxes for the flow mechanism.
 
 \begin{macrodef}
-|parent|={<string>}
+box/|parent|={<string>}
 \end{macrodef}
 Expects a string denoting the name of the box to which the current box is aligned. If not specified, the current column box is assumed as parent box. The parent box needs to be in the same column as the box that should be aligned to it.
 
 \begin{macrodef}
-|align parent|={<tuple of poles>}
+box/|align parent|={<tuple of poles>}
 \end{macrodef}
 Expects a comma-separated list of two items (a tuple) which denotes the horizontal and vertical pole of which the intersection defines the coordinate of the parent box (per default this is the current column box) that serves as anchor to align the current box. If not specified, the default value \macro{l, t} is assumed, denoting the top left corner. Available poles are:
 
@@ -434,37 +437,37 @@
 \end{longtable}
 
 \begin{macrodef}
-|align self|={<tuple of poles>}
+box/|align self|={<tuple of poles>}
 \end{macrodef}
 Expects a comma-separated list of two items (a tuple) which denotes the horizontal and vertical pole of which the intersection defines the coordinate of the current box that serves as anchor to align the current box to parent box (per default this is the current column box). If not specified, the default value \macro{l, t} is assumed, denoting the top left corner. Available poles are the same as for \macro{align parent}.
 
 \begin{macrodef}
-|offset|={<tuple of dimensions>}
+box/|offset|={<tuple of dimensions>}
 \end{macrodef}
 Expects a comma-separated list of two dimensions (a tuple) which defines the offset of the anchor set via \macro{align parent} and \macro{align self}. The first dimension is the offset to the right, the second dimension the offset downwards. If not specified, the default value \macro{0mm, 0mm} is assumed. Internally, the value is parsed as a floating point variable.
 
 \begin{macrodef}
-|width|={<dimension>}
+box/|width|={<dimension>}
 \end{macrodef}
 Expects a dimension to explicitly set the width of the current box. If not specified, the box is as wide as the parent column.
 
 \begin{macrodef}
-|height|={<dimension>}
+box/|height|={<dimension>}
 \end{macrodef}
 Expects a dimension to explicitly set the height of the current box. If not specified, the box takes its natural height which means that it is as high as necessary to fit the contents.
 
 \begin{macrodef}
-|stretch|
+box/|stretch|
 \end{macrodef}
 If set, the box is stretched until its relevant edge (the bottom edge if aligned at the top, the top edge if aligned at the bottom, in vertical typesetting the left or right edge) meets the edge of the parent column. This key does not expect a value.
 
 \begin{macrodef}
-|padding left|={<dimension>}
-|padding right|={<dimension>}
-|padding top|={<dimension>}
-|padding bottom|={<dimension>}
-|padding|={<key-value list>}
-|no padding|
+box/|padding left|={<dimension>}
+box/|padding right|={<dimension>}
+box/|padding top|={<dimension>}
+box/|padding bottom|={<dimension>}
+box/|padding|={<key-value list>}
+box/|no padding|
 \end{macrodef}
 \macro{padding left}, \macro{padding right}, \macro{padding top} and \macro{padding bottom} each expect a dimension to describe the padding of the contents from the relevant edge of the box. If not specified, the default value of \macro{7.5mm} is assumed.
 
@@ -473,38 +476,38 @@
 The key \macro{no padding} sets all paddings to zero. This key does not expect a value.
 
 \begin{macrodef}
-|pre|={<code>}
+box/|pre|={<code>}
 \end{macrodef}
-Expects a token list that is placed before the actual contents of the box. Should not contain typeset material. This key should be used if boxes are manually split using the \macro{\leporelloboxbreak} command.
+Expects a token list that is placed before the actual contents of the box. Should not contain typeset material. This can be handy, if multiple boxes should be styled in a similar way.
 
 \begin{macrodef}
-|background color|={<color name>}
-|background color|={none}
+box/|background color|={<color name>}
+box/|background color|={none}
 \end{macrodef}
 Expects a color name as defined via \macro{l3color} or \macro{none} which will not fill the background. If not specified, the default value of \macro{none} is assumed.
 
 \begin{macrodef}
-|background code|={<code>}
+box/|background code|={<code>}
 \end{macrodef}
 Expects typeset material that will be placed into the background of the box aligned at the upper left corner of the box. THe typeset material is clipped to the size of the box.
 
 \begin{macrodef}
-|bleed|={<list of values>}
+box/|bleed|={<list of values>}
 \end{macrodef}
 Expects a comma-separated list consisting of up to four items with the values \macro{l} and \macro{r}, \macro{t} and \macro{b} that describe the edges (left, right, top and bottom) where bleed should be added to the box. Note that bleed is never added to the inner edges where the columns meet.
 
 \begin{macrodef}
-|store width|={<control sequence>}
+box/|store width|={<control sequence>}
 \end{macrodef}
 Expects a single control sequence (macro) to store the width of the current box.
 
 \begin{macrodef}
-|store height|={<control sequence>}
+box/|store height|={<control sequence>}
 \end{macrodef}
 Expects a single control sequence (macro) to store the height of the current box.
 
 \begin{macrodef}
-|flow into|={<string>}
+box/|flow into|={<string>}
 \end{macrodef}
 Expects a string denoting the name of the box into which typeset material will flow into if it does not fit into the current box. The box to flow into can be in a following column or on a following page. See section \ref{sec:flow} below.
 
@@ -515,25 +518,25 @@
 \end{macrodef}
 Using the command \macro{\leporellotypesetcolumns} which takes one mandatory argument, previously defined columns can be placed onto a page of the document. The command expects as argument a comma-separated list of names of previously defined columns. These are then placed onto a document page from left to right while the width is taken from the setting via the \macro{columns} key and the height is taken from the setting via the \macro{layout height} key. With a \macro{.}, an empty column can be added to the list.
 
-The command takes one optional argument that accepts the following keys:
+The command takes one optional argument. Options should be used without the \macro{typeset/} prefix when used as option to the \macro{\leporellotypesetcolumns} command. The command accepts the following options:
 
 \begin{macrodef}
-|reverse layout|
+typeset/|reverse layout|
 \end{macrodef}
 If set, the widths of the columns are reversed, but the placement of the columns is still from left to right. This option does not take a value. The option should be used to typeset the verso of a folded leaflet that naturally has the widths of the columns reversed. This key does not expect a value.
 
 \begin{macrodef}
-|reverse order|
+typeset/|reverse order|
 \end{macrodef}
 If set, the order of the columns is reversed, which means that the columns are typeset from right to left. Pagination is not affected. This key does not expect a value.
 
 \begin{macrodef}
-|reverse pagination|
+typeset/|reverse pagination|
 \end{macrodef}
 If set, the pagination of the columns is reversed. This key does not expect a value.
 
 \begin{macrodef}
-|continuous pagination|
+typeset/|continuous pagination|
 \end{macrodef}
 If set, columns are numbered continuously from left to right. Otherwise, the pagination starts on the last column of every odd shipout page, continues from left to right over the columns on the following shipout page and eventually from left ro right over the remaining columns on the first page. For example, in a document with three columns per shipout page the pagination would be 5, 6, 1 and 2, 3, 4 and then on the next two shipout pages 11, 12, 7 and 8, 9, 10. This key does not expect a value.
 
@@ -544,7 +547,7 @@
 \begin{macrodef}
 |\leporelloboxbreak|
 \end{macrodef}
-The flow mechanism works across multiple boxes. But due to the way the typesetting mechanism of TeX works, it needs some manual adjustment if the typeset material flows across boxes of different width. In this case, the command \macro{\leporelloboxbreak} should be inserted at the point where the break should take place.
+The flow mechanism works across multiple boxes. But due to the way the typesetting mechanism of TeX works, it needs some manual adjustment if the typeset material flows across boxes of different width. In this case, the command \macro{\leporelloboxbreak} or \macro{\pagebreak} should be inserted at the point where the break should take place. The command \macro{\leporelloboxbreak} is especially suited for justified typesetting as it will keep the last line before the break justified in contrast to the \macro{\pagebreak} command.
 
 Typeset material can only flow into boxes in the following column or page. If typeset material should flow backwards on the same page, this can be achieved using the key \macro{reverse order} on the relevant page.
 
@@ -574,37 +577,37 @@
 \begin{macrodef}
 |\leporelloimage|[<options>]{<file name>}
 \end{macrodef}
-With the command \macro{\leporelloimage} images that cover full boxes can be inserted. This command can be placed in a \macro{leporellobox} with zero padding and it should only be used inside a \macro{leporellobox} environment. The command has one mandatory argument that takes a relative path and file name to select the image to be inserted. It also has one optional argument to take the following options:
+With the command \macro{\leporelloimage} images that cover full boxes can be inserted. This command can be placed in a \macro{leporellobox} with zero padding and it should only be used inside a \macro{leporellobox} environment. The command has one mandatory argument that takes a relative path and file name to select the image to be inserted. It also has one optional argument to take options which should be used without the \macro{image/} prefix when used as option to the \macro{\leporelloimage} command. The following options are available:
 
 \begin{macrodef}
-|clip width|={<dimension>}
-|clip height|={<dimension>}
+image/|clip width|={<dimension>}
+image/|clip height|={<dimension>}
 \end{macrodef}
 Expect a dimension depicting the width and the height of the boxed image.
 
 \begin{macrodef}
-|scale|={<floating point number>}
+image/|scale|={<floating point number>}
 \end{macrodef}
 Expects a floating point number depicting the scaling factor of the image. This factor will not affect the size of the box.
 
 \begin{macrodef}
-|width|={<dimension>}
-|height|={<dimension>}
+image/|width|={<dimension>}
+image/|height|={<dimension>}
 \end{macrodef}
 Expect a dimension to explicitly set the width and the height of the image. Setting \macro{width} will override a \macro{scale} value. Setting \macro{height} will override a \macro{width} or \macro{scale} value. The aspect ratio of the original image will always be kept.
 
 \begin{macrodef}
-|offset|={<tuple of dimensions>}
+image/|offset|={<tuple of dimensions>}
 \end{macrodef}
 Expects a comma-separated list consisting of two values (tuple) that describe the offset of the image that will be positioned per default so that the upper left corner sits at the upper left corner of the box. A positive offset will shift the image in upper left direction. Internally, the value is parsed as a floating point variable.
 
 \begin{macrodef}
-|ignore padding|={<list of values>}
+image/|ignore padding|={<list of values>}
 \end{macrodef}
 Expects a comma-separated list consisting of up to four items with the values \macro{l} and \macro{r}, \macro{t} and \macro{b} that describe the edges (left, right, top and bottom) where the image should ignore the padding of the current box.
 
 \begin{macrodef}
-|fill bleed|
+image/|fill bleed|
 \end{macrodef}
 If set, the image will spread into the bleed. This will result in a shift of the image by the size of the bleed which may need to be accounted for using \macro{offset}. This key does not expect a value.
 
@@ -625,17 +628,55 @@
 \subsection{Defining styles}
 
 \begin{macrodef}
-|\leporellosetstyle|{<string>}{<key-value list>}
+|\leporellosetstyle|[<prefix>]{<string>}{<key-value list>}
 \end{macrodef}
-In order to simplify the setting of recurring options to the \macro{leporellobox} environment, it is possible to group several of these options as style via the \macro{\leporellosetstyle} command which takes as first argument the name of the newly defined style and as second argument the releevant options (key-value pairs). The style can then be used like an option to any \macro{leporellobox} environment.
+In order to simplify the setting of recurring options to the \macro{leporellobox} environment, it is possible to group several of these options as style via the \macro{\leporellosetstyle} command which takes as first argument the name of the newly defined style and as second argument the releevant options (key-value pairs). The style can then be used like an option to any \macro{leporellobox} environment. The optional argument can be used to set a common prefix for the style definition. The following two expressions are equivalent:
 
-\subsection{Restoring justified typesetting}
+\begin{codeexample}
+\leporellosetstyle[box]{align bottom}{
+  align parent={l,b},
+  align self={l,b}
+}
 
+\leporellosetstyle{box/align bottom}{
+  box/align parent={l,b},
+  box/align self={l,b}
+}
+\end{codeexample}
+
+\subsection{Notes}
+
+Due to the layout specifications, this document class does not support footnotes. Instead, it provides its own note mechanism that allows to insert marks for notes and printing the notes combined as list.
+
 \begin{macrodef}
-|\leporellojustified|
+|\leporellonote|[<integer>]{<code>}
 \end{macrodef}
-In order to restore the default justified typesetting style of TeX after having set \macro{\raggedright}, \macro{\raggedleft} or \macro{\centering}, the packages defines the command \macro{\leporellojustified}.
+The command \macro{\leporellonote} increases the internal note counter and inserts a mark. It stores the actual note provided in the argument in an internal sequence. Using the optional argument, the counter for the mark can be set explicitly.
 
+\begin{macrodef}
+|\leporelloprintnotes|
+\end{macrodef}
+The command \macro{\leporelloprintnotes} prints all notes as list. Per default, this is an \macro{enumerate} environment. It also empties the internal sequence to store notes.
+
+Using the command \macro{\leporelloset}, note marks and note lists can be styled. The following options are available:
+
+\begin{macrodef}
+notes/|mark cmd|={<control sequence>}
+\end{macrodef}
+Expects a control sequence that takes exactly one argument being the value of the counter of the note. The counter has the L3 integer type. To print the marks as Roman numerals in square brackets separated by a space, for example, the following settings could be used:
+
+\begin{codeexample}
+\NewDocumentCommand{\squaredroman}{m}{\,[\romannumeral #1]}
+\leporellonotesset{
+  mark cmd = {\squaredroman}
+}
+\end{codeexample}
+
+\begin{macrodef}
+notes/|list style|={<string>}
+\end{macrodef}
+Expects a name of the list environment such as \macro{enumerate} or \macro{itemize}. Using the \macro{enumitem} package, for example, a custom list can be created and styled individually.
+
 \subsection{Hooks}
 
 The package offers three pairs of hooks that are positioned at the start and end of columns and boxes allowing for inserting code.
@@ -678,7 +719,7 @@
   show ids
 ]{leporello}
 
-\leporellosetstyle{align bottom}{
+\leporellosetstyle[box]{align bottom}{
   align parent={l,b},
   align self={l,b}
 }

Modified: trunk/Master/texmf-dist/tex/latex/leporello/leporello.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/leporello/leporello.cls	2025-08-26 20:02:39 UTC (rev 76150)
+++ trunk/Master/texmf-dist/tex/latex/leporello/leporello.cls	2025-08-26 20:02:49 UTC (rev 76151)
@@ -11,7 +11,7 @@
 % This work has the LPPL maintenance status `maintained'.
 %
 \ProvidesExplClass{leporello}
-  {2025/08/25} {0.9.5} {Document class for typesetting folded leaflets}
+  {2025/08/27} {1.0.0} {Document class for typesetting folded leaflets}
 
 \cs_generate_variant:Nn \clist_item:Nn { NV }
 \cs_generate_variant:Nn \coffin_attach:NnnNnnnn { cencennn , ceeceeee }
@@ -62,6 +62,21 @@
 \clist_new:N \l__leporello_auto_typeset_temp_clist
 \int_new:N \l__leporello_auto_typeset_int
 
+\keys_define:nn { leporello } {
+  global            .code:n       = {
+    \keys_set:nn { leporello / global } {#1}
+  } ,
+  box               .code:n       = {
+    \keys_set:nn { leporello / box } {#1}
+  } ,
+  typeset           .code:n       = {
+    \keys_set:nn { leporello / typeset } {#1}
+  } ,
+  image             .code:n       = {
+    \keys_set:nn { leporello / image } {#1}
+  }
+}
+
 \keys_define:nn { leporello / global } {
   columns           .code:n       = {
     \clist_set:Nn \l_leporello_columns_clist {#1}
@@ -139,6 +154,66 @@
   Parent ~ box ~ #1 ~ undefined.
 }
 
+\msg_new:nnn { leporello } { command-not-supported } {
+  \msg_error_text:n { leporello } \iow_newline:
+  Command ~ #1 ~ not ~ supported. 
+  \tl_if_empty:nF {#2} {
+    \iow_newline: #2
+  }
+}
+
+\msg_new:nnn { leporello } { environment-not-supported } {
+  \msg_error_text:n { leporello } \iow_newline:
+  Environment ~ #1 ~ not ~ supported.
+  \tl_if_empty:nF {#2} {
+    \iow_newline: #2
+  }
+}
+
+\hook_gput_code:nnn { cmd / footnote / before } { . } {
+  \msg_error:nnee { leporello } { command-not-supported } {
+    \token_to_str:N \footnote
+  } {
+    Consider ~ using ~ \token_to_str:N \leporellonote \c_space_tl instead.
+  }
+}
+
+\hook_gput_code:nnn { cmd / footnote / before } { . } {
+  \msg_error:nne { leporello } { command-not-supported } {
+    \token_to_str:N \footnotemark
+  }
+}
+
+\hook_gput_code:nnn { cmd / footnote / before } { . } {
+  \msg_error:nne { leporello } { command-not-supported } {
+    \token_to_str:N \footnotetext
+  }
+}
+
+\hook_gput_code:nnn { cmd / marginpar / before } { . } {
+  \msg_error:nnee { leporello } { command-not-supported } {
+    \token_to_str:N \marginpar
+  } {
+    Consider ~ using ~ \token_to_str:N \leporellonote ~ instead.
+  }
+}
+
+\hook_gput_code:nnn { env / figure / before } { . } {
+  \msg_error:nnnn { leporello } { environment-not-supported } {
+    figure
+  } {
+    Document ~ class ~ does ~ not ~ support ~ floats.
+  }
+}
+
+\hook_gput_code:nnn { env / table / before } { . } {
+  \msg_error:nnnn { leporello } { environment-not-supported } {
+    table
+  } {
+    Document ~ class ~ does ~ not ~ support ~ floats.
+  }
+}
+
 \int_new:N \l_leporello_current_page_int
 \int_new:N \l_leporello_current_column_int
 \str_new:N \l_leporello_current_column_str
@@ -229,7 +304,9 @@
   padding / right    .dim_set:N   = \l__leporello_box_padding_right_dim ,
   padding / top      .dim_set:N   = \l__leporello_box_padding_top_dim ,
   padding / bottom   .dim_set:N   = \l__leporello_box_padding_bottom_dim ,
-  padding            .code:n      = { \keys_set:nn { leporello / box / padding } {#1} } ,
+  padding            .code:n      = {
+    \keys_set:nn { leporello / box / padding } {#1}
+  } ,
   padding            .initial:n   = {
     left   = 7.5mm ,
     right  = 7.5mm ,
@@ -257,7 +334,7 @@
 \bool_new:N \l_leporello_reverse_order_bool
 \bool_new:N \l_leporello_reverse_pagination_bool
 
-\keys_define:nn { leporello / print } {
+\keys_define:nn { leporello / typeset } {
   reverse ~ layout   .code:n      = {
     \bool_set_inverse:N \l_leporello_reverse_layout_bool
   } ,
@@ -406,12 +483,34 @@
 
 \ProcessKeyOptions [ leporello / global ]
 \LoadClass { article }
-\RequirePackage { geometry }
 \RequirePackage { graphicx }
 \RequirePackage { l3draw }
 
+\clist_map_inline:nn {
+  paperwidth ,
+  paperheight ,
+  textwidth ,
+  textheight ,
+  topmargin ,
+  oddsidemargin ,
+  evensidemargin ,
+  hoffset ,
+  voffset ,
+  headheight ,
+  headsep ,
+  footskip ,
+  marginparwidth ,
+  marginparsep ,
+  marginparpush
+} {
+  \cs_new_protected:cpn {
+    leporello_ltlayout_ #1 _set:n
+  } ##1 {
+    \dim_set:cn {#1} {##1}
+  }
+}
+
 \cs_set_eq:NN \leporello_pagestyle_set:n \pagestyle
-\cs_set_eq:NN \leporello_geometry_set:n \geometry
 \cs_new_protected:Npn \leporello_page_gset:n #1 {
   \setcounter { page } {#1}
 }
@@ -690,20 +789,6 @@
   \group_end:
 }
 
-\cs_new:Npn \__leporello_flow_split_use_i:w
-  #1 \leporelloboxbreak #2 \q_stop {#1}
-\cs_new:Npn \__leporello_flow_split_use_i:n #1 {
-  \__leporello_flow_split_use_i:w #1 \q_stop
-}
-\cs_generate_variant:Nn \__leporello_flow_split_use_i:n { e }
-
-\cs_new:Npn \__leporello_flow_split_use_ii:w
-  #1 \leporelloboxbreak #2 \q_stop {#2}
-\cs_new:Npn \__leporello_flow_split_use_ii:n #1 {
-  \__leporello_flow_split_use_ii:w #1 \q_stop
-}
-\cs_generate_variant:Nn \__leporello_flow_split_use_ii:n { e }
-
 \cs_new_protected:Npn \__leporello_box_break_flow:n #1 {
   \prop_if_in:cnT { g__leporello_box_ #1 _prop } { name } {
     \tl_if_exist:cT {
@@ -728,70 +813,46 @@
       \tl_new:c { g__leporello_box_ \str_use:N \l_leporello_box_flow_into_str _tl }
     }
 
-    \tl_if_in:cnTF { g__leporello_box_ #1 _tl } {
-      \leporelloboxbreak
+    \vbox_gset_top:cn {
+      g__leporello_box_flow_ \str_use:N \l_leporello_box_flow_into_str _box
     } {
-      \vbox_gset_top:Nn \g__leporello_box_flow_temp_box {
-        \prop_item:cn { g__leporello_box_ #1 _prop } { pre }
-        \__leporello_flow_split_use_i:e {
-          \tl_use:c { g__leporello_box_ #1 _tl }
-        }
-        \group_begin:
-          \skip_zero:N \tex_parfillskip:D
-          \tex_par:D
-        \group_end:
-      }
-      \tl_gput_left:ce { g__leporello_box_ \str_use:N \l_leporello_box_flow_into_str _tl } {
-        \prop_item:cn { g__leporello_box_ #1 _prop } { pre }
-        \tex_noindent:D
-        \__leporello_flow_split_use_ii:e {
-          \tl_use:c { g__leporello_box_ #1 _tl }
-        }
-        \tex_par:D
-      }
-      \tl_gclear:c { g__leporello_box_ #1 _tl }
-    } {
-      \vbox_gset_top:cn {
+      \tl_use:c { g__leporello_box_ #1 _tl }
+    }
+    \tl_clear:c { g__leporello_box_ #1 _tl }
+    \group_begin:
+      \skip_zero:N \tex_splittopskip:D
+      \vbox_gset_split_to_ht:Ncn \g__leporello_box_flow_temp_box {
         g__leporello_box_flow_ \str_use:N \l_leporello_box_flow_into_str _box
       } {
-        \tl_use:c { g__leporello_box_ #1 _tl }
-      }
-      \tl_clear:c { g__leporello_box_ #1 _tl }
-      \group_begin:
-        \skip_zero:N \tex_splittopskip:D
-        \vbox_gset_split_to_ht:Ncn \g__leporello_box_flow_temp_box {
-          g__leporello_box_flow_ \str_use:N \l_leporello_box_flow_into_str _box
+        \bool_lazy_or:nnTF {
+          \l_leporello_layout_vertical_ltr_bool
         } {
-          \bool_lazy_or:nnTF {
-            \l_leporello_layout_vertical_ltr_bool
+          \l_leporello_layout_vertical_rtl_bool
+        } {
+          \prop_if_in:cnTF { g__leporello_box_ #1 _prop } { width } {
+            \prop_item:cn { g__leporello_box_ #1 _prop } { width }
           } {
-            \l_leporello_layout_vertical_rtl_bool
+            \clist_item:Nn \l_leporello_columns_clist {
+              \int_use:N \l_leporello_current_column_int
+            }
+          } -
+          \prop_item:cn { g__leporello_box_ #1 _prop } { padding ~ left } -
+          \prop_item:cn { g__leporello_box_ #1 _prop } { padding ~ right }
+        } {
+          \prop_if_in:cnTF { g__leporello_box_ #1 _prop } { height } {
+            \prop_item:cn { g__leporello_box_ #1 _prop } { height }
           } {
-            \prop_if_in:cnTF { g__leporello_box_ #1 _prop } { width } {
-              \prop_item:cn { g__leporello_box_ #1 _prop } { width }
-            } {
-              \clist_item:Nn \l_leporello_columns_clist {
-                \int_use:N \l_leporello_current_column_int
-              }
-            } -
-            \prop_item:cn { g__leporello_box_ #1 _prop } { padding ~ left } -
-            \prop_item:cn { g__leporello_box_ #1 _prop } { padding ~ right }
-          } {
-            \prop_if_in:cnTF { g__leporello_box_ #1 _prop } { height } {
-              \prop_item:cn { g__leporello_box_ #1 _prop } { height }
-            } {
-              \l_leporello_layout_height_dim
-            } -
-            \prop_item:cn { g__leporello_box_ #1 _prop } { padding ~ top } -
-            \prop_item:cn { g__leporello_box_ #1 _prop } { padding ~ bottom }
-          }
+            \l_leporello_layout_height_dim
+          } -
+          \prop_item:cn { g__leporello_box_ #1 _prop } { padding ~ top } -
+          \prop_item:cn { g__leporello_box_ #1 _prop } { padding ~ bottom }
         }
-      \group_end:
-      \tl_gput_left:ce { g__leporello_box_ \str_use:N \l_leporello_box_flow_into_str _tl } {
-        \exp_not:N \box_use_drop:c {
-          g__leporello_box_flow_ \str_use:N \l_leporello_box_flow_into_str _box
-        }
       }
+    \group_end:
+    \tl_gput_left:ce { g__leporello_box_ \str_use:N \l_leporello_box_flow_into_str _tl } {
+      \exp_not:N \box_use_drop:c {
+        g__leporello_box_flow_ \str_use:N \l_leporello_box_flow_into_str _box
+      }
     }
     \vbox_top:n {
       \vbox_unpack_drop:N \g__leporello_box_flow_temp_box
@@ -1415,7 +1476,7 @@
 
   \group_begin:
     \hook_use:n { leporello / typeset / before }
-    \keys_set:nn { leporello / print } {#1}
+    \keys_set:nn { leporello / typeset } {#1}
     \bool_if:NT \l_leporello_reverse_layout_bool {
       \clist_reverse:N \l_leporello_columns_clist
     }
@@ -1581,6 +1642,7 @@
 
 \hook_gput_code:nnn { begindocument / before } { . } {
   \leporello_pagestyle_set:n { empty }
+  
   \dim_set:Nn \l_leporello_paper_height_dim {
     \l_leporello_layout_height_dim + 2 \l_leporello_info_area_dim
   }
@@ -1587,16 +1649,44 @@
   \dim_set:Nn \l_leporello_paper_width_dim {
     \l_leporello_layout_width_dim + 2 \l_leporello_info_area_dim
   }
-  \bool_if:NTF \l_leporello_prepress_bool {
-    \leporello_geometry_set:n {
-      layoutwidth = \l_leporello_layout_width_dim ,
-      layoutheight = \l_leporello_layout_height_dim ,
-      layouthoffset = \l_leporello_info_area_dim ,
-      layoutvoffset = \l_leporello_info_area_dim ,
-      paperwidth = \l_leporello_paper_width_dim ,
-      paperheight = \l_leporello_paper_height_dim ,
-      margin = 0pt
-    }
+
+  \leporello_ltlayout_paperwidth_set:n { \l_leporello_layout_width_dim }
+  \leporello_ltlayout_paperheight_set:n { \l_leporello_layout_height_dim }
+  \leporello_ltlayout_textwidth_set:n { \l_leporello_layout_width_dim }
+  \leporello_ltlayout_textheight_set:n { \l_leporello_layout_height_dim }
+  \clist_map_inline:nn {
+    hoffset ,
+    voffset ,
+    headheight ,
+    headsep ,
+    footskip ,
+    marginparwidth ,
+    marginparsep ,
+    marginparpush
+  } {
+    \use:c { leporello_ltlayout_ #1 _set:n } { 0pt }
+  }
+  \clist_map_inline:nn {
+    topmargin ,
+    oddsidemargin ,
+    evensidemargin
+  } {
+    \use:c { leporello_ltlayout_ #1 _set:n } { -1in }
+  }
+  
+  \bool_if:NT \l_leporello_prepress_bool {
+    \clist_map_inline:nn {
+      topmargin ,
+      oddsidemargin ,
+      evensidemargin
+    } {
+      \use:c { leporello_ltlayout_ #1 _set:n } {
+        \l_leporello_info_area_dim - 1in
+      }
+    } 
+    \leporello_ltlayout_paperwidth_set:n { \l_leporello_paper_width_dim }
+    \leporello_ltlayout_paperheight_set:n { \l_leporello_paper_height_dim }
+
     \hook_gput_code:nnn { shipout / foreground } { . } {
       \__leporello_cropmarks:
       \dim_set:Nn \l__leporello_current_column_offset_dim {
@@ -1610,13 +1700,8 @@
         \__leporello_cropmarks:n { \l__leporello_current_column_offset_dim }
       }
     }
-  } {
-    \leporello_geometry_set:n {
-      paperwidth = \_leporello_layout_width_dim ,
-      paperheight = \l_leporello_layout_height_dim ,
-      margin = 0pt
-    }
   }
+  
   \skip_zero:N \tex_topskip:D
   \dim_zero:N \tex_parindent:D
 }
@@ -1733,16 +1818,39 @@
   \group_end:
 } { }
 
-\NewDocumentCommand { \leporelloset } { m } {
-  \keys_set:nn { leporello / global } {#1}
+\NewDocumentCommand { \leporelloset } { o m } {
+  \IfValueTF {#1} {
+    \keys_set:nn { leporello / #1 } {#2}
+  } {
+    \keys_set:nn { leporello } {#2}
+  }
 }
 
-\NewDocumentCommand { \leporellosetstyle } { m m } {
-  \keys_define:nn { leporello / box } {
-    #1  .meta:n = {#2}
+\NewDocumentCommand { \leporellosetstyle } { o m m } {
+  \IfValueTF {#1} {
+    \keys_define:nn { leporello / #1 } {
+      #2  .meta:n = {#3}
+    }
+  } {
+    \keys_define:nn { leporello } {
+      #2  .meta:n = {#3}
+    }
   }
 }
 
+\NewDocumentCommand { \leporellotypesetcolumns } { O{} m } {
+  \leporello_typeset_columns:nn {#1} {#2}
+}
+
+\NewDocumentCommand { \leporelloboxbreak } { } {
+  \group_begin:
+    \skip_zero:N \tex_parfillskip:D
+    \tex_par:D
+    \skip_vertical:n { 0pt plus 1fill }
+    \tex_penalty:D -10000
+  \group_end:
+}
+
 \NewDocumentCommand { \leporelloboxwidth } { } {
   \dim_use:N \l__leporello_typeset_box_width_dim
 }
@@ -1751,16 +1859,6 @@
   \dim_use:N \l_leporello_bleed_dim
 }
 
-\scan_new:N \s_leporello_split
-\NewDocumentCommand { \leporelloboxbreak } { } {
-  \s_leporello_split
-}
-
-\NewDocumentCommand { \leporellojustified } { } {
-  \skip_zero:N \tex_rightskip:D
-  \skip_zero:N \tex_leftskip:D
-}
-
 \NewDocumentCommand { \leporellocolordefine } { m m m } {
   \color_set:nnn {#1} {#2} {#3}
 }
@@ -1773,8 +1871,47 @@
   \leporello_typeset_image:nn {#1} {#2}
 }
 
-\NewDocumentCommand { \leporellotypesetcolumns } { O{} m } {
-  \leporello_typeset_columns:nn {#1} {#2}
+% ===
+
+\int_new:N \g_leporello_notes_int
+\seq_new:N \g_leporello_notes_seq
+\str_new:N \l_leporello_list_name_str
+
+\cs_new:Npn \leporello_note_mark:n #1 {
+  \textsuperscript { \int_use:N #1 }
 }
 
+\keys_define:nn { leporello } {
+  notes           .code:n       = {
+    \keys_set:nn { leporello / notes } {#1}
+  }
+}
+
+\keys_define:nn { leporello / notes } {
+  mark ~ cmd        .code:n       = {
+    \cs_set_eq:NN \leporello_note_mark:n #1
+  } ,
+  list ~ style      .str_set:N    = \l_leporello_list_name_str ,
+  list ~ style      .initial:n    = { enumerate }
+}
+
+\NewDocumentCommand { \leporellonote } { o m } {
+  \IfValueTF {#1} {
+    \int_gset:Nn \g_leporello_notes_int {#1}
+  } {
+    \int_gincr:N \g_leporello_notes_int
+  }
+  \seq_gput_right:Nn \g_leporello_notes_seq {#2}
+  \leporello_note_mark:n { \g_leporello_notes_int }
+}
+
+\NewDocumentCommand { \leporelloprintnotes } { } {
+  \seq_if_empty:NF \g_leporello_notes_seq {
+    \begin { \str_use:N \l_leporello_list_name_str }
+      \seq_map_tokens:Nn \g_leporello_notes_seq { \item }
+    \end { \str_use:N \l_leporello_list_name_str }
+    \seq_gclear:N \g_leporello_notes_seq
+  }
+}
+
 % EOF
\ No newline at end of file



More information about the tex-live-commits mailing list.