texlive[73550] Master/texmf-dist: fillpages (21jan25)
commits+karl at tug.org
commits+karl at tug.org
Tue Jan 21 21:46:27 CET 2025
Revision: 73550
https://tug.org/svn/texlive?view=revision&revision=73550
Author: karl
Date: 2025-01-21 21:46:27 +0100 (Tue, 21 Jan 2025)
Log Message:
-----------
fillpages (21jan25)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/fillpages/README.md
trunk/Master/texmf-dist/doc/latex/fillpages/fillpages-documentation.pdf
trunk/Master/texmf-dist/doc/latex/fillpages/fillpages-documentation.tex
trunk/Master/texmf-dist/tex/latex/fillpages/fillpages.sty
Modified: trunk/Master/texmf-dist/doc/latex/fillpages/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fillpages/README.md 2025-01-21 20:46:18 UTC (rev 73549)
+++ trunk/Master/texmf-dist/doc/latex/fillpages/README.md 2025-01-21 20:46:27 UTC (rev 73550)
@@ -1,16 +1,17 @@
# fillpages package
This package fills your document with blank or predefined pages to match a page count, that is suitable for printing (i.e. dividable by 4).
-There are three commands:
+There are four user commands:
\pagesDividableBy{<most likely 4, 8 or 16>}[<some optional offset i.e. 2>]
\setFillPage{<put something in here, if you don't like blank pages>}
+\setDefaultFillPage{<put something in here as the standard fill-page>}
\insertFillPages
-The last one defines the insertion point. There can be an arbitrary number of insertion points. Before every insertFillPages command there should be a clearpage command to assert, that there is a page break before, and avoid strange behaviour.
+The last one defines the insertion point. There can be an arbitrary number of insertion points. Each insertFillPages command equals at least a clearpage command. Something, which you need to consider.
# license, version, author
This work is published under the LaTeX project public license 1.3.
-2025-01-10: version 1.0.1
+2025-01-21: version 1.1.0
Created by Gabriel Ruprecht.
Modified: trunk/Master/texmf-dist/doc/latex/fillpages/fillpages-documentation.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/fillpages/fillpages-documentation.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fillpages/fillpages-documentation.tex 2025-01-21 20:46:18 UTC (rev 73549)
+++ trunk/Master/texmf-dist/doc/latex/fillpages/fillpages-documentation.tex 2025-01-21 20:46:27 UTC (rev 73550)
@@ -5,8 +5,8 @@
% This work is published under the %
% LaTeX project public license 1.3 %
% %
-% Package version 1.0.1 %
-% 2025-01-10 %
+% Package version 1.1.0 %
+% 2025-01-21 %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[11pt,a4paper]{scrartcl}
@@ -36,7 +36,7 @@
\def\FillPagesS{\hspace*{3pt}\includegraphics[height=\f at size pt]{./GFM-FP-LogoS}\hspace*{3pt}}
\makeatother
\title{Fill\FillPagesS Pages\FillPagesS Package\vskip 9pt\relax}
-\subtitle{Version 1.0.1}
+\subtitle{Version 1.1.0}
\author{Gabriel Ruprecht}
@@ -75,12 +75,15 @@
456
}
+\setDefaultFillPage{
+Nothing
+}
+
\begin{document}
\lipsum
-\clearpage
\insertFillPages
\insertFillPages
@@ -90,7 +93,6 @@
\lipsum
\lipsum
-\clearpage
\insertFillPages
\lipsum
@@ -98,10 +100,11 @@
\end{document}
\end{lstlisting}
+\newpage
\section{Commands}
-You have to define the number which the total page number should be devideable by. Then you define the insertion points for the fill pages. You can define content for any of these pages. After that, you have to run the document at least two times for a proper result. In the first run, the insertion points are counted and the regular page number is collected. On the second run, the pages are inserted.\bigskip
+You have to define the number which the total page number should be devideable by. Then you define the insertion points for the fill-pages. You can define content for any of these pages. After that, you have to run the document at least two times for a proper result. In the first run, the insertion points are counted and the regular page number is collected. On the second run, the pages are inserted.\bigskip
-\noindent\verb&\insertFillPages&\\ This command must be placed at the points, where insertion is allowed (insertion points). This can be done at multiple points. The total number of pages to be inserted is divided by the number of insertion points. If there are three insertion points and five pages will be inserted, the insertion will be \verb#1 1 2#. Previous to every \verb+\inserFillPages+ there should be a \verb+\clearpage+. Otherwise the page count will be miscalculated and might toggle.
+\noindent\verb&\insertFillPages&\\ This command must be placed at the points, where insertion is allowed (insertion points). This can be done at multiple points. The total number of pages to be inserted is divided by the number of insertion points. If there are three insertion points and five pages will be inserted, the insertion will be \verb#1 1 2#. Inside each \verb+\inserFillPages+ a \verb+\clearpage+ is executed at the beginning. Therefore all pending floats will be shipped out. \verb+\inserFillPages+ equals a \verb+\clearpage+, even if there are no fill-pages inserted.
\noindent\verb&\pagesDivisibleBy{number}[offset]&\\ This defines the number the page number must be divisible by (default~=~4). If \verb+number+ is 4 and page count is 13, 3 pages will be inserted~(4*4=16; 13+3=16). If \verb+number+ is~4 and \verb+offset+ is 2, the same example will lead to 1 inserted page (3*4=12; 12+2=14; 13+1=14). You can make the page numbers also divisible by 5 with an offset of 3. There is no limitation. The result will always be the minimal number of inserted pages. Divisible by 4, offset 1 has the same result as divisible by 4, offset 5.
@@ -110,8 +113,11 @@
\begin{lstlisting}[numbers=none]
\setFillPage{3}{This is the insert page three}
\end{lstlisting}\vskip -8pt\relax
-will create a page with the text ''This is the insert page three''. If only 2 pages are needed, it won't be used. If more than 2 are used, it will be. You can define as many fill pages as you want, but only the required amount will appear in your document. The command is defined as long, which means, you are allowed to use paragraphs inside. It behaves almost like any other page in \LaTeX .
+will create a page with the text ''This is the insert page three''. If only 2 pages are needed, it won't be used. If more than 2 are used, it will be. You can define as many fill-pages as you want, but only the required amount will appear in your document. The command is defined as long, which means, you are allowed to use paragraphs inside. It behaves almost like any other page in \LaTeX .
+\noindent\verb&\setDefaultFillPage{content}&\\
+This command works exactly like \verb&\setFillPage&, but takes only one argument. It sets the appearance of all other fill-pages. This makes it possible to set headers and footers, the page style or even a default text.
+
\section{What the package uses}
The package relies solely on standard \LaTeX -core functions.
@@ -125,7 +131,7 @@
\end{enumerate}
\item Second run:
\begin{enumerate}
-\item Calculate the number of total pages without the fill pages, that were inserted.
+\item Calculate the number of total pages without the fill-pages, that were inserted.
\item Do a modulo division on this page count by target divisor (offset must be considered). It is actually not a modulo operation, but this is the principle behind it. Page count is 15, must be divisible by 4 (offset 0), 15\%4=3 $\rightarrow$ 1 page too less.
\item This number of pages to be inserted is distributed across all insertion points.\\Example 1: 3 insertion points and 3 pages, each gets one page.\\Example 2: 3 insertion points and 4 pages, first two get one page, third one gets two pages. This is done by the total limit. At the first point total limit is 1.33 $\rightarrow$ 1 inserted. At the second point, limit is 2.66, 1 already inserted $\rightarrow$ insert 1. At the third insertion point the total limit is 4, 2 already inserted $\rightarrow$ insert 2.
\end{enumerate}
@@ -137,9 +143,9 @@
The package uses the \verb+\AtBeginDocument+ and \verb+\AtEndDocument+ document hook. If there is some issue with them, it won't work. I experienced some weird behaviour in koma classes with a beta-version of this package, which I couldn't explain. Therefore, it is mentioned here.
The package writes the following lines to the aux-file:\begin{lstlisting}[breaklines, numbers=none]
- \global\GFM at FiPa@numberOfFillPagePositions=<Number of fill page positions>}
+ \global\GFM at FiPa@numberOfFillPagePositions=<Number of fill-page positions>}
- \global\GFM at FiPa@numberOfInsertedPages=<Page count of fill pages>}
+ \global\GFM at FiPa@numberOfInsertedPages=<Page count of fill-pages>}
\end{lstlisting}\vskip -8pt\relax
\noindent Make sure, that they don't interfere with anything of other packages or with any of your counters. Due to the naming this shouldn't happen at all.
@@ -146,10 +152,10 @@
\section{Known problems}
\subsection{Page number toggles}
-If you have i.e. 10 pages and define divisible by 4, it should be 12 pages, which makes 2 fill pages. If the page number toggles between 11 and 13 every two runs, there are two possible reasons:
+If you have i.e. 10 pages and define divisible by 4, it should be 12 pages, which makes 2 fill-pages. If the page number toggles between 11 and 13 every two runs, there are two possible reasons:
\begin{enumerate}
\item You didn't put a clearpage before the \verb+\insertFillPages+
-\item You defined a custom fill page which is bigger than one page and will result in two fill pages, though one should be inserted
+\item You defined a custom fill-page which is bigger than one page and will result in two fill-pages, though one should be inserted
\end{enumerate}
@@ -165,12 +171,20 @@
\begin{tabular}{l l}
2017/11/01:& version 0.1.0\\
2025/01/07:& version 1.0.0\\
-2025/01/10:& version 1.0.1
+2025/01/10:& version 1.0.1\\
+2025/01/21:& version 1.1.0
\end{tabular}
\end{document}
+\section{Version 1.1.0}
+\long\def\setDefaultFillPage#1{%
+ \def\GFM at FP@defaultFillPage{%
+ #1%
+ }%
+}
+
\section{Before upload}
Is the license in
- the sty- and tex-files?
Modified: trunk/Master/texmf-dist/tex/latex/fillpages/fillpages.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fillpages/fillpages.sty 2025-01-21 20:46:18 UTC (rev 73549)
+++ trunk/Master/texmf-dist/tex/latex/fillpages/fillpages.sty 2025-01-21 20:46:27 UTC (rev 73550)
@@ -5,11 +5,11 @@
% This work is published under the %
% LaTeX project public license 1.3 %
% %
-% Package version 1.0.1 %
-% 2025-01-10 %
+% Package version 1.1.0 %
+% 2025-01-21 %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\ProvidesPackage{fillpages}[version 1.0.1]
+\ProvidesPackage{fillpages}[version 1.1.0]
%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Number definitions %%%
@@ -66,7 +66,7 @@
\NewDocumentCommand\pagesDivisibleBy{m O{0}}{%
\GFM at FiPa@Divisor=#1\relax%
\ifnum\GFM at FiPa@Divisor<1\relax%
- \PackageError{fillpages.sty}{line 31: Illegal number}{You can't divide a page count by zero. Replaced with 1.}%
+ \PackageError{fillpages.sty}{line 69: Illegal number}{You can't divide a page count by zero. Replaced with 1.}%
\GFM at FiPa@Divisor=1\relax%
\fi%
\ifnum\GFM at FiPa@Divisor>50\relax%
@@ -78,20 +78,28 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%% Defines a custom fillpage %%%
+%%% Defines fillpages %%%
%%% %%%
%%% i.e. \setFillPage{1}{custom Text} lets %%%
%%% appear "custom Text" on fillpage no. 1 %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\long\def\setFillPage#1#2{
-\expandafter\global\expandafter\def\csname GFM at FiPa@AusgleichSeite#1\endcsname {
+\long\def\setFillPage#1#2{%
+\expandafter\global\expandafter\def\csname GFM at FiPa@insertionFillPage#1\endcsname {%
#2%
}%\def\csname...
}%\def\setFillPage
+\long\def\setDefaultFillPage#1{%
+\expandafter\global\expandafter\def\csname GFM at FiPa@defaultFillPage\endcsname {%
+#1%
+}%\def\csname...
+}%\def\setFillPage
+\setDefaultFillPage{}
+
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Do the calculations, after %%%
%%% the aux file had been read. %%%
@@ -147,14 +155,25 @@
\advance\GFM at FiPa@numberOfInsertedPages by 1\relax%
\clearpage%
% choose the content of a predefined page. If it doesn't exist, csname expands to nothing.
+ %%%%%%%%%%%%%%
+ \expandafter\ifx%
+ \csname %
+ GFM at FiPa@insertionFillPage\the\GFM at FiPa@numberOfInsertedPages%
+ \endcsname%
+ \relax% -> if x=relax
+ \GFM at FiPa@defaultFillPage%
+ \else%ifx
+ %%%%%%%%%%%%%%
\csname %
- GFM at FiPa@AusgleichSeite\the\GFM at FiPa@numberOfInsertedPages
+ GFM at FiPa@insertionFillPage\the\GFM at FiPa@numberOfInsertedPages
\endcsname%
+ \fi%ifx
\mbox{}%
\clearpage%
\ifnum\GFM at FiPa@numberOfInsertedPages>1000\relax%
- \PackageError{fillpages.sty}{line 101: More than 1000 fill pages produced.}{You tried to insert more than 1000 fill pages. This must be an infinite loop.}%
- \errmessage{Infinite loop detected}
+ \PackageError{fillpages.sty}{line 156: More than 1000 fill pages produced.}{You tried to insert more than 1000 fill pages. This must be an infinite loop.}%
+ %\errmessage{Infinite loop detected}
+ \stop
\fi%
\ifdim\GFM at FiPa@numberOfInsertedPages pt<\GFM at FiPa@currentLimit\repeat%
%end loop%
More information about the tex-live-commits
mailing list.