texlive[76094] Master/texmf-dist: leporello (19aug25)
commits+karl at tug.org
commits+karl at tug.org
Tue Aug 19 21:50:15 CEST 2025
Revision: 76094
https://tug.org/svn/texlive?view=revision&revision=76094
Author: karl
Date: 2025-08-19 21:50:15 +0200 (Tue, 19 Aug 2025)
Log Message:
-----------
leporello (19aug25)
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-19 19:50:07 UTC (rev 76093)
+++ trunk/Master/texmf-dist/doc/latex/leporello/README.md 2025-08-19 19:50:15 UTC (rev 76094)
@@ -1,4 +1,4 @@
-
+
# The `leporello` class
Modified: trunk/Master/texmf-dist/doc/latex/leporello/doc/layout.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/leporello/doc/layout.tex 2025-08-19 19:50:07 UTC (rev 76093)
+++ trunk/Master/texmf-dist/doc/latex/leporello/doc/layout.tex 2025-08-19 19:50:15 UTC (rev 76094)
@@ -35,7 +35,7 @@
\begin{leporellobox}[
background color=black!10,
offset={0mm,50mm},
- stretch height,
+ stretch,
bleed={b}
]
bar
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-19 19:50:07 UTC (rev 76093)
+++ trunk/Master/texmf-dist/doc/latex/leporello/leporello-doc.tex 2025-08-19 19:50:15 UTC (rev 76094)
@@ -11,8 +11,8 @@
% This work has the LPPL maintenance status `maintained'.
%
\documentclass[a4paper]{article}
-\def\leporellofileversion{0.9.0}
-\def\leporellofiledate{15 August 2025}
+\def\leporellofileversion{0.9.2}
+\def\leporellofiledate{18 August 2025}
\usepackage[T1]{fontenc}
\usepackage{Alegreya}
@@ -264,7 +264,8 @@
\changes{v0.7.0}{2025/08/08}{First public beta release.}
\changes{v0.8.0}{2025/08/12}{Added box attachment mechanism and option to place arbitrary code to box background.}
-\changes{v0.9.0}{2025/08/15}{Box attachment mechanism and flow mechanism use box name instead of ID. Enhanced pagination settings. Support for RTL and vertical typesetting.}
+\changes{v0.9.0}{2025/08/15}{Box attachment mechanism and flow mechanism use box name instead of ID. Enhanced pagination settings. Support for right-to-left and vertical typesetting.}
+\changes{v0.9.2}{2025/08/18}{Various improvements and bug fixes.}
\begin{document}
\printdoctitle
@@ -285,6 +286,8 @@
There are some requirements for the creation of print data for high-quality folded leaflets: Especially if the leaflet is folded inward, the inner pages should be a bit less wide, so in general the pages of a leaflet are not of the exact same width (although the widths only differ slightly). Also, borderless printing requires that the print data adds a so-called bleed area added to the layout if the final document into which the typeset material extends. This area is trimmed off eventually to avoid unprinted edges due to natural movement of the paper during guillotining. Crop marks need to be added to the print data showing the layout of the final document. This packages takes into account all these requirements while providing a lot of customization.
+\warning This document class is still in a beta phase which means that bugs cannot be ruled out and some things may not work properly. Also, updates may be published frequently. The author is grateful for reporting any bugs via GitHub at \url{https://github.com/jasperhabicht/leporello/issues}. A site for asking questions about the document class and for suggestions for improvement is available at \url{https://github.com/jasperhabicht/leporello/discussions}.
+
\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.
@@ -333,27 +336,22 @@
\begin{macrodef}
|auto typeset|
\end{macrodef}
-If set, the columns are automatically typeset according to the order of the definition.
+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}
-|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.
-
-\begin{macrodef}
|show frames|
\end{macrodef}
-If set, frames around the single pages (columns) are shown. Does not expect a value.
+If set, frames around the single pages (columns) are shown. This key does not expect a value.
\begin{macrodef}
|show ids|
\end{macrodef}
-If set, the IDs of the boxes are shown. 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.
+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|
\end{macrodef}
-If set, the paper size is increased at all four pages by the width of the info area and crop marks are shown. Does not expect a value.
+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>}
@@ -373,7 +371,7 @@
\begin{macrodef}
|\leporelloboxwidth|
\end{macrodef}
-Retrieves the width of the current box including padding, but without bleed, in pt.
+Retrieves the width of the current box including padding, but without bleed, in pt. The width of the box excluding padding can be retrieved with the \macro{\linewidth} command.
\section{Defining columns}
@@ -384,7 +382,7 @@
<body>
\end{|leporellocolumn|}
\end{macrodef}
-A column is defined by the \macro{leporellocolumn} environment which takes one mandatory argument taking the name (ID) of the column. A single dot (\macro{.}) is reserved as name for an empty column.
+A column is defined by the \macro{leporellocolumn} environment which takes one mandatory argument taking the name of the column. A single dot (\macro{.}) is reserved as name for an empty column.
\section{Positioning boxes}
@@ -437,7 +435,7 @@
\begin{macrodef}
|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.
+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>}
@@ -450,10 +448,12 @@
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 height|
+|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) meets the edge of the parent column. Does not expect a value.
+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.
+\warning In the current version of the package, the \macro{stretch} key does not work in combination with attaching the box to another box (other than the column box).
+
\begin{macrodef}
|padding left|={<dimension>}
|padding right|={<dimension>}
@@ -511,18 +511,28 @@
\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 one of the following keys:
+The command takes one optional argument that accepts the following keys:
\begin{macrodef}
|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.
+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|
\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.
+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|
+\end{macrodef}
+If set, the pagination of the columns is reversed. This key does not expect a value.
+
+\begin{macrodef}
+|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.
+
\section{Flow mechanism}\label{sec:flow}
Typeset material can flow from one box to another box. To this end, the key \macro{flow into} can be set to the relevant box and assigned the name of the box to flow into as value. The name of the relevant box can be set via the \macro{name} key.
@@ -536,8 +546,10 @@
\subsection{Right-to-left and vertical typesetting}
-The document class natively supports right-to-left and vertical typesetting using the mechanisms provided by LuaLaTeX. The \macro{babel} package also makes use of the mechanisms for bidirectional typesetting provided by LuaLaTeX, which means that this package will work best with a combination of LuaLaTeX and \macro{babel}for right-to-left or vertical typesetting.
+The document class natively supports right-to-left and vertical typesetting using the mechanisms provided by LuaLaTeX. The \macro{babel} package also makes use of the mechanisms for bidirectional typesetting provided by LuaLaTeX, which means that this package will work best with a combination of LuaLaTeX and \macro{babel} for right-to-left or vertical typesetting.
+If right-to-left typesetting is activated, the layout, order and pagination of the layout will be reversed automatically.
+
If the \macro{bidi} package is used (which is used by the \macro{polyglossia} package), the following addition to the preamble is needed to enable right-to-left typesetting:
\begin{codeexample}
@@ -580,7 +592,7 @@
\begin{macrodef}
|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.
+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>}
@@ -590,7 +602,7 @@
\begin{macrodef}
|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}. Does not expect a value.
+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.
\subsection{Defining colors}
@@ -622,11 +634,11 @@
\subsection{Hooks}
-The package offers two pairs of hooks that are positioned at the start and end of columns and boxes allowing for inserting code.
+The package offers three pairs of hooks that are positioned at the start and end of columns and boxes allowing for inserting code.
The package uses the hook \macro{begindocument/before} to insert layout-related settings among other things via the \macro{geometry} package as well as the hook \macro{shipout/foreground} to insert code to draw cropmarks.
-In the context of RTL typesetting, the package uses the hooks \macro{leporello/typeset/before} and \macro{leporello/box/begin} to unset and reset RTL mode.
+The package uses the hooks \macro{leporello/typeset/before} and \macro{leporello/box/begin} to unset and reset right-to-left and vertical typesetting mode.
\begin{longtable}{
@{}
@@ -681,7 +693,7 @@
\begin{leporellobox}[
background color=black!10,
offset={0mm,50mm},
- stretch height,
+ stretch,
bleed={b}
]
bar
Modified: trunk/Master/texmf-dist/tex/latex/leporello/leporello.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/leporello/leporello.cls 2025-08-19 19:50:07 UTC (rev 76093)
+++ trunk/Master/texmf-dist/tex/latex/leporello/leporello.cls 2025-08-19 19:50:15 UTC (rev 76094)
@@ -11,7 +11,7 @@
% This work has the LPPL maintenance status `maintained'.
%
\ProvidesExplClass{leporello}
- {2025/08/15} {0.9.0} {Document class for typesetting folded leaflets}
+ {2025/08/18} {0.9.2} {Document class for typesetting folded leaflets}
\cs_generate_variant:Nn \clist_item:Nn { NV }
\cs_generate_variant:Nn \coffin_attach:NnnNnnnn { cencennn , ceeceeee }
@@ -24,6 +24,24 @@
\prg_generate_conditional_variant:Nnn \clist_if_in:nn { en } { T , F , TF }
\prg_generate_conditional_variant:Nnn \str_if_eq:nn { en } { T , F }
+\cs_new:Npn \__leporello_fp_tuple_use_i:w ( #1 , #2 ) {#1}
+\cs_new:Npn \leporello_fp_tuple_use_i:n #1 {
+ \fp_to_dim:n {
+ \exp_last_unbraced:Ne
+ \__leporello_fp_tuple_use_i:w { \fp_eval:n {#1} }
+ }
+}
+\cs_generate_variant:Nn \leporello_fp_tuple_use_i:n { e }
+
+\cs_new:Npn \__leporello_fp_tuple_use_ii:w ( #1 , #2 ) {#2}
+\cs_new:Npn \leporello_fp_tuple_use_ii:n #1 {
+ \fp_to_dim:n {
+ \exp_last_unbraced:Ne
+ \__leporello_fp_tuple_use_ii:w { \fp_eval:n {#1} }
+ }
+}
+\cs_generate_variant:Nn \leporello_fp_tuple_use_ii:n { e }
+
\bool_new:N \l_leporello_show_frames_bool
\bool_new:N \l_leporello_show_id_bool
\bool_new:N \l_leporello_prepress_bool
@@ -43,7 +61,7 @@
\int_new:N \l_leporello_auto_typeset_int
\keys_define:nn { leporello / global } {
- columns .code:n = {
+ columns .code:n = {
\clist_set:Nn \l_leporello_columns_clist {#1}
\int_set:Nn \l_leporello_column_count_int {
\clist_count:N \l_leporello_columns_clist
@@ -53,48 +71,42 @@
\dim_add:Nn \l_leporello_layout_width_dim {##1}
}
} ,
- columns .initial:n = { 97mm , 100mm , 100mm } ,
- layout ~ height .dim_set:N = \l_leporello_layout_height_dim ,
- layout ~ height .initial:n = { 210mm } ,
- continuous ~ pagination
- .bool_set:N = \l_leporello_continuous_pagination_bool ,
- continuous ~ pagination
- .default:n = { true } ,
- continuous ~ pagination
- .initial:n = { false } ,
- auto ~ typeset .bool_set:N = \l_leporello_auto_typeset_bool ,
- auto ~ typeset .default:n = { true } ,
- auto ~ typeset .initial:n = { false } ,
- show ~ frames .bool_set:N = \l_leporello_show_frames_bool ,
- show ~ frames .default:n = { true } ,
- show ~ frames .initial:n = { false } ,
- show ~ ids .bool_set:N = \l_leporello_show_id_bool ,
- show ~ ids .default:n = { true } ,
- show ~ ids .initial:n = { false } ,
- prepress .bool_set:N = \l_leporello_prepress_bool ,
- prepress .default:n = { true } ,
- prepress .initial:n = { false } ,
- bleed .dim_set:N = \l_leporello_bleed_dim ,
- bleed .initial:n = { 3mm } ,
- info ~ area .dim_set:N = \l_leporello_info_area_dim ,
- info ~ area .initial:n = { 10mm } ,
+ columns .initial:n = { 97mm , 100mm , 100mm } ,
+ layout ~ height .dim_set:N = \l_leporello_layout_height_dim ,
+ layout ~ height .initial:n = { 210mm } ,
+ auto ~ typeset .bool_set:N = \l_leporello_auto_typeset_bool ,
+ auto ~ typeset .default:n = { true } ,
+ auto ~ typeset .initial:n = { false } ,
+ show ~ frames .bool_set:N = \l_leporello_show_frames_bool ,
+ show ~ frames .default:n = { true } ,
+ show ~ frames .initial:n = { false } ,
+ show ~ ids .bool_set:N = \l_leporello_show_id_bool ,
+ show ~ ids .default:n = { true } ,
+ show ~ ids .initial:n = { false } ,
+ prepress .bool_set:N = \l_leporello_prepress_bool ,
+ prepress .default:n = { true } ,
+ prepress .initial:n = { false } ,
+ bleed .dim_set:N = \l_leporello_bleed_dim ,
+ bleed .initial:n = { 3mm } ,
+ info ~ area .dim_set:N = \l_leporello_info_area_dim ,
+ info ~ area .initial:n = { 10mm } ,
- two ~ columns .meta:n = {
+ two ~ columns .meta:n = {
columns = { 99mm , 99mm }
} ,
- three ~ columns .meta:n = {
+ three ~ columns .meta:n = {
columns = { 97mm , 100mm , 100mm }
} ,
- four ~ columns .meta:n = {
+ four ~ columns .meta:n = {
columns = { 99mm , 99mm , 99mm , 100mm }
} ,
- four ~ columns ~ wrap .meta:n = {
+ four ~ columns ~ wrap .meta:n = {
columns = { 97mm , 99mm , 100mm , 101mm }
} ,
- five ~ columns .meta:n = {
+ five ~ columns .meta:n = {
columns = { 97mm , 97mm , 97mm , 99mm , 100mm }
} ,
- six ~ columns .meta:n = {
+ six ~ columns .meta:n = {
columns = { 99mm , 99mm , 96mm , 96mm , 100mm , 100mm }
}
}
@@ -136,9 +148,9 @@
\clist_new:N \g_leporello_parent_boxes_clist
\prop_new:N \g_leporello_box_names_prop
-\tl_new:N \l__leporello_box_align_parent_clist
-\tl_new:N \l__leporello_box_align_self_clist
-\tl_new:N \l__leporello_box_offset_clist
+\clist_new:N \l__leporello_box_align_parent_clist
+\clist_new:N \l__leporello_box_align_self_clist
+\fp_new:N \l__leporello_box_offset_fp
\tl_new:N \l__leporello_box_store_width_tl
\tl_new:N \l__leporello_box_store_height_tl
\dim_new:N \l__leporello_box_padding_left_dim
@@ -153,7 +165,6 @@
\str_new:N \l_leporello_box_flow_into_str
\box_new:N \g_leporello_box_flow_temp_box
-\seq_new:N \g_leporello_box_flow_temp_seq
\dim_new:N \l_leporello_typeset_box_width_inner_dim
\dim_new:N \l_leporello_typeset_box_width_dim
@@ -198,7 +209,7 @@
align ~ parent .initial:n = { l , t } ,
align ~ self .clist_set:N = \l__leporello_box_align_self_clist ,
align ~ self .initial:n = { l , t } ,
- offset .clist_set:N = \l__leporello_box_offset_clist ,
+ offset .fp_set:N = \l__leporello_box_offset_fp ,
offset .initial:n = { 0mm , 0mm } ,
width .code:n = {
\prop_gput:cne { g_leporello_box_ \int_use:N \g_leporello_box_int _prop }
@@ -208,9 +219,8 @@
\prop_gput:cne { g_leporello_box_ \int_use:N \g_leporello_box_int _prop }
{ height } {#1}
} ,
- stretch ~ height .bool_set:N = \l__leporello_box_stretch_height_bool ,
- stretch ~ height .default:n = { true } ,
- stretch ~ height .initial:n = { false } ,
+ stretch .bool_set:N = \l__leporello_box_stretch_bool ,
+ stretch .initial:n = { false } ,
padding / left .dim_set:N = \l__leporello_box_padding_left_dim ,
padding / right .dim_set:N = \l__leporello_box_padding_right_dim ,
padding / top .dim_set:N = \l__leporello_box_padding_top_dim ,
@@ -241,14 +251,23 @@
\bool_new:N \l_leporello_reverse_layout_bool
\bool_new:N \l_leporello_reverse_order_bool
+\bool_new:N \l_leporello_reverse_pagination_bool
\keys_define:nn { leporello / print } {
- reverse ~ layout .bool_set:N = \l_leporello_reverse_layout_bool ,
- reverse ~ layout .default:n = { true } ,
- reverse ~ layout .initial:n = { false } ,
- reverse ~ order .bool_set:N = \l_leporello_reverse_order_bool ,
- reverse ~ order .default:n = { true } ,
- reverse ~ order .initial:n = { false }
+ reverse ~ layout .code:n = {
+ \bool_set_inverse:N \l_leporello_reverse_layout_bool
+ } ,
+ reverse ~ order .code:n = {
+ \bool_set_inverse:N \l_leporello_reverse_order_bool
+ } ,
+ reverse ~ pagination
+ .code:n = {
+ \bool_set_inverse:N \l_leporello_reverse_pagination_bool
+ } ,
+ continuous ~ pagination
+ .bool_set:N = \l_leporello_continuous_pagination_bool ,
+ continuous ~ pagination
+ .initial:n = { false }
}
\bool_new:N \l_leporello_image_fill_bleed_bool
@@ -288,8 +307,12 @@
\dim_set:Nn \l_leporello_image_clip_height_dim {#1}
} ,
offset .code:n = {
- \dim_set:Nn \l_leporello_image_offset_x_dim { \clist_item:nn {#1} { 1 } }
- \dim_set:Nn \l_leporello_image_offset_y_dim { - \clist_item:nn {#1} { 2 } }
+ \dim_set:Nn \l_leporello_image_offset_x_dim {
+ \leporello_fp_tuple_use_i:n {#1}
+ }
+ \dim_set:Nn \l_leporello_image_offset_y_dim {
+ - \leporello_fp_tuple_use_ii:n {#1}
+ }
} ,
offset .initial:n = { 0mm , 0mm } ,
scale .fp_set:N = \l_leporello_image_scale_fp ,
@@ -296,7 +319,6 @@
scale .initial:n = { 1 } ,
ignore ~ padding .clist_set:N = \l_leporello_image_ignore_padding_clist ,
fill ~ bleed .bool_set:N = \l_leporello_image_fill_bleed_bool ,
- fill ~ bleed .default:n = { true } ,
fill ~ bleed .initial:n = { false }
}
@@ -317,6 +339,9 @@
{ 1 } {
\bool_set_false:N \l_leporello_layout_vertical_ltr_bool
\bool_set_false:N \l_leporello_layout_vertical_rtl_bool
+ \bool_set_inverse:N \l_leporello_reverse_layout_bool
+ \bool_set_inverse:N \l_leporello_reverse_order_bool
+ \bool_set_inverse:N \l_leporello_reverse_pagination_bool
\tex_bodydir:D TLT
\tex_pardir:D TLT
\tex_textdir:D TLT
@@ -349,6 +374,9 @@
{ 3 } {
\bool_set_false:N \l_leporello_layout_vertical_ltr_bool
\bool_set_true:N \l_leporello_layout_vertical_rtl_bool
+ \bool_set_inverse:N \l_leporello_reverse_layout_bool
+ \bool_set_inverse:N \l_leporello_reverse_order_bool
+ \bool_set_inverse:N \l_leporello_reverse_pagination_bool
\tex_bodydir:D TLT
\tex_pardir:D TLT
\tex_textdir:D TLT
@@ -658,6 +686,20 @@
\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 {
@@ -685,15 +727,11 @@
\tl_if_in:cnTF { g_leporello_box_ #1 _tl } {
\leporelloboxbreak
} {
- \seq_gset_split:Nne \g_leporello_box_flow_temp_seq {
- \leporelloboxbreak
- } {
- \tl_use:c { g_leporello_box_ #1 _tl }
- }
- \tl_clear:c { g_leporello_box_ #1 _tl }
\vbox_gset_top:Nn \g_leporello_box_flow_temp_box {
\prop_item:cn { g_leporello_box_ #1 _prop } { pre }
- \seq_item:Nn \g_leporello_box_flow_temp_seq { 1 }
+ \__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
@@ -702,9 +740,12 @@
\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
- \seq_item:Nn \g_leporello_box_flow_temp_seq { 2 }
+ \__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 {
g_leporello_box_flow_ \str_use:N \l_leporello_box_flow_into_str _box
@@ -762,7 +803,7 @@
} {
\l_leporello_layout_vertical_rtl_bool
} {
- \prop_if_in:cnTF { g_leporello_box_ #1 _prop } {height } {
+ \prop_if_in:cnTF { g_leporello_box_ #3 _prop } { height } {
\prop_item:cn { g_leporello_box_ #3 _prop } { height }
} {
\l_leporello_layout_height_dim
@@ -792,7 +833,9 @@
\int_set:Nn \l_leporello_current_box_int {#3}
\hook_use:n { leporello / box / begin }
\__leporello_box_break_flow:n {#3}
- \tl_use:c { g_leporello_box_ #3 _tl }
+ \vbox_top:n {
+ \tl_use:c { g_leporello_box_ #3 _tl }
+ }
\hook_use:n { leporello / box / end }
\draw_suspend_end:
}
@@ -801,7 +844,19 @@
\prop_if_in:cnTF { g_leporello_box_ #3 _prop } { width } {
\prop_item:cn { g_leporello_box_ #3 _prop } { width }
} {
- \clist_item:Nn \l_leporello_columns_clist {#2}
+ \bool_lazy_or:nnTF {
+ \l_leporello_layout_vertical_ltr_bool
+ } {
+ \l_leporello_layout_vertical_rtl_bool
+ } {
+ \coffin_wd:c {
+ g_leporello_box_ #1 _ #2 _ #3 _inner_coffin
+ } +
+ \prop_item:cn { g_leporello_box_ #3 _prop } { padding ~ left } +
+ \prop_item:cn { g_leporello_box_ #3 _prop } { padding ~ right }
+ } {
+ \clist_item:Nn \l_leporello_columns_clist {#2}
+ }
}
}
@@ -820,16 +875,33 @@
}
}
- \bool_if:nT { \prop_item:cn { g_leporello_box_ #3 _prop } { stretch ~ height } } {
- \dim_set:Nn \l_leporello_typeset_box_height_dim {
- \fp_to_dim:n {
- \l_leporello_layout_height_dim -
- (
- \clist_item:en {
- \prop_item:cn { g_leporello_box_ #3 _prop } { offset }
- } { 2 }
- )
+ \bool_if:nT { \prop_item:cn { g_leporello_box_ #3 _prop } { stretch } } {
+ \bool_lazy_or:nnTF {
+ \l_leporello_layout_vertical_ltr_bool
+ } {
+ \l_leporello_layout_vertical_rtl_bool
+ } {
+ \dim_set:Nn \l_leporello_typeset_box_width_dim {
+ \fp_to_dim:n {
+ \clist_item:Nn \l_leporello_columns_clist {#2} -
+ (
+ \leporello_fp_tuple_use_i:e {
+ \prop_item:cn { g_leporello_box_ #3 _prop } { offset }
+ }
+ )
+ }
}
+ } {
+ \dim_set:Nn \l_leporello_typeset_box_height_dim {
+ \fp_to_dim:n {
+ \l_leporello_layout_height_dim -
+ (
+ \leporello_fp_tuple_use_ii:e {
+ \prop_item:cn { g_leporello_box_ #3 _prop } { offset }
+ }
+ )
+ }
+ }
}
}
@@ -1082,17 +1154,17 @@
} { 2 }
} {
\fp_to_dim:n {
- \clist_item:en {
+ \leporello_fp_tuple_use_i:e {
\prop_item:cn { g_leporello_box_ #2 _prop } { offset }
- } { 1 } -
+ } -
\l__leporello_typeset_box_bleed_left_dim
}
} {
\fp_to_dim:n {
(
- \clist_item:en {
+ \leporello_fp_tuple_use_ii:e {
\prop_item:cn { g_leporello_box_ #2 _prop } { offset }
- } { 2 } -
+ } -
\l__leporello_typeset_box_bleed_top_dim
) * \l__leporello_typeset_coffin_attach_align_int
}
@@ -1169,26 +1241,52 @@
}
\leporello_page_gset:n {
\bool_if:NTF \l_leporello_continuous_pagination_bool {
- \int_eval:n {
- ( \l_leporello_current_page_int - 1 ) *
- \l_leporello_column_count_int +
- \l_leporello_current_column_int
+ \bool_if:NTF \l_leporello_reverse_pagination_bool {
+ \int_eval:n {
+ ( \l_leporello_current_page_int ) *
+ \l_leporello_column_count_int -
+ \l_leporello_current_column_int + 1
+ }
+ } {
+ \int_eval:n {
+ ( \l_leporello_current_page_int - 1 ) *
+ \l_leporello_column_count_int +
+ \l_leporello_current_column_int
+ }
}
} {
- \int_eval:n {
- \int_div_truncate:nn {
- \l_leporello_current_page_int - 1
- } { 2 } *
- \l_leporello_column_count_int * 2 +
- \int_mod:nn {
+ \bool_if:NTF \l_leporello_reverse_pagination_bool {
+ \int_eval:n {
+ \int_div_truncate:nn {
+ \l_leporello_current_page_int - 1
+ } { 2 } *
+ \l_leporello_column_count_int * 2 -
\int_mod:nn {
- \l_leporello_current_page_int
+ \int_mod:nn {
+ \l_leporello_current_page_int
+ } { 2 } *
+ \l_leporello_column_count_int +
+ \l_leporello_current_column_int + 1
+ } {
+ \l_leporello_column_count_int * 2
+ } + \l_leporello_column_count_int * 2
+ }
+ } {
+ \int_eval:n {
+ \int_div_truncate:nn {
+ \l_leporello_current_page_int - 1
} { 2 } *
- \l_leporello_column_count_int +
- \l_leporello_current_column_int
- } {
- \l_leporello_column_count_int * 2
- } + 1
+ \l_leporello_column_count_int * 2 +
+ \int_mod:nn {
+ \int_mod:nn {
+ \l_leporello_current_page_int
+ } { 2 } *
+ \l_leporello_column_count_int +
+ \l_leporello_current_column_int
+ } {
+ \l_leporello_column_count_int * 2
+ } + 1
+ }
}
}
}
@@ -1382,12 +1480,12 @@
\prop_gput:cne { g_leporello_box_ \int_use:N \g_leporello_box_int _prop }
{ align ~ self }
{ \clist_use:Nn \l__leporello_box_align_self_clist { , } }
- \prop_gput:cne { g_leporello_box_ \int_use:N \g_leporello_box_int _prop }
+ \prop_gput:cnV { g_leporello_box_ \int_use:N \g_leporello_box_int _prop }
{ offset }
- { \clist_use:Nn \l__leporello_box_offset_clist { , } }
+ \l__leporello_box_offset_fp
\prop_gput:cne { g_leporello_box_ \int_use:N \g_leporello_box_int _prop }
- { stretch ~ height }
- { \bool_if_p:N \l__leporello_box_stretch_height_bool }
+ { stretch }
+ { \bool_if_p:N \l__leporello_box_stretch_bool }
\prop_gput:cnV { g_leporello_box_ \int_use:N \g_leporello_box_int _prop }
{ padding ~ left }
\l__leporello_box_padding_left_dim
More information about the tex-live-commits
mailing list.