summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-04-12 20:06:19 +0000
committerKarl Berry <karl@freefriends.org>2023-04-12 20:06:19 +0000
commit8272ef2189d57ada30e8fbd6ce8261e7680a63e1 (patch)
treeb840668a2f1c654b5acfa594d3d2d7c938f51e82 /Master/texmf-dist
parentbe827ad4c76a2ee7ede7c7e4cea8fcb0c277c04d (diff)
papermas (12apr23)
git-svn-id: svn://tug.org/texlive/trunk@66835 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/papermas/README123
-rw-r--r--Master/texmf-dist/doc/latex/papermas/papermas-example.pdfbin83512 -> 86457 bytes
-rw-r--r--Master/texmf-dist/doc/latex/papermas/papermas-example.tex152
-rw-r--r--Master/texmf-dist/doc/latex/papermas/papermas.pdfbin339530 -> 353390 bytes
-rw-r--r--Master/texmf-dist/source/latex/papermas/papermas.drv54
-rw-r--r--Master/texmf-dist/source/latex/papermas/papermas.dtx1154
-rw-r--r--Master/texmf-dist/source/latex/papermas/papermas.ins72
-rw-r--r--Master/texmf-dist/tex/latex/papermas/papermas.sty384
8 files changed, 826 insertions, 1113 deletions
diff --git a/Master/texmf-dist/doc/latex/papermas/README b/Master/texmf-dist/doc/latex/papermas/README
index b82ecc3f072..be7d632115a 100644
--- a/Master/texmf-dist/doc/latex/papermas/README
+++ b/Master/texmf-dist/doc/latex/papermas/README
@@ -1,4 +1,4 @@
-README for papermas package, 2011/08/22, v1.0h
+README for papermas package, 2023-04-12, v1.1a
TABLE OF CONTENTS
@@ -17,36 +17,38 @@ TABLE OF CONTENTS
1 INTRODUCTION
==============
-This package allows to compute the mass of a printed version of a
-document, useful e.g. when sending it by mail to determine the postage.
+This LaTeX package allows to compute the mass of a printed version of a
+document, useful e.g. to determine the postage when sending it by snail mail.
Warning/Disclaimer: The mass of (printer's) ink has to be added and that
of envelope, address sticker, stamps,... Thus this is only an estimation
without guarantee - do not sue me, if you have got to pay excess postage!
-This material is subject to the LaTeX Project Public License
-(LPPL). See http://www.ctan.org/tex-archive/help/Catalogue/
-licenses.lppl.html for the details of that license.
+
+This material is published under the LPPL 1.3c: This work may be
+distributed and/or modified under the conditions of the LaTeX Project
+Public License, either version 1.3c of this license or (at your option)
+any later version. This version of this license is in
+https://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+https://www.latex-project.org/lppl.txt
+and version 1.3c or later is part of all distributions of
+LaTeX version 2005-12-01 or later.
2 DOWNLOAD
==========
-`papermas' is available on CTAN:
- CTAN:macros/latex/contrib/papermas/
-
-Also a ZIP file is provided that contains the files, already
-sorted in a TDS tree:
- CTAN:install/macros/latex/contrib/papermas.tds.zip
-
-`CTAN:' means one of the `Comprehensive TeX Archive Network'
-nodes or one of its mirrors. This is explained in
- http://www.tex.ac.uk/cgi-bin/texfaq2html?label=archives
+"papermas" is available on CTAN:
+https://ctan.org/pkg/papermas
-The CTAN stuff will be mirrored automatically from the
-ftp server, so
- ftp://ftp.tug.org/pub/tex/papermas/
-corresponds to
- CTAN:macros/latex/contrib/papermas/
+Also a ZIP file is provided that contains the files:
+the manual (papermas.pdf), the example (papermas-example.tex),
+the compiled example (papermas-example.pdf),
+driver (papermas.drv), papermas.dtx,
+installation file (papermas.ins),
+the style file (papermas.sty),
+and this README, already sorted in a TDS tree:
+https://mirror.ctan.org/install/macros/latex/contrib/papermas.tds.zip
3 INSTALLATION
@@ -54,10 +56,11 @@ corresponds to
Installation with ZIP file in TDS format
----------------------------------------
-The ZIP file `papermas.tds.zip' contains the files sorted
-in a TDS tree. Thus you can directly unpack the ZIP file
-inside a TDS tree.
-(See CTAN:tds.zip for an explanation of TDS.)
+The ZIP file "papermas.tds.zip" contains the files
+sorted in a TDS tree. Thus you can directly unpack the
+ZIP file inside a TDS tree.
+See https://ctan.org/TDS-guidelines for an explanation
+of TDS.
Example:
cd /...somewhere.../texmf
unzip /...downloadpath.../papermas.tds.zip
@@ -68,33 +71,38 @@ Example:
Manual installation
-------------------
-a) Download the papermas files from CTAN or the TUG server.
+a) Download the papermas files from CTAN.
If necessary, unpack them.
b) Generate the package and driver files:
- tex papermas.ins
-c) Install the file `*.sty' in your TDS tree:
- cp *.sty TDS:tex/latex/papermas/
- Replace `TDS:' by the prefix of your TDS tree
+ tex papermas.dtx
+c) Install the file "papermas.sty" in your TDS tree:
+ cp papermas.sty TDS:tex/latex/papermas/
+ Replace "TDS:" by the prefix of your TDS tree
(texmf directory).
-d) Copy the documentation files to
+d) Create the documentation, if necessary, e.g.
+ pdflatex papermas.dtx
+ makeindex -s gind.ist papermas.idx
+ pdflatex papermas.dtx
+ makeindex -s gind.ist papermas.idx
+ pdflatex papermas.dtx
+e) Update the databases if necessary, e.g. for TeXLive
+ texhash or mktexlsr.
+f) Create the papermas-example.pdf, if necessary, e.g.
+ pdflatex papermas-example.tex
+ pdflatex papermas-example.tex
+ pdflatex papermas-example.tex
+g) Copy the documentation files to
"TDS:doc/latex/papermas/":
README, papermas.pdf, papermas-example.tex,
papermas-example.pdf.
-e) Update the databases if necessary, e.g. for teTeX:
- mktexlsr .../texmf
4 ADDITIONAL PACKAGES
=====================
-Depending on the driver and option settings, papermas loads
-other packages:
-* kvoptions.sty:
- CTAN:macros/latex/contrib/oberdiek/kvoptions.dtx
-* intcalc.sty:
- CTAN:macros/latex/contrib/oberdiek/intcalc.dtx
-* pageslts.sty:
- CTAN:macros/latex/contrib/pageslts/pageslts.dtx
+papermas loads other packages:
+- kvoptions
+- intcalc
which again load other packages
(see the result of the \listfiles command in the log-file
of the example).
@@ -103,30 +111,30 @@ which again load other packages
5 PACKAGE COMPATIBILITY
=======================
-papermas should be loaded AFTER package pageslts.
+papermas should be loaded quite late.
6 AUTHOR/MAINTAINER
-=====================
+===================
-* H.-Martin Münch
+H.-Martin Münch
7 BUG REPORTS
-==============
+=============
A bug report should contain:
* Comprehensive problem description. This includes error or
warning messages.
- * \errorcontextlines=\maxdimen can be added in the
- TeX code to get more information in TeX error messages.
-* Minimal test file that shows the problem, but does not
- contain any unnecessary packages and code.
+* \errorcontextlines=\maxdimen can be added in the
+ TeX code to get more information in TeX error messages.
+* Minimal test file that shows the problem,
+ but does not contain any unnecessary packages and code.
* Used drivers/programs.
* Version information about used packages and programs.
- * If you are using LaTeX, then add "\listfiles". Then
- a list of version information is printed at the end
- of the LaTeX run.
+* If you are using LaTeX, then add "\listfiles" to the document.
+ Then a list of version information is printed at the end
+ of the LaTeX run.
* Please no other files than the minimal test file.
The other files .log, .dvi, .ps, .pdf are seldom
necessary, so send them only on request.
@@ -135,14 +143,13 @@ A bug report should contain:
Bug address
-----------
Bug reports can be send to the maintainer:
- H.-Martin Münch
+ H.-Martin Münch
<Martin [dot] Muench [at] Uni-Bonn [dot] de>
8 KNOWN PROBLEMS
-=================
+================
-TeX 2011/06/27 has changed \enddocument and
-thus broken the \AtVeryVeryEnd command/hooking
-of atveryend package as of 2011/04/23, v1.7.
-Until it is fixed, \AtEndAfterFileList is used.
+Needs TeX-Format LaTeX2e 2022-11-01 or newer;
+for older formats an older papermas package version is available at
+https://web.archive.org/web/20190417084752/https://mirror.ctan.org/install/macros/latex/contrib/papermas.tds.zip \ No newline at end of file
diff --git a/Master/texmf-dist/doc/latex/papermas/papermas-example.pdf b/Master/texmf-dist/doc/latex/papermas/papermas-example.pdf
index 43c91f26f02..3ac4f6326fd 100644
--- a/Master/texmf-dist/doc/latex/papermas/papermas-example.pdf
+++ b/Master/texmf-dist/doc/latex/papermas/papermas-example.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/papermas/papermas-example.tex b/Master/texmf-dist/doc/latex/papermas/papermas-example.tex
index 612aba05c46..7a7aa4bf1f5 100644
--- a/Master/texmf-dist/doc/latex/papermas/papermas-example.tex
+++ b/Master/texmf-dist/doc/latex/papermas/papermas-example.tex
@@ -9,146 +9,84 @@
%% This is a generated file.
%%
%% Project: papermas
-%% Version: 2011/08/22 v1.0h
+%% Version: 2023-04-12 v1.1a
+%% Info: Computes paper mass of a printout
%%
-%% Copyright (C) 2010, 2011 by
-%% H.-Martin M"unch <Martin dot Muench at Uni-Bonn dot de>
-%%
-%% The usual disclaimer applys:
-%% If it doesn't work right that's your problem.
-%% (Nevertheless, send an e-mail to the maintainer
-%% when you find an error in this package.)
+%% Copyright (C) 2010 - 2023 by
+%% H.-Martin Muench <Martin dot Muench at Uni-Bonn dot de>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3c of this license or (at your option) any later
%% version. This version of this license is in
-%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% https://www.latex-project.org/lppl/lppl-1-3c.txt
%% and the latest version of this license is in
-%% http://www.latex-project.org/lppl.txt
+%% https://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of
-%% LaTeX version 2005/12/01 or later.
+%% LaTeX version 2005-12-01 or later.
%%
%% This work has the LPPL maintenance status "maintained".
%%
%% The Current Maintainer of this work is H.-Martin Muench.
%%
%% This work consists of the main source file papermas.dtx
-%% and the derived files
-%% papermas.sty, papermas.pdf, papermas.ins, papermas.drv,
-%% papermas-example.tex.
+%% the README, and the derived files
+%% papermas.sty, papermas.pdf,
+%% papermas.ins, papermas.drv,
+%% papermas-example.tex, papermas-example.pdf.
+%%
+%% In memoriam
+%% Claudia Simone Barth + 1996-01-30
+%% Tommy Muench + 2014-01-02
+%% Hans-Klaus Muench + 2014-08-24
%%
-\documentclass[british,a4paper]{article}[2007/10/19]% v1.4h
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\usepackage{hyperref}[2011/04/17]% v6.82g
-\hypersetup{%
- extension=pdf,%
- plainpages=false,%
- pdfpagelabels=true,%
- hyperindex=false,%
- pdflang={en},%
- pdftitle={papermas package example},%
- pdfauthor={Hans-Martin Muench},%
- pdfsubject={Example for the papermas package},%
- pdfkeywords={LaTeX, papermas, Hans-Martin Muench},%
- pdfview=Fit,%
- pdfstartview=Fit,%
- pdfpagelayout=SinglePage,%
- bookmarksopen=false%
+\NeedsTeXFormat{LaTeX2e}[2022-11-01]
+\documentclass[british,a4paper]{article}[2022/07/02]% v1.4n Standard LaTeX document class
+\pdfinfo{
+ /Author (H.-Martin Muench)
+ /Title (papermas package example)
+ /Subject (Example for the papermas package)
+ /Keywords (LaTeX;papermas;papermass;paper mass;paper;mass;weight)
}
-\usepackage[pagecontinue=true,alphMult=ab,AlphMulti=AB,fnsymbolmult=true,%
- romanMult=true,RomanMulti=true]{pageslts}[2011/08/08]% v1.2a
-%% These are the default options. %%
-\usepackage[format=4,masss=80,pagespersheet=2,decimalsep={.}]{papermas}
-%% These are the default options. %%
+\usepackage[format=4,masss=80,pagespersheet=2,decimalsep={.}]{papermas}[2023-04-12]
+%% v1.1a Computes paper mass of a printout (HMM)
+%% These are the default options.
+\DeclareMathAlphabet{\mathup}{OT1}{\familydefault}{m}{n}
+\DeclareRobustCommand{\unit}[1]{\ensuremath{\mathord{\thinspace\mathup{#1}}}}
\listfiles
\begin{document}
\pagenumbering{arabic}
-
\section*{Example for papermas}
\markboth{Example for papermas}{Example for papermas}
This example demonstrates the use of package\newline
-\textsf{papermas}, v1.0h as of 2011/08/22 (HMM).\newline
+\textsf{papermas}, v1.1a as of 2023-04-12 (HMM).\newline
The used options were \texttt{format=4} (ISO~A4),
\texttt{masss=80} ($\unit{g}\unit{m}^{-2}$), and\newline
\texttt{pagespersheet=2} (pages per sheet of paper,
i.\,e. either duplex printing or\newline
printing two pages on one side of a sheet of paper with blank back side).\newline
(These are the default options.)\newline
-For more details please see the documentation!\newline
-
+For more details please see the documentation!
\bigskip
-This document consists of
-\lastpageref{LastPages}~(\arabic{pagesLTS.pagenr})~pages.
-When printing $\papermaspagespersheet$~pages on one sheet of
-paper, $\papermassheets$~sheets will be needed. For
-ISO~A~\papermasformat\ paper of $\papermasmasss \unit{g}\unit{m}^{-2}$
-specific mass, the printout will have a mass of about
-$\papermasstotal \unit{g}$.
+This document consists of $\papermassPages$~pages.
+When printing $\papermaspagespersheet$~pages on one sheet of paper,
+$\papermassheets$~sheets will be needed. For ISO~A~\papermasformat{}
+paper of $\papermasmasss \unit{g}\unit{m}^{-2}$ specific mass,
+the printout will have a mass of about $\papermasstotal \unit{g}$.
-\bigskip
-
-\noindent Save per page about $200\unit{ml}$ water,
-$2\unit{g}$ CO$_{2}$ and $2\unit{g}$ wood:\newline
-Therefore please print only if this is really necessary.\newline
-I do NOT think, that it is necessary to print THIS file, really\newline
-(at least not after this page)!
-
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
+\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage
+\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage
+\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage
+\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage
+\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage
+\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage
+\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage
+\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage
+\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage
+\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage
\newpage Last page \thepage.
-
\end{document}
\endinput
%%
diff --git a/Master/texmf-dist/doc/latex/papermas/papermas.pdf b/Master/texmf-dist/doc/latex/papermas/papermas.pdf
index cc3129969f8..812dd83c9b7 100644
--- a/Master/texmf-dist/doc/latex/papermas/papermas.pdf
+++ b/Master/texmf-dist/doc/latex/papermas/papermas.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/papermas/papermas.drv b/Master/texmf-dist/source/latex/papermas/papermas.drv
index 53698f52aca..e532f0c568e 100644
--- a/Master/texmf-dist/source/latex/papermas/papermas.drv
+++ b/Master/texmf-dist/source/latex/papermas/papermas.drv
@@ -9,48 +9,46 @@
%% This is a generated file.
%%
%% Project: papermas
-%% Version: 2011/08/22 v1.0h
+%% Version: 2023-04-12 v1.1a
+%% Info: Computes paper mass of a printout
%%
-%% Copyright (C) 2010, 2011 by
-%% H.-Martin M"unch <Martin dot Muench at Uni-Bonn dot de>
-%%
-%% The usual disclaimer applys:
-%% If it doesn't work right that's your problem.
-%% (Nevertheless, send an e-mail to the maintainer
-%% when you find an error in this package.)
+%% Copyright (C) 2010 - 2023 by
+%% H.-Martin Muench <Martin dot Muench at Uni-Bonn dot de>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3c of this license or (at your option) any later
%% version. This version of this license is in
-%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% https://www.latex-project.org/lppl/lppl-1-3c.txt
%% and the latest version of this license is in
-%% http://www.latex-project.org/lppl.txt
+%% https://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of
-%% LaTeX version 2005/12/01 or later.
+%% LaTeX version 2005-12-01 or later.
%%
%% This work has the LPPL maintenance status "maintained".
%%
%% The Current Maintainer of this work is H.-Martin Muench.
%%
%% This work consists of the main source file papermas.dtx
-%% and the derived files
-%% papermas.sty, papermas.pdf, papermas.ins, papermas.drv,
-%% papermas-example.tex.
+%% the README, and the derived files
+%% papermas.sty, papermas.pdf,
+%% papermas.ins, papermas.drv,
+%% papermas-example.tex, papermas-example.pdf.
+%%
+%% In memoriam
+%% Claudia Simone Barth + 1996-01-30
+%% Tommy Muench + 2014-01-02
+%% Hans-Klaus Muench + 2014-08-24
%%
-\NeedsTeXFormat{LaTeX2e}[2009/09/24]
+\NeedsTeXFormat{LaTeX2e}[2022-11-01]
\ProvidesFile{papermas.drv}%
- [2011/08/22 v1.0h Computes paper mass of a printout (HMM)]%
-\documentclass{ltxdoc}[2007/11/11]% v2.0u
-\usepackage{holtxdoc}[2011/02/04]% v0.21
-%% papermas may work with earlier versions of LaTeX2e and those
-%% class and package, but this was not tested.
-%% Please consider updating your LaTeX, class, and package
-%% to the most recent version (if they are not already the most
-%% recent version).
+ [2023-04-12 v1.1a Computes paper mass of a printout (HMM)]
+\documentclass[landscape]{ltxdoc}[2022/06/22]% v2.1i Standard LaTeX documentation class
+\usepackage{geometry}[2020/01/02]% v5.9 Page Geometry
+\usepackage{holtxdoc}[2019/12/09]% v0.30 Private additional ltxdoc support (HO)
\hypersetup{%
- pdfsubject={Computeing paper mass of a printout (HMM)},%
- pdfkeywords={LaTeX, papermas, papermass, paper mass, paper, mass, weight, totpages, pageslts, Hans-Martin Muench},%
+ pdfsubject={Computing paper mass of a printout (HMM)},%
+ pdfkeywords={LaTeX, papermas, papermass, paper mass, paper, mass, weight},%
pdfencoding=auto,%
pdflang={en},%
breaklinks=true,%
@@ -65,10 +63,10 @@
pdfwindowui=true,%
pdfnewwindow=true%
}
-
\CodelineIndex
-\hyphenation{created document docu-menta-tion every-thing ignored}
-\gdef\unit#1{\mathord{\thinspace\mathrm{#1}}}%
+\DeclareMathAlphabet{\mathup}{OT1}{\familydefault}{m}{n}
+\DeclareRobustCommand{\unit}[1]{\ensuremath{\mathord{\thinspace\mathup{#1}}}}
+\hyphenation{docu-ment}
\begin{document}
\DocInput{papermas.dtx}%
\end{document}
diff --git a/Master/texmf-dist/source/latex/papermas/papermas.dtx b/Master/texmf-dist/source/latex/papermas/papermas.dtx
index 78f15d43a23..73fa6661e51 100644
--- a/Master/texmf-dist/source/latex/papermas/papermas.dtx
+++ b/Master/texmf-dist/source/latex/papermas/papermas.dtx
@@ -1,68 +1,38 @@
% \iffalse meta-comment
%
% File: papermas.dtx
-% Version: 2011/08/22 v1.0h
+% Version: 2023-04-12 v1.1a
+% Info: Computes paper mass of a printout
%
-% Copyright (C) 2010, 2011 by
-% H.-Martin M"unch <Martin dot Muench at Uni-Bonn dot de>
+% Copyright © 2010 - 2023 by
+% H.-Martin Münch <Martin dot Muench at Uni-Bonn dot de>
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
% version 1.3c of this license or (at your option) any later
% version. This version of this license is in
-% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% https://www.latex-project.org/lppl/lppl-1-3c.txt
% and the latest version of this license is in
-% http://www.latex-project.org/lppl.txt
+% https://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions of
-% LaTeX version 2005/12/01 or later.
+% LaTeX version 2005-12-01 or later.
%
% This work has the LPPL maintenance status "maintained".
%
-% The Current Maintainer of this work is H.-Martin Muench.
+% The Current Maintainer of this work is H.-Martin Münch.
%
% This work consists of the main source file papermas.dtx
-% and the derived files
-% papermas.sty, papermas.pdf, papermas.ins, papermas.drv,
-% papermas-example.tex.
-%
-% Distribution:
-% CTAN:macros/latex/contrib/papermas/papermas.dtx
-% CTAN:macros/latex/contrib/papermas/papermas.pdf
-% CTAN:install/macros/latex/contrib/papermas.tds.zip
-%
-% Unpacking:
-% (a) If papermas.ins is present:
-% tex papermas.ins
-% (b) Without papermas.ins:
-% tex papermas.dtx
-% (c) If you insist on using LaTeX
-% latex \let\install=y\input{papermas.dtx}
-% (quote the arguments according to the demands of your shell)
-%
-% Documentation:
-% (a) If papermas.drv is present:
-% (pdf)latex papermas.drv
-% makeindex -s gind.ist papermas.idx
-% (pdf)latex papermas.drv
-% makeindex -s gind.ist papermas.idx
-% (pdf)latex papermas.drv
-% (b) Without papermas.drv:
-% (pdf)latex papermas.dtx
-% makeindex -s gind.ist papermas.idx
-% (pdf)latex papermas.dtx
-% makeindex -s gind.ist papermas.idx
-% (pdf)latex papermas.dtx
-%
-% The class ltxdoc loads the configuration file ltxdoc.cfg
-% if available. Here you can specify further options, e.g.
-% use DIN A4 as paper format:
-% \PassOptionsToClass{a4paper}{article}
-%
-% Installation:
-% TDS:tex/latex/papermas/papermas.sty
-% TDS:doc/latex/papermas/papermas.pdf
-% TDS:doc/latex/papermas/papermas-example.tex
-% TDS:source/latex/papermas/papermas.dtx
+% the README, and the derived files
+% papermas.sty, papermas.pdf,
+% papermas.ins, papermas.drv,
+% papermas-example.tex, papermas-example.pdf.
+%
+% "papermas" is available on CTAN:
+% https://ctan.org/pkg/papermas
+%
+% Also a TDS.ZIP file is provided that contains all the files
+% already sorted in a TDS tree:
+% https://mirror.ctan.org/install/macros/latex/contrib/papermas.tds.zip
%
%<*ignore>
\begingroup
@@ -77,10 +47,10 @@
%</ignore>
%<*install>
\input docstrip.tex
-\Msg{****************************************************************************}
-\Msg{* Installation}
-\Msg{* Package: papermas 2011/08/22 v1.0h Computes paper mass of a printout (HMM)}
-\Msg{****************************************************************************}
+\Msg{*****************************************************************************}
+\Msg{* Installation *}
+\Msg{* Package: papermas 2023-04-12 v1.1a Computes paper mass of a printout (HMM)*}
+\Msg{*****************************************************************************}
\keepsilent
\askforoverwritefalse
@@ -91,34 +61,36 @@
This is a generated file.
Project: papermas
-Version: 2011/08/22 v1.0h
+Version: 2023-04-12 v1.1a
+Info: Computes paper mass of a printout
-Copyright (C) 2010, 2011 by
- H.-Martin M"unch <Martin dot Muench at Uni-Bonn dot de>
-
-The usual disclaimer applys:
-If it doesn't work right that's your problem.
-(Nevertheless, send an e-mail to the maintainer
- when you find an error in this package.)
+Copyright (C) 2010 - 2023 by
+ H.-Martin Muench <Martin dot Muench at Uni-Bonn dot de>
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either
version 1.3c of this license or (at your option) any later
version. This version of this license is in
- http://www.latex-project.org/lppl/lppl-1-3c.txt
+ https://www.latex-project.org/lppl/lppl-1-3c.txt
and the latest version of this license is in
- http://www.latex-project.org/lppl.txt
+ https://www.latex-project.org/lppl.txt
and version 1.3c or later is part of all distributions of
-LaTeX version 2005/12/01 or later.
+LaTeX version 2005-12-01 or later.
This work has the LPPL maintenance status "maintained".
The Current Maintainer of this work is H.-Martin Muench.
This work consists of the main source file papermas.dtx
-and the derived files
- papermas.sty, papermas.pdf, papermas.ins, papermas.drv,
- papermas-example.tex.
+the README, and the derived files
+ papermas.sty, papermas.pdf,
+ papermas.ins, papermas.drv,
+ papermas-example.tex, papermas-example.pdf.
+
+In memoriam
+ Claudia Simone Barth + 1996-01-30
+ Tommy Muench + 2014-01-02
+ Hans-Klaus Muench + 2014-08-24
\endpreamble
\let\MetaPrefix\DoubleperCent
@@ -139,7 +111,7 @@ and the derived files
\Msg{* To finish the installation you have to move the following}
\Msg{* file into a directory searched by TeX:}
\Msg{*}
-\Msg{* papermas.sty}
+\Msg{* papermas.sty}
\Msg{*}
\Msg{* To produce the documentation run the file `papermas.drv'}
\Msg{* through (pdf)LaTeX, e.g.}
@@ -149,7 +121,7 @@ and the derived files
\Msg{* makeindex -s gind.ist papermas.idx}
\Msg{* pdflatex papermas.drv}
\Msg{*}
-\Msg{* At least two runs are necessary e. g. to get the}
+\Msg{* At least two runs are necessary e.g. to get the}
\Msg{* references right!}
\Msg{*}
\Msg{* Happy TeXing!}
@@ -165,27 +137,23 @@ and the derived files
% \section{The documentation driver file}
%
% The next bit of code contains the documentation driver file for
-% \TeX{}, i.\,e., the file that will produce the documentation you
+% \TeX, i.\,e., the file that will produce the documentation you
% are currently reading. It will be extracted from this file by the
-% \texttt{docstrip} programme. That is, run \LaTeX\ on \texttt{docstrip}
+% \texttt{docstrip} programme. That is, run \LaTeX{} on \texttt{docstrip}
% and specify the \texttt{driver} option when \texttt{docstrip}
% asks for options.
%
% \begin{macrocode}
%<*driver>
-\NeedsTeXFormat{LaTeX2e}[2009/09/24]
+\NeedsTeXFormat{LaTeX2e}[2022-11-01]
\ProvidesFile{papermas.drv}%
- [2011/08/22 v1.0h Computes paper mass of a printout (HMM)]%
-\documentclass{ltxdoc}[2007/11/11]% v2.0u
-\usepackage{holtxdoc}[2011/02/04]% v0.21
-%% papermas may work with earlier versions of LaTeX2e and those
-%% class and package, but this was not tested.
-%% Please consider updating your LaTeX, class, and package
-%% to the most recent version (if they are not already the most
-%% recent version).
+ [2023-04-12 v1.1a Computes paper mass of a printout (HMM)]
+\documentclass[landscape]{ltxdoc}[2022/06/22]% v2.1i Standard LaTeX documentation class
+\usepackage{geometry}[2020/01/02]% v5.9 Page Geometry
+\usepackage{holtxdoc}[2019/12/09]% v0.30 Private additional ltxdoc support (HO)
\hypersetup{%
- pdfsubject={Computeing paper mass of a printout (HMM)},%
- pdfkeywords={LaTeX, papermas, papermass, paper mass, paper, mass, weight, totpages, pageslts, Hans-Martin Muench},%
+ pdfsubject={Computing paper mass of a printout (HMM)},%
+ pdfkeywords={LaTeX, papermas, papermass, paper mass, paper, mass, weight},%
pdfencoding=auto,%
pdflang={en},%
breaklinks=true,%
@@ -200,36 +168,17 @@ and the derived files
pdfwindowui=true,%
pdfnewwindow=true%
}
-
\CodelineIndex
-\hyphenation{created document docu-menta-tion every-thing ignored}
-\gdef\unit#1{\mathord{\thinspace\mathrm{#1}}}%
+\DeclareMathAlphabet{\mathup}{OT1}{\familydefault}{m}{n}
+\DeclareRobustCommand{\unit}[1]{\ensuremath{\mathord{\thinspace\mathup{#1}}}}
+\hyphenation{docu-ment}
\begin{document}
\DocInput{papermas.dtx}%
\end{document}
%</driver>
% \end{macrocode}
-%
% \fi
%
-% \CheckSum{377}
-%
-% \CharacterTable
-% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
-% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
-% Digits \0\1\2\3\4\5\6\7\8\9
-% Exclamation \! Double quote \" Hash (number) \#
-% Dollar \$ Percent \% Ampersand \&
-% Acute accent \' Left paren \( Right paren \)
-% Asterisk \* Plus \+ Comma \,
-% Minus \- Point \. Solidus \/
-% Colon \: Semicolon \; Less than \<
-% Equals \= Greater than \> Question mark \?
-% Commercial at \@ Left bracket \[ Backslash \\
-% Right bracket \] Circumflex \^ Underscore \_
-% Grave accent \` Left brace \{ Vertical bar \|
-% Right brace \} Tilde \~}
-%
% \GetFileInfo{papermas.drv}
%
% \begingroup
@@ -246,68 +195,51 @@ and the derived files
% \edef\x{\noexpand\DoNotIndex{\@backslashchar9}}%^^A
% }%^^A
% \expandafter\endgroup\x
-% \DoNotIndex{\,,\\}
-% \DoNotIndex{\documentclass,\usepackage,\ProvidesPackage,\begin,\end}
-% \DoNotIndex{\NeedsTeXFormat,\DoNotIndex,\verb}
-% \DoNotIndex{\def,\edef,\gdef,\global}
-% \DoNotIndex{\ifx,\kvoptions,\listfiles,\mathord,\mathrm,\ProcessKeyvalOptions}
-% \DoNotIndex{\SetupKeyvalOptions}
-% \DoNotIndex{\bigskip,\space,\thinspace,\Large,\linebreak,\MessageBreak}
-% \DoNotIndex{\ldots,\indent,\noindent,\newline,\pagebreak,\pagenumbering}
-% \DoNotIndex{\textbf,\textit,\textsf,\texttt,\textquotedblleft,\textquotedblright}
-% \DoNotIndex{\plainTeX,\TeX,\LaTeX,\pdfLaTeX}
-% \DoNotIndex{\chapter,\section}
-% \DoNotIndex{\arabic,\newpage,\thepage,\value}
+% \DoNotIndex{\,,\@abspage@last,\@auxout,\@bsphack,\@esphack,\@ifundefined,\addtocounter,\AddToHook,\arabic,\begin,\end}
+% \DoNotIndex{\bigskip,\DeclareMathAlphabet,\DeclareRobustCommand,\DeclareStringOption,\divide,\documentclass,\ensuremath}
+% \DoNotIndex{\familydefault,\format,\gdef,\if@filesw,\ifnum,\ifx,\immediate,\intcalcDiv,\intcalcPow,\listfiles,\m@ne}
+% \DoNotIndex{\markboth,\mathord,\mathup,\maxdimen,\message,\MessageBreak,\multiply,\NeedsTeXFormat,\newcounter,\newline}
+% \DoNotIndex{\newpage,\number,\PackageError,\PackageWarningNoLine,\pagenumbering,\papermas@decimalsep,\papermas@format}
+% \DoNotIndex{\papermas@log,\papermas@masss,\papermas@mbs,\papermas@pagespersheet,\papermas@powerof,\papermas@rerun}
+% \DoNotIndex{\papermas@space,\papermas@spaces,\papermas@totmass,\papermas@undefined,\papermassEmpty,\papermassETest}
+% \DoNotIndex{\papermassmd,\papermastmpformat,\papermastmpmasss,\papermastmppagespersheet,\papermastmpr,\papermastmps}
+% \DoNotIndex{\papermastmpt,\pdfinfo,\ProcessKeyvalOptions,\ProvidesPackage,\RequirePackage,\section,\setcounter}
+% \DoNotIndex{\SetupKeyvalOptions,\space,\textbf,\textsf,\texttt,\the,\thepage,\thinspace,\usepackage,\value,\write,\z@}
%
% \title{The \xpackage{papermas} package}
-% \date{2011/08/22 v1.0h}
-% \author{H.-Martin M\"{u}nch\\\xemail{Martin.Muench at Uni-Bonn.de}}
+% \date{2023-04-12 v1.1a}
+% \author{H.-Martin Münch\\\xemail{Martin.Muench at Uni-Bonn.de}}
%
% \maketitle
%
% \begin{abstract}
-% This \LaTeX\ package allows to compute the number of sheets of paper needed
+% \noindent This \LaTeX{} package allows to compute the number of sheets of paper needed
% to print a document as well as the mass of that printed version of the document,
-% useful e.\,g. when sending it by mail to determine the postage.\\
-% (The number of pages of a document can be determined with the
-% \xpackage{pageslts} package.)
+% useful e.\,g. to determine the postage when sending it by snail mail.
% \end{abstract}
%
% \bigskip
%
% \noindent Disclaimer for web links: The author is not responsible for any contents
-% referred to in this work unless he has full knowledge of illegal contents.
-% If any damage occurs by the use of information presented there, only the
-% author of the respective pages might be liable, not the one who has referred
-% to these pages.
+% referred to in this work unless having full knowledge of illegal contents.
+% If any damage occurs by the use of information presented there,
+% only the author of the respective pages might be liable,
+% not the one who has referred to those pages.
%
-% \bigskip
-%
-% \noindent {\color{green} Save per page about $200\unit{ml}$ water,
-% $2\unit{g}$ CO$_{2}$ and $2\unit{g}$ wood:\\
-% Therefore please print only if this is really necessary.}
-%
-% \newpage
%
% \tableofcontents
%
-% \pagebreak
-%
% \section{Introduction}
-% \indent This package is kind of an add-on to the \xpackage{pageslts} package,
-% but because that already uses some resources and computing the
-% number of sheets of paper or the paper mass probably is not
-% needed so often, this was made into a separate package.\\
-% \indent It allows to compute the number of sheets of paper needed to print a document
-% (useful when the paper is running out)
+% \indent This \LaTeX{} package allows to compute the number of sheets of paper
+% needed to print a document (useful when the paper is running out)
% as well as the mass of that printed version of the document,
-% useful e.\,g. when sending it by mail to determine the postage.\\
+% useful e.\,g. to determine the postage when sending it by snail mail.\\
% \indent \textbf{Warning/Disclaimer}: The mass of (printer's) ink has to be added
% and that of envelope, address sticker, stamps,\ldots\space
% Thus this is only an estimation without guarantee --
% do not sue me, if you have got to pay excess postage!\\
% \indent The name \xpackage{papermas} is short for paper mass but written with only one \textsf{s},
-% because some software has problems with names with more than eight letters.\\
+% because historically some software had problems with names with more than eight letters.\\
% It is \textsf{mass} and gives a result in grammes $\left[ \unit{g}\right]$,
% because the weight $F=m\cdot g$ (really $\overrightarrow{F}=m\cdot \overrightarrow{g}$)
% $\left[ \unit{N}\right]$ would require the knowledge of the gravitational acceleration
@@ -315,24 +247,17 @@ and the derived files
% and give a result in \textsc{Newton}, which probably is not very useful.
%
% \section{Usage}
-%
% \indent Just load the package placing
% \begin{quote}
% |\usepackage[<|\textit{options}|>]{papermas}|
% \end{quote}
-% \noindent in the preamble of your \LaTeXe\ source file
-% (preferably after calling the \xpackage{pageslts} package).\\
-% Because the \xpackage{pageslts} package is used to get the total
-% number of pages, please place a |\pagenumbering{...}| with
-% appropriate argument (e.\,g.~arabic, roman, Roman, fnsymbol,
-% alph, or Alph) right behind |\begin{document}| (see
-% documentation of \xpackage{pageslts} package).\\
+% \noindent in the preamble of your \LaTeXe{} source file.\\
% Now you can say
% \begin{verbatim}
-% This document consists of $\arabic{pagesLTS.pagenr}$~pages.
+% This document consists of $\papermassPages$~pages.
% When printing $\papermaspagespersheet$~pages on one sheet of
% paper, $\papermassheets$~sheets will be needed. For
-% ISO~A~\papermasformat\ paper of $\papermasmasss \unit{g}\unit{m}^{-2}$
+% ISO~A~\papermasformat{} paper of $\papermasmasss \unit{g}/\!\unit{m}^{2}$
% specific mass, the printout will have a mass of about
% $\papermasstotal \unit{g}$.
% \end{verbatim}
@@ -341,40 +266,33 @@ and the derived files
% This document consists of $101$~pages.
% When printing $4$~pages on one sheet of
% paper, $26$~sheets will be needed. For
-% ISO~A~4 paper of $80\unit{g}\unit{m}^{-2}$
+% ISO~A~4 paper of $80\unit{g}/\!\unit{m}^{2}$
% specific mass, the printout will have a mass of about
% $130\unit{g}$.
% \end{quote}
-% This information is also presented at the screen while compiling
-% your document (look for \xpackage{papermas}), in the \xfile{log}
-% file (search for \textsf{***~Paper~mass~***}), and can be found
-% in the \xfile{aux} file~-- probably one does not want to have the
-% information in the printed document.\\
-% One could use the \xpackage{(x)color} package and
-% \begin{verbatim}
-% {\color{white} This document ... of about $\papermasstotal \unit{g}$.}
-% \end{verbatim}
-% which does not show in the printed document (white background of the page
-% assumed), but can be made visible on the screen be marking that text.
+% This information is also presented at the screen while compiling your document
+% (look for \xpackage{papermas}),\newline
+% in the \xfile{log} file (search for \hbox{\textsf{***~Paper~mass~***}),}
+% and can be found near the end of the \xfile{aux} file.
%
% \subsection{Options}
% \DescribeMacro{options}
% \indent The \xpackage{papermas} package takes the following options:
%
-% \subsubsection{format\label{sss:format}}
+% \subsubsection{format}
% \DescribeMacro{format}
-% \indent The option \texttt{format} wants to know the ISO~A\ldots format
-% of the paper used for printing, i.\,e. |format=4| means ISO~A4
+% \indent The option \texttt{format} wants to know the \hbox{ISO~A\ldots}
+% format of the paper used for printing, i.\,e. |format=4| means ISO~A4
% paper format (which is also the default).
%
-% \subsubsection{masss\label{sss:mass}}
+% \subsubsection{masss}
% \DescribeMacro{masss}
-% \indent The option \texttt{masss} wants to know the specific (therefore
-% the third~\texttt{s}) mass of the paper used for printing
-% in $\unit{g}/\unit{m}^{2}$. The default is |masss=80|,
-% i.\,e. $80\unit{g}/\unit{m}^{2}$.
+% \indent The option \texttt{masss} wants to know the specific
+% (therefore the third~\texttt{s}) mass of the paper used for printing
+% in $\unit{g}/\!\unit{m}^{2}$. The default is |masss=80|,
+% i.\,e. $80\unit{g}/\!\unit{m}^{2}$.
%
-% \subsubsection{pagespersheet\label{sss:pagespersheet}}
+% \subsubsection{pagespersheet}
% \DescribeMacro{pagespersheet}
% \indent The option \texttt{pagespersheet} wants to know, how many
% pages are to be printed on one sheet of paper.
@@ -384,7 +302,7 @@ and the derived files
% differs from the one chosen for printing, the result will be wrong,
% of course.
%
-% \subsubsection{decimalsep\label{sss:decimalsep}}
+% \subsubsection{decimalsep}
% \DescribeMacro{decimalsep}
% \indent The option \texttt{decimalsep} wants to know,
% what should be used for the decimal separator. In English this is
@@ -398,166 +316,80 @@ and the derived files
% |decimalsep={,\,}| would cause trouble there.
%
% \section{Alternatives\label{sec:Alternatives}}
-%
-% For determining the number of pages (not sheets of paper)
-% instead of the \xpackage{pageslts} package the alternatives listed
-% in the description of that package could be used, but then
-% the according code in this package would need to be changed
-% (and also e.\,g. the |ifcounter| command used here).\\
% With the \xpackage{totpages} package optionally the number of
-% sheets of paper needed to print the document can be computed, too.\\
-% (See \xpackage{pageslts} documentation.)\\
+% sheets of paper needed to print the document can be computed,
+% but not the mass; \url{https://ctan.org/pkg/totpages}.
%
% \bigskip
%
-% \noindent (You programmed or found another alternative,
-% which is available at \CTAN{}?\\
-% OK, send an e-mail to me with the name, location at \CTAN{},
-% and a short notice, and I will probably include it in
-% the list above.)\\
-%
-% \smallskip
-%
-% \noindent About how to get those packages, please see subsection~\ref{ss:Downloads}.
-%
-% \newpage
+% \noindent You programmed or found another alternative,
+% which is available at \url{https://www.CTAN.org/}?
+% OK, send an e-mail to me with the name, location at CTAN,
+% and a short notice, and I will probably include it in the list above.
%
% \section{Example}
-%
% \begin{macrocode}
%<*example>
-\documentclass[british,a4paper]{article}[2007/10/19]% v1.4h
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\usepackage{hyperref}[2011/04/17]% v6.82g
-\hypersetup{%
- extension=pdf,%
- plainpages=false,%
- pdfpagelabels=true,%
- hyperindex=false,%
- pdflang={en},%
- pdftitle={papermas package example},%
- pdfauthor={Hans-Martin Muench},%
- pdfsubject={Example for the papermas package},%
- pdfkeywords={LaTeX, papermas, Hans-Martin Muench},%
- pdfview=Fit,%
- pdfstartview=Fit,%
- pdfpagelayout=SinglePage,%
- bookmarksopen=false%
+\NeedsTeXFormat{LaTeX2e}[2022-11-01]
+\documentclass[british,a4paper]{article}[2022/07/02]% v1.4n Standard LaTeX document class
+\pdfinfo{
+ /Author (H.-Martin Muench)
+ /Title (papermas package example)
+ /Subject (Example for the papermas package)
+ /Keywords (LaTeX;papermas;papermass;paper mass;paper;mass;weight)
}
-\usepackage[pagecontinue=true,alphMult=ab,AlphMulti=AB,fnsymbolmult=true,%
- romanMult=true,RomanMulti=true]{pageslts}[2011/08/08]% v1.2a
-%% These are the default options. %%
-\usepackage[format=4,masss=80,pagespersheet=2,decimalsep={.}]{papermas}
-%% These are the default options. %%
+\usepackage[format=4,masss=80,pagespersheet=2,decimalsep={.}]{papermas}[2023-04-12]
+%% v1.1a Computes paper mass of a printout (HMM)
+%% These are the default options.
+\DeclareMathAlphabet{\mathup}{OT1}{\familydefault}{m}{n}
+\DeclareRobustCommand{\unit}[1]{\ensuremath{\mathord{\thinspace\mathup{#1}}}}
\listfiles
\begin{document}
\pagenumbering{arabic}
-
\section*{Example for papermas}
\markboth{Example for papermas}{Example for papermas}
This example demonstrates the use of package\newline
-\textsf{papermas}, v1.0h as of 2011/08/22 (HMM).\newline
+\textsf{papermas}, v1.1a as of 2023-04-12 (HMM).\newline
The used options were \texttt{format=4} (ISO~A4),
\texttt{masss=80} ($\unit{g}\unit{m}^{-2}$), and\newline
\texttt{pagespersheet=2} (pages per sheet of paper,
i.\,e. either duplex printing or\newline
printing two pages on one side of a sheet of paper with blank back side).\newline
(These are the default options.)\newline
-For more details please see the documentation!\newline
-
-\bigskip
-
-This document consists of
-\lastpageref{LastPages}~(\arabic{pagesLTS.pagenr})~pages.
-When printing $\papermaspagespersheet$~pages on one sheet of
-paper, $\papermassheets$~sheets will be needed. For
-ISO~A~\papermasformat\ paper of $\papermasmasss \unit{g}\unit{m}^{-2}$
-specific mass, the printout will have a mass of about
-$\papermasstotal \unit{g}$.
-
+For more details please see the documentation!
\bigskip
-\noindent Save per page about $200\unit{ml}$ water,
-$2\unit{g}$ CO$_{2}$ and $2\unit{g}$ wood:\newline
-Therefore please print only if this is really necessary.\newline
-I do NOT think, that it is necessary to print THIS file, really\newline
-(at least not after this page)!
+This document consists of $\papermassPages$~pages.
+When printing $\papermaspagespersheet$~pages on one sheet of paper,
+$\papermassheets$~sheets will be needed. For ISO~A~\papermasformat{}
+paper of $\papermasmasss \unit{g}\unit{m}^{-2}$ specific mass,
+the printout will have a mass of about $\papermasstotal \unit{g}$.
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
-\newpage Page \thepage
+\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage
+\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage
+\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage
+\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage
+\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage
+\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage
+\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage
+\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage
+\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage
+\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage\newpage Page \thepage
\newpage Last page \thepage.
-
\end{document}
%</example>
% \end{macrocode}
-%
-% \newpage
-%
% \StopEventually{}
%
% \section{The implementation}
-%
-% We start off by checking that we are loading into \LaTeXe\ and
-% announcing the name and version of this package.
-%
+% We start off by checking that we are loading into \LaTeXe{} and announcing the name and version of this package.
% \begin{macrocode}
%<*package>
% \end{macrocode}
-%
% \begin{macrocode}
-\NeedsTeXFormat{LaTeX2e}[2009/09/24]
-\ProvidesPackage{papermas}[2011/08/22 v1.0h
- Computes paper mass of a printout (HMM)]
+\NeedsTeXFormat{LaTeX2e}[2022-11-01]
+\ProvidesPackage{papermas}[2023-04-12 v1.1a Computes paper mass of a printout (HMM)]
% \end{macrocode}
%
@@ -567,7 +399,7 @@ I do NOT think, that it is necessary to print THIS file, really\newline
%% Allows to compute the number of sheets of paper
%% needed to print a document as well as the
%% mass of that printed version of the document,
-%% useful e. g. when sending it by mail to determine the postage.
+%% useful e.g. to determine the postage when sending it by snail mail.
%% Warning/Disclaimer: Mass of (printer's) ink has to be added
%% and that of envelope, address sticker, stamps,...!
%% So, this is only an estimation without guarantee -
@@ -575,28 +407,30 @@ I do NOT think, that it is necessary to print THIS file, really\newline
% \end{macrocode}
%
-% For the handling of the options we need the \xpackage{kvoptions}
-% package of \textsc{Heiko Oberdiek} (see subsection~\ref{ss:Downloads}):
-%
-% \begin{macrocode}
-\RequirePackage{kvoptions}[2010/12/23]% v3.10
-% \end{macrocode}
-%
-% For the total number of pages we need the \xpackage{pageslts}
-% package of myself (see subsection~\ref{ss:Downloads}):
+% |\NeedsTeXFormat{LaTeX2e}[2022-11-01]| was demanded. Check for it:
%
% \begin{macrocode}
-\RequirePackage{pageslts}[2011/08/08]% v1.2a
-\RequirePackage{intcalc}[2007/09/27]% v1.1; for intcalcPow
+\providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion}
+
+\IfFormatAtLeastTF{2022/11/01}{\relax}{%
+ \PackageError{papermas}{%
+ Newer LaTeX format needed or older papermas package%
+ }{Needed LaTeX format version: 2022-11-01 or newer.\MessageBreak%
+ Found\space\space LaTeX format version: \fmtversion.\MessageBreak%
+ Either update your TeX distribution\MessageBreak%
+ or use an archived version of papermas\MessageBreak%
+ (see section History in the documentation).\MessageBreak%
+ }
+ }
+
% \end{macrocode}
%
-% A last information for the user:
+% For the handling of the options we need the \xpackage{kvoptions} package
+% and for |\intcalcPow| the \xpackage{intcalc} package:
%
% \begin{macrocode}
-%% papermas may work with earlier versions of LaTeX and those
-%% packages, but this was not tested. Please consider updating
-%% your LaTeX and packages to the most recent version
-%% (if they are not already the most recent version).
+\RequirePackage{kvoptions}[2022-06-15]% v3.15 Key value format for package options (HO)
+\RequirePackage{intcalc}[2019/12/15]% v1.3 Expandable calculations with integers (HO)
% \end{macrocode}
% See subsection~\ref{ss:Downloads} about how to get them.\\
@@ -605,41 +439,33 @@ I do NOT think, that it is necessary to print THIS file, really\newline
%
% \begin{macrocode}
\SetupKeyvalOptions{family = papermas,prefix = papermas@}
-\DeclareStringOption[4]{format}[4]% paper foormat, ISO A...,
-%% default: (ISO A) 4
-\DeclareStringOption[80]{masss}[80]% specific mass of the paper,
-%% default: 80 (g/(m^2))
-\DeclareStringOption[2]{pagespersheet}[2]% number of pages per sheet,
-%% for duplex printing this is 2.
+\DeclareStringOption[4]{format}[4]% paper format, ISO A..., default: (ISO A) 4
+\DeclareStringOption[80]{masss}[80]% specific mass of the paper, default: 80 (g/(m^2))
+\DeclareStringOption[2]{pagespersheet}[2]% number of pages per sheet, for duplex printing this is 2.
\DeclareStringOption[.]{decimalsep}[.]% decimal separator,
-%% e. g. "." or ",": decimalsep={,} - brackets are needed!!!
-%% decimalsep={,\,} does not work for screen, aux, log output!
+%% e.g. "." or ",": decimalsep={,} - brackets are needed!!!
+%% decimalsep={,\,} does not work for screen, aux, log output!
\ProcessKeyvalOptions*
% \end{macrocode}
%
-% \begin{macro}{unit}
-% We define a |\unit| command:
+% We pre-define some commands as (still) undefined:
%
% \begin{macrocode}
-\gdef\unit#1{\mathord{\thinspace\mathrm{#1}}}%
-
+\def\papermas@undefined{\textbf{??}}
% \end{macrocode}
-% \end{macro}
-%
-% \pagebreak
%
-% Even if diverse commands are not defined yet, we do not want~a\\
-% \LaTeX \texttt{\ Error:~\ldots\ undefined}.
+% |\papermas@undefined| will also be needed later!
%
% \begin{macrocode}
-\@ifundefined{papermasstotal}{\gdef\papermasstotal{\textbf{??}}}{}
-\@ifundefined{papermasstotal}{\gdef\papermasstotal{\textbf{??}}}{}
-\@ifundefined{papermasformat}{\gdef\papermasformat{\textbf{??}}}{}
-\@ifundefined{papermasmasss}{\gdef\papermasmasss{\textbf{??}}}{}
-\@ifundefined{papermaspagespersheet}{\gdef\papermaspagespersheet{\textbf{??}}}{}
-\@ifundefined{papermassheets}{\gdef\papermassheets{\textbf{??}}}{}
+\let\papermassPages\papermas@undefined
+\let\papermasstotal\papermas@undefined
+\let\papermasformat\papermas@undefined
+\let\papermasmasss\papermas@undefined
+\let\papermaspagespersheet\papermas@undefined
+\let\papermassheets\papermas@undefined
+\let\papermas@rerun\z@
% \end{macrocode}
%
@@ -648,9 +474,9 @@ I do NOT think, that it is necessary to print THIS file, really\newline
% of the printed document.
%
% \begin{macrocode}
-\newcommand\papermas@totmass{%
+\DeclareRobustCommand\papermas@totmass{%
\newcounter{papermasA}% paper mass for ISO A...
- \setcounter{papermasA}{\papermas@format}% e. g. 4
+ \setcounter{papermasA}{\papermas@format}% e.g. 4
% \end{macrocode}
%
% We check whether |papermasA| has a resonable value:
@@ -663,7 +489,7 @@ I do NOT think, that it is necessary to print THIS file, really\newline
because this should be the paper format\MessageBreak%
ISO A 0, 1, 2, 3,...\MessageBreak%
Found instead: \papermas@format \MessageBreak%
- }
+ }%
\else%
% \end{macrocode}
%
@@ -672,17 +498,17 @@ I do NOT think, that it is necessary to print THIS file, really\newline
% |masss|, i.\,e. |\papermas@masss|.
%
% \begin{macrocode}
- \newcounter{papermasmasss}% always 0
- \setcounter{papermasmasss}{\papermas@masss}% default: 80
+ \newcounter{papermasmasss}%
+ \setcounter{papermasmasss}{\papermas@masss}% default 80
% \end{macrocode}
%
% Counters are integers, but the amount of the mass of a single sheet
% of paper in most cases is not an integer, therefore we multiply with
% 100 to get two digits behind the decimal separator.\\
-% (Later we need to devide by 100 again, of course.)
+% (Later we need to divide by 100 again, of course.)
%
% \begin{macrocode}
- \multiply \value{papermasmasss} 100 % default: 8000
+ \multiply \value{papermasmasss} 100 % default 8000
% \end{macrocode}
%
% We check whether |papermasmasss| has a resonable value, i.\,e. $> 0$:
@@ -694,39 +520,40 @@ I do NOT think, that it is necessary to print THIS file, really\newline
only takes positive numbers,\MessageBreak%
because this should be the mass per square meter\MessageBreak%
of a single sheet of your paper.\MessageBreak%
- Found instead: \papermas@masss \MessageBreak%
- }
- \else
+ Found instead: \papermas@masss\MessageBreak%
+ }%
+ \else%
% \end{macrocode}
%
-% |masss| has a resonable value, and therefore also
-% |\papermas@masss| and |papermasmasss|.\\
-%
+% |masss| has a resonable value, and therefore also |\papermas@masss| and |papermasmasss|.\par
% We check whether option |pagespersheet| has a resonable value, i.\,e. $\geq 1$:
%
% \begin{macrocode}
- \newcounter{papermasPPS}% is 0
+ \newcounter{papermasPPS}%
\setcounter{papermasPPS}{\papermas@pagespersheet}% default 2
- \ifnum \value{papermasPPS} < 1%
- \PackageError{papermas}{%
- The number of pages per sheet must be positive.}{%
+ \ifnum \value{papermasPPS}<1%
+ \PackageError{papermas}{The number of pages per sheet must be positive.}{%
You cannot print less than one TeX page per sheet of paper.\MessageBreak%
The value found was \papermas@pagespersheet .\MessageBreak%
- }
- \else
+ }%
+ \else%
% \end{macrocode}
%
-% |pagespersheet| has a resonable value, and therefore also\\
-% |\papermas@pagespersheet| and |papermasTmpA|.\\
-%
-% We introduce a new counter |papermas@sheets| for the number of
-% sheets printed and initialize it with the number of pages
-% as computed by package \xpackage{pageslts},\newline
-% i.\,e. |pagesLTS.pagenr|.
+% |pagespersheet| has a resonable value, and therefore also |\papermas@pagespersheet| and |papermasTmpA|.\par
+% We introduce a new counter |papermas@sheets| for the number of sheets printed.\par
+% |\gdef\@abspage@last{...}| has not happened yet in first run.
%
% \begin{macrocode}
- \newcounter{papermas@sheets}
- \setcounter{papermas@sheets}{\arabic{pagesLTS.pagenr}}%
+ \newcounter{papermas@sheets}%
+ \let\papermassPages\m@ne%
+ \xdef\papermassmd{\number\maxdimen}%
+ \ifnum \@abspage@last=\papermassmd\relax%
+ \setcounter{papermas@sheets}{1}%
+ \gdef\papermas@rerun{1}%
+ \else%
+ \setcounter{papermas@sheets}{\@abspage@last}%
+ \xdef\papermassPages{\@abspage@last}%
+ \fi%
% \end{macrocode}
%
% When more than one page is printed on one sheet of paper,
@@ -744,78 +571,77 @@ I do NOT think, that it is necessary to print THIS file, really\newline
% one sheet of paper to the number of sheets needed.
%
% \begin{macrocode}
- \newcounter{papermas@tmpn}
+ \newcounter{papermas@tmpn}%
\setcounter{papermas@tmpn}{\arabic{papermas@sheets}}%
\multiply \value{papermas@tmpn} \value{papermasPPS}%
- \ifnum \value{papermas@tmpn}=\value{pagesLTS.pagenr}
- \relax
- \else
- \addtocounter{papermas@sheets}{1}%
- \fi
+ \ifnum \value{papermas@tmpn}=\papermassPages%
+ \else \addtocounter{papermas@sheets}{1}%
+ \fi%
% \end{macrocode}
%
% Now we can multiply the specific mass of 100 sheets
% with the number of sheets needed for printing:
%
% \begin{macrocode}
- \multiply \value{papermasmasss} \value{papermas@sheets}
- % default: 8000 (no default for this)
+ \multiply \value{papermasmasss} \value{papermas@sheets}%
+ % default: 8000 (no default for this)
% \end{macrocode}
%
% The result is in $\unit{g}\unit{m}^{-2}$.\\
% A sheet with format ISO A0 has a size of $1\unit{m}^{2}$,\\
% a sheet with format ISO A1 has a size of $1\unit{m}^{2}\cdot 2^{-1}$,\\
-% a sheet with format ISO A2 has a size of $1\unit{m}^{2}\cdot 2^{-2}$,\\
-% \ldots, and\\
+% a sheet with format ISO A2 has a size of $1\unit{m}^{2}\cdot 2^{-2}$, \ldots, and\\
% a sheet with format ISO A\textit{n} has a size of $1\unit{m}^{2}\cdot 2^{-n}$.\\
%
% Therefore we compute $2^{\textrm{\textbackslash value\{papermasA\}}}$
% and divide the specific paper mass by that value:
%
% \begin{macrocode}
- \divide \value{papermasmasss} by \intcalcPow{2}{\value{papermasA}}
- % default: 16000 / 2^(\value{papermasA})
+ \divide \value{papermasmasss} by \intcalcPow{2}{\value{papermasA}}%
+ % default: 16000 / 2^(\value{papermasA})
% \end{macrocode}
%
% We need to get the division by 100 and the digits after the decimal separator right:
%
% \begin{macrocode}
% for the example 297 is used
- \newcounter{papermas@tmpm}
- \setcounter{papermas@tmpm}{\arabic{papermasmasss}}% m:297 n: o: p: q:
- \setcounter{papermas@tmpn}{\arabic{papermasmasss}}% m:291 n:291 o: p: q:
- \divide \value{papermas@tmpn} by 100% m:297 n:2 o: p: q:
- \newcounter{papermas@tmpo}
- \setcounter{papermas@tmpo}{\arabic{papermas@tmpn}}% m:291 n:2 o:2 p: q:
- \multiply \value{papermas@tmpn} 10% m:297 n:20 o:2 p: q:
- \divide \value{papermas@tmpm} by 10% m:29 n:20 o:2 p: q:
- \newcounter{papermas@tmpp}
- \setcounter{papermas@tmpp}{\arabic{papermas@tmpm}}
- \addtocounter{papermas@tmpp}{-\arabic{papermas@tmpn}}%m:29 n:20 o:2 p:9 q:
- % 29 - 20 = 9
- \multiply \value{papermas@tmpm} 10% m:290 n:20 o:2 p:9 q:
- \newcounter{papermas@tmpq}
- \setcounter{papermas@tmpq}{\arabic{papermasmasss}}
- \addtocounter{papermas@tmpq}{-\arabic{papermas@tmpm}}%m:290 n:20 o:2 p:9 q:7
- % 297 - 290 = 7
+ \newcounter{papermas@tmpm}%
+ \setcounter{papermas@tmpm}{\arabic{papermasmasss}}% m:297 n: 0 o:0 p: 0 q:0
+ \setcounter{papermas@tmpn}{\arabic{papermasmasss}}% m:291 n:291 o:0 p: 0 q:0
+ \divide \value{papermas@tmpn} by 100% m:297 n: 2 o:0 p: 0 q:0
+ \newcounter{papermas@tmpo}%
+ \setcounter{papermas@tmpo}{\arabic{papermas@tmpn}}% m:291 n: 2 o:2 p: 0 q:0
+ \multiply \value{papermas@tmpn} 10% m:297 n: 20 o:2 p: 0 q:0
+ \divide \value{papermas@tmpm} by 10% m: 29 n: 20 o:2 p: 0 q:0
+ \newcounter{papermas@tmpp}%
+ \setcounter{papermas@tmpp}{\arabic{papermas@tmpm}}%
+ \addtocounter{papermas@tmpp}{-\arabic{papermas@tmpn}}%m: 29 n: 20 o:2 p: 9 q:0
+ % 29 - 20 = 9
+ \multiply \value{papermas@tmpm} 10% m:290 n: 20 o:2 p: 9 q:0
+ \newcounter{papermas@tmpq}%
+ \setcounter{papermas@tmpq}{\arabic{papermasmasss}}%
+ \addtocounter{papermas@tmpq}{-\arabic{papermas@tmpm}}%m:290 n: 20 o:2 p: 9 q:7
+ % 297 - 290 = 7
% \end{macrocode}
+% \pagebreak
%
% Now rounding mathematically correct, i.\,e. $\geq 0.5$ becomes $1$
-% (and remember a possible amount carried forward!) and $< 0.5$ becomes %0%.
+% (and remember a possible amount carried forward!) and $< 0.5$ becomes~$0$.
%
% \begin{macrocode}
- \ifnum\value{papermas@tmpq}>4
- \addtocounter{papermas@tmpp}{1}% m:290 n:20 o:2 p:10 q:7
- \ifnum\value{papermas@tmpp}>9% m:290 n:20 o:2 p:10 q:7
- \addtocounter{papermas@tmpo}{1}% m:290 n:20 o:3 p:10 q:7
- \setcounter{papermas@tmpp}{0}% m:290 n:20 o:3 p:0 q:7
- \fi
- \fi
+ \ifnum\value{papermas@tmpq}>4%
+ \addtocounter{papermas@tmpp}{1}% m:290 n: 20 o:2 p:10 q:7
+ \ifnum\value{papermas@tmpp}>9% m:290 n: 20 o:2 p:10 q:7
+ \addtocounter{papermas@tmpo}{1}% m:290 n: 20 o:3 p:10 q:7
+ \setcounter{papermas@tmpp}{0}% m:290 n: 20 o:3 p: 0 q:7
+ \fi%
+ \fi%
+ \ifx\papermassPages\m@ne\relax\let\papermassPages\papermas@undefined\fi%
% \end{macrocode}
%
% The result in the example above is $297/100=2.\,97\approx 3.\,0$.
-% We write this into |\papermastmpr| (where |\papermas@decimalsep|) is
-% the decimal separator) and the (other) options' values into
+% We write this into |\papermastmpr| (where |\papermas@decimalsep|)
+% is the decimal separator) and the (other) options' values into
% temporary definitions, as well as the number of sheets:
%
% \begin{macrocode}
@@ -827,42 +653,33 @@ I do NOT think, that it is necessary to print THIS file, really\newline
\edef\papermastmpt{\arabic{papermas@sheets}}%
% \end{macrocode}
%
-% We use the \xpackage{pageslts} package, which already was used
-% to determine the total number of pages, to check for the
-% counter |papermassttl|. If it exists, nothing is done,
+% We check for the counter |papermassttl|. If it exists, nothing is done,
% if it does not exist, it is declared as |\newcounter|
% (and by default set to zero).
%
% \begin{macrocode}
- \pagesLTS@ifcounter{papermassttl}
+ \@ifundefined{c@papermassttl}{\newcounter{papermassttl}}{\relax}%
% \end{macrocode}
%
% If the |papermassttl| counter value already has the value of
% |papermasmasss|, everything is fine.
%
% \begin{macrocode}
- \ifnum\value{papermassttl}=\value{papermasmasss}
- \relax
+ \ifnum\value{papermassttl}=\value{papermasmasss}%
% \end{macrocode}
%
% Otherwise we need another run of \LaTeX.
%
% \begin{macrocode}
- \else
- \AtEndAfterFileList{%
- \PackageWarningNoLine{papermas}{%
- Number of pages may have changed.\MessageBreak%
- Rerun to get it right%
- }%
- }%
- \fi
+ \else\gdef\papermas@rerun{1}%
+ \fi%
% \end{macrocode}
%
% In any case, we set the counter |papermassttl| to the
% current value of |papermasmasss|.
%
% \begin{macrocode}
- \setcounter{papermassttl}{\arabic{papermasmasss}}
+ \setcounter{papermassttl}{\arabic{papermasmasss}}%
% \end{macrocode}
%
% Because we want to write out into the \xfile{aux}-file,
@@ -872,80 +689,66 @@ I do NOT think, that it is necessary to print THIS file, really\newline
\edef\papermastmps{\arabic{papermasmasss}}%
% \end{macrocode}
%
-% If we are allowed to write into the \xfile{aux}-file,
-% we do it here. If we are not allowed to do it,
-% the \xpackage{pageslts} package already gave an according
-% error message.
+% If we are allowed to write into the \xfile{aux}-file, we do it here. If we are not allowed to do it,
+% we give an error message.
%
% \begin{macrocode}
\if@filesw%
% \end{macrocode}
%
-% When it is read from the \xfile{aux}-file and
-% when its content is processed, the counter |papermassttl|
-% might not have been defined yet. Therefore we again use the
-% |\pagesLTS@ifcounter| command of the \xpackage{pageslts} package.
+% When it is read from the \xfile{aux}-file and when its content is processed, the counter |papermassttl|
+% might not have been defined yet, in which case we define it.
%
% \begin{macrocode}
- \immediate\write\@auxout{\string
- \pagesLTS@ifcounter{papermassttl}}%
+ \immediate\write\@auxout{\string\@ifundefined{c@papermassttl}{\string\newcounter{papermassttl}}{\string\relax}}%
% \end{macrocode}
%
-% We set the counter |papermassttl| to the value |\papermastmps|,\\
-% i.\,e. |\arabic{papermasmasss}|. In the next compilation run,
-% it will be checked,\\
-% whether |\value{papermassttl}=\value{papermasmasss}| (see above).\\
-% If this is the case, everything is OK, no changes happened,
-% and no rerun is necessary (at least not for \xpackage{papermas}).
+% We set the counter |papermassttl| to the value |\papermastmps|, i.\,e. |\arabic{papermasmasss}|.
+% In the next compilation run it will be checked, whether |\value{papermassttl}=\value{papermasmasss}| (see above).\\
+% If this is the case, everything is OK, no changes happened, and no rerun is necessary
+% (at least not for \xpackage{papermas}).
%
% \begin{macrocode}
- \immediate\write\@auxout{\string
- \setcounter{papermassttl}{\papermastmps}}%
+ \immediate\write\@auxout{\string\setcounter{papermassttl}{\papermastmps}}%
% \end{macrocode}
%
-% What we do need, is to get the determined |\papermastmpr| to
-% the user.\\
-% Therefore
-%
+% What we do need, is to get the determined |\papermastmpr| to the user. Therefore
% \begin{enumerate}
-% \item we define |\papermasstotal| in the \xfile{aux}-file,
-% where the user can look it up
+% \item we define |\papermasstotal| in the \xfile{aux}-file, where the user can look it up
%
% \item we define |\papermasstotal|, so the user can e.\,g. write\\
% \begin{verbatim}
-% This document consists of $\arabic{pagesLTS.pagenr}$~pages.
+% This document consists of $\papermassPages$~pages.
% When printing $\papermaspagespersheet$~pages on one sheet of
% paper, $\papermassheets$~sheets will be needed. For
-% ISO~A~\papermasformat\ paper of $\papermasmasss\unit{g}\unit{m}^{-2}$
+% ISO~A~\papermasformat{} paper of $\papermasmasss \unit{g}/\!\unit{m}^{2}$
% specific mass, the printout will have a mass of about
-% $\papermasstotal\unit{g}$.
+% $\papermasstotal \unit{g}$.
% \end{verbatim}
%
% \begin{macrocode}
- \immediate\write\@auxout{\string
- \gdef\string\papermasstotal{\papermastmpr}}%
- \immediate\write\@auxout{\string
- \gdef\string\papermasformat{\papermastmpformat}}%
- \immediate\write\@auxout{\string
- \gdef\string\papermasmasss{\papermastmpmasss}}%
- \immediate\write\@auxout{\string
- \gdef\string\papermaspagespersheet{\papermastmppagespersheet}}%
+ \immediate\write\@auxout{\string\gdef\string\papermassPages{\papermassPages}}%
+ \immediate\write\@auxout{\string\gdef\string\papermasstotal{\papermastmpr}}%
+ \immediate\write\@auxout{\string\gdef\string\papermasformat{\papermastmpformat}}%
+ \immediate\write\@auxout{\string\gdef\string\papermasmasss{\papermastmpmasss}}%
+ \immediate\write\@auxout{\string\gdef\string\papermaspagespersheet{\papermastmppagespersheet}}%
% \end{macrocode}
%
-% \item we give at the screen the information about the |\papermasstotal|\\
-% (see |\AtEndAfterFileList| below)
+% \item we give at the screen the information about the |\papermasstotal|
%
% \item which will also appear in the \xfile{log}-file.
%\end{enumerate}
%
-% \pagebreak
-%
% We want to give also |\papermastmpt = \arabic{papermas@sheets}| to the user,
-% i.\,e.~the number of sheets needed to print the document.
-% Therefore we follow the same procedure:
+% i.\,e.~the number of sheets needed to print the document. Therefore we follow the same procedure:
% \begin{macrocode}
- \immediate\write\@auxout{\string
- \gdef\string\papermassheets{\papermastmpt}}%
+ \immediate\write\@auxout{\string\gdef\string\papermassheets{\papermastmpt}}%
+ \else\PackageError{papermas}{No writing to auxiliary file allowed}{%
+ It was not allowed to write to an .aux file.\MessageBreak%
+ This package does not work without access to an .aux file.\MessageBreak%
+ But it is OK if the .aux file was already updated by previouse compiler runs\MessageBreak%
+ and would not have changed anyway. In that case just press Enter or Return\MessageBreak%
+ to continue the compilation.}%
\fi%
\fi%
\fi%
@@ -955,260 +758,232 @@ I do NOT think, that it is necessary to print THIS file, really\newline
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\AtBeginDocument}
-% \indent |\AtBeginDocument| it is checked whether some commands,
-% which are/will be defined via the \xfile{aux}-file, are undefined yet.
-% If this is the case, |\AtEndAfterFileList| a rerun warning is given.
+% For pretty printing the message of \xpackage{papermas} three internal commands are needed, needing another counter:
%
% \begin{macrocode}
-\AtBeginDocument{%
- \gdef\papermas@undefined{\textbf{??}}
- \gdef\papermas@rerun{0}
- \ifx\papermasstotal\papermas@undefined \gdef\papermas@rerun{1} \fi
- \ifx\papermasformat\papermas@undefined \gdef\papermas@rerun{1} \fi
- \ifx\papermasmasss\papermas@undefined \gdef\papermas@rerun{1} \fi
- \ifx\papermaspagespersheet\papermas@undefined \gdef\papermas@rerun{1} \fi
- \ifx\papermassheets\papermas@undefined \gdef\papermas@rerun{1} \fi
- \ifx\papermas@rerun\pagesLTS@one
- \AtEndAfterFileList{
- \PackageWarningNoLine{papermas}{%
- Variable(s) still undefined!\MessageBreak%
- Rerun to get the variable(s) right%
- }
- }
- \fi
- }
-
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\AfterLastShipout}
-% What we did not do yet, is to really \textit{call} the command
-% |\papermas@totmass|.\linebreak
-% We do this |\AfterLastShipout|, because we need the total number of pages,
-% and asking for them at the end of the document might save another
-% compilation run.
-%
-% \begin{macrocode}
-\AfterLastShipout{%
- \papermas@totmass%
- }%
+\newcounter{papermassSpace}
% \end{macrocode}
-%
-% |\AfterLastShipout| is a command from the \xpackage{atveryend}
-% package of \textsc{Heiko Oberdiek}, which is already loaded by the
-% \xpackage{pageslts} package (about how to get the \xpackage{atveryend}
-% package, please see the documentation of the \xpackage{pageslts}
-% package -- you may need to get further packages for
-% \xpackage{pageslts} anyway, if they have not been installed
-% within your \LaTeX\ system).
-%
-% \end{macro}
-%
-% \pagebreak
-%
-% For pretty printing the message of \xpackage{papermas} three internal
-% commands are needed. We borrow the |pagesLTS.pnc.0| counter from the
-% \xpackage{pageslts} package instead of defining another new one.
-%
+% \begin{macro}{\papermas@log}
% \begin{macrocode}
-\newcommand{\papermas@log}[1]{%
+\DeclareRobustCommand{\papermas@log}[1]{%
\ifnum#1>9%
- \addtocounter{pagesLTS.pnc.0}{1}%
+ \addtocounter{papermassSpace}{1}%
\papermas@log{\intcalcDiv{#1}{10}}%
\fi%
}
-\newcommand{\papermas@spaces}[2]{%
- \edef\papermas@remember{\arabic{pagesLTS.pnc.0}}%
- \setcounter{pagesLTS.pnc.0}{1}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\papermas@spaces}
+% \begin{macrocode}
+\DeclareRobustCommand{\papermas@spaces}[2]{%
+ \setcounter{papermassSpace}{1}%
\papermas@log{#1}%
- \addtocounter{pagesLTS.pnc.0}{-#2}%
- \multiply \value{pagesLTS.pnc.0} -1%
- \papermas@space{\arabic{pagesLTS.pnc.0}}%
+ \addtocounter{papermassSpace}{-#2}%
+ \multiply\value{papermassSpace} -1%
+ \papermas@space{\arabic{papermassSpace}}%
\message{*^^J}%
- \setcounter{pagesLTS.pnc.0}{\papermas@remember}%
}
-\newcommand{\papermas@space}[1]{%
- \ifnum \value{pagesLTS.pnc.0}>0%
- \message{}%
- \fi%
- \setcounter{pagesLTS.pnc.0}{#1}%
- \addtocounter{pagesLTS.pnc.0}{-1}%
- \ifnum \value{pagesLTS.pnc.0}>0%
- \papermas@space{\arabic{pagesLTS.pnc.0}}%
- \fi%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\papermas@space}
+% \begin{macrocode}
+\DeclareRobustCommand{\papermas@space}[1]{%
+ \ifnum\value{papermassSpace}>0\relax\message{}\fi%
+ \setcounter{papermassSpace}{#1}%
+ \addtocounter{papermassSpace}{-1}%
+ \ifnum\value{papermassSpace}>0\relax\papermas@space{\arabic{papermassSpace}}\fi%
}
% \end{macrocode}
+% \end{macro}
%
-% \begin{macro}{\AtEndAfterFileList}
+% \indent At |begindocument| it is checked whether some commands, which are/will be defined via the
+% \xfile{aux}-file, are undefined yet. If this is the case, at the end a rerun warning is given.
%
% \begin{macrocode}
-\AtEndAfterFileList{%
+\AddToHook{begindocument}{%
+ \@bsphack%
+ \ifx\papermassPages\papermas@undefined \gdef\papermas@rerun{1}\fi%
+ \ifx\papermasstotal\papermas@undefined \gdef\papermas@rerun{1}\fi%
+ \ifx\papermasformat\papermas@undefined \gdef\papermas@rerun{1}\fi%
+ \ifx\papermasmasss\papermas@undefined \gdef\papermas@rerun{1}\fi%
+ \ifx\papermaspagespersheet\papermas@undefined\gdef\papermas@rerun{1}\fi%
+ \ifx\papermassheets\papermas@undefined \gdef\papermas@rerun{1}\fi%
+ \@esphack%
% \end{macrocode}
%
-% \indent |\AtEndAfterFileList{...}| is even later than |\AfterLastShipout|:
-% \begin{quote}
-% \textquotedblleft This code is called right before the final |\cs{@@end}|.\textquotedblright
-% \end{quote}
-% (\xpackage{atveryend} package of \textsc{Heiko Oberdiek}, v1.6 as of 2011/04/15).\\
-%
-% If no necessarity for a rerun was \textit{detected} (Check for other rerun warnings!),
-% the final |\PackageInfo| is given.
+% What we did not do yet, is to really \textit{call} the command |\papermas@totmass|.\newline
+% We do this after the last page, because we need the total number of pages.
%
% \begin{macrocode}
- \ifx\papermas@rerun\pagesLTS@zero%
- \message{^^J}%
- \message{papermas: ******************** Paper mass ********************^^J}%
- \message{papermas: * This document consists of \arabic{pagesLTS.pagenr} pages.}
- \papermas@spaces{\arabic{pagesLTS.pagenr}}{16}%
- \message{papermas: * When printing \papermaspagespersheet\space pages on one sheet of paper,}
- \papermas@spaces{\papermaspagespersheet}{6}%
- \message{papermas: * \papermassheets\space sheets will be needed.}
- \papermas@spaces{\papermassheets}{26}%
- \message{papermas: * For ISO A \papermasformat\space paper of \papermasmasss\space g/m^2 specific mass,}
- \papermas@spaces{\papermasmasss}{7}%
- \message{papermas: * the printout will have a mass of about \papermasstotal\space g.}
- \papermas@spaces{\papermas@mbs}{5}%
- \message{papermas: ****************************************************^^J}
- \message{^^J}
- \fi%
- }
-
+ \AddToHook{enddocument}{%
+ \AddToHook{enddocument/afterlastpage}{%
+ \papermas@totmass%
% \end{macrocode}
-% \end{macro}
%
-% \begin{macro}{\papermas@powerof}
+% After the final execution of the \xfile{aux}-file, everything should be defined.
+% Otherwise a rerun is needed.
+%
+% \begin{macrocode}
+ \AddToHook{enddocument/afteraux}{%
+ \ifx\papermassPages\m@ne\relax\gdef\papermas@rerun{1}%
+ \else\ifx\papermassPages\@abspage@last\else\gdef\papermas@rerun{1}\fi%
+ \fi%
+ \AddToHook{enddocument/info}[kernel/filelist]{%
+% \end{macrocode}
%
-% The command |\papermas@powerof| is \textbf{obsolete}. |\intcalcPow| is used instead.
-% For compatibility reasons we still provide the command (but with other code),
-% and issue an error message.
+% The final |\PackageInfo| is given, either giving values or a rerun warning.
%
% \begin{macrocode}
-\newcommand\papermas@powerof[2]{%
- \PackageError{papermas}{Obsolete command \string\papermas@powerof\space used}{%
- The command \string\papermas@powerof\space has been removed from the papermas package.\MessageBreak%
- Please use e.g. \string\intcalcPow\space from the intcalc package instead.\MessageBreak%
- You can now just type Return to continue, but this error message will be\MessageBreak%
- issued again when using \string\papermas@powerof,\space and the command might be\MessageBreak%
- removed completely from future versions of the papermas package.\MessageBreak%
- }%
- \AtEndAfterFileList{%
- \message{^^J%
- papermas: Please remember to replace the \string\papermas@powerof\space command!^^J^^J%
- }%
- }%
- \pagesLTS@ifcounter{papermas@result}%
- \setcounter{papermas@result}{\intcalcPow{#1}{#2}}%
- }
-
+ \message{^^J}%
+ \message{papermas: ******************** Paper mass ********************^^J}%
+ \ifx\papermas@rerun\z@\relax%
+ \edef\papermassETest{\the\ReadonlyShipoutCounter\thetotalpages\PreviousTotalPages\@abspage@last}%
+ \edef\papermassEmpty{0001}%
+ \ifx\papermassEmpty\papermassETest\relax%
+ \PackageWarningNoLine{papermas}{Your document seems to consists of zero pages.\MessageBreak%
+ When printing no pages, no paper will be needed.\MessageBreak%
+ No paper has no mass.\MessageBreak%
+ Maybe just rerun or fix any mistakes}%
+ \gdef\papermassPages{0}%
+ \gdef\papermaspagespersheet{0}%
+ \gdef\papermasstotal{0}%
+ \else%
+ \ifnum \papermassPages=1\relax\message{papermas: * This document consists of 1 page.}%
+ \papermas@spaces{1}{16}% 16 because page vs. pages
+ \else \message{papermas: * This document consists of \papermassPages\space pages.}%
+ \papermas@spaces{\papermassPages}{15}%
+ \fi%
+ \ifnum \papermaspagespersheet=1\relax \message{papermas: * When printing one page on one sheet of paper,}%
+ \papermas@spaces{100}{6}%
+ \else \message{papermas: * When printing \papermaspagespersheet\space pages on one sheet of paper,}%
+ \papermas@spaces{\papermaspagespersheet}{5}%
+ \fi%
+ \ifnum \papermassheets=1\relax \message{papermas: * one sheet will be needed.}%
+ \papermas@spaces{100}{26}%
+ \else \message{papermas: * \papermassheets\space sheets will be needed.}%
+ \papermas@spaces{\papermassheets}{25}%
+ \fi%
+ \message{papermas: * For ISO A \papermasformat\space paper of \papermasmasss\space g/m^2 specific mass,}%
+ \papermas@spaces{\papermasmasss}{6}%
+ \message{papermas: * the printout will have a mass of about \papermasstotal\space g.}%
+ \papermas@spaces{\papermas@mbs}{4}%
+ \fi%
+ \else \PackageWarningNoLine{papermas}{Variables have changed.\MessageBreak Rerun to get them right}%
+ \fi%
+ \message{papermas: ****************************************************^^J^^J}%
+ }}}}}%
% \end{macrocode}
+%
+% \begin{macro}{\papermas@powerof}
+% The command |\papermas@powerof| is obsolete since \xpackage{papermas} 2011/06/02 v1.0f.
+% As there was ample time to remove it from documents, the replacement has been removed
+% from the package in version 2023-04-12 v1.1a. If you really need to use it, here is the code:
+% \begin{verbatim}
+% \makeatletter%
+% \DeclareRobustCommand\papermas@powerof[2]{%
+% \@ifundefined{c@papermas@result}{\newcounter{papermas@result}}{\relax}%
+% \setcounter{papermas@result}{\intcalcPow{#1}{#2}}}%
+% \makeatother%
+% \end{verbatim}
% \end{macro}
%
% \begin{macrocode}
%</package>
% \end{macrocode}
%
-% \newpage
-%
% \section{Installation}
-%
% \subsection{Downloads\label{ss:Downloads}}
-%
-% Everything is available at \CTAN{}, \url{http://www.ctan.org/tex-archive/},
+% Everything is available at \url{https://ctan.org},
% but may need additional packages themselves.\\
%
% \DescribeMacro{papermas.dtx}
-% For unpacking the |papermas.dtx| file and constructing the documentation it is required:
+% For unpacking the |papermas.dtx| file and constructing the documentation
+% it is required:
% \begin{description}
-% \item[-] \TeX Format \LaTeXe: \url{http://www.CTAN.org/}
+% \item[-] \TeX-format \LaTeXe{} 2022-11-01 or newer: \url{https://www.CTAN.org/}
%
-% \item[-] document class \xpackage{ltxdoc}, 2007/11/11, v2.0u,\\
-% \CTAN{macros/latex/base/ltxdoc.dtx}
+% \item[-] document class \xclass{ltxdoc}, 2022/06/22, v2.1i,
+% \url{https://ctan.org/pkg/ltxdoc}
%
-% \item[-] package \xpackage{holtxdoc}, 2011/02/04, v0.21,\\
-% \CTAN{macros/latex/contrib/oberdiek/holtxdoc.dtx}
+% \item[-] package \xpackage{geometry}, 2020/01/02, v5.9,
+% \url{https://ctan.org/pkg/geometry}
%
-% \item[-] package \xpackage{hypdoc}, 2010/03/26, v1.9,\\
-% \CTAN{macros/latex/contrib/oberdiek/hypdoc.dtx}
+% \item[-] package \xpackage{holtxdoc}, 2019/12/09, v0.30,
+% \url{https://ctan.org/pkg/holtxdoc}
% \end{description}
%
% \DescribeMacro{papermas.sty}
-% The \texttt{papermas.sty} for \LaTeXe\ (i.\,e. all documents using
+% The |papermas.sty| for \LaTeXe{} (i.\,e. each document using
% the \xpackage{papermas} package) requires:
% \begin{description}
-% \item[-] \TeX Format \LaTeXe, \url{http://www.CTAN.org/}
+% \item[-] \TeX{}-format \LaTeXe{} 2022-11-01 or newer, \url{https://www.CTAN.org/}
%
-% \item[-] package \xpackage{intcalc}, 2007/09/27, v1.1,\\
-% \CTAN{macros/latex/contrib/oberdiek/intcalc.dtx}
+% \item[-] package \xpackage{kvoptions}, 2022-06-15, v3.15,
+% \url{https://ctan.org/pkg/kvoptions}
%
-% \item[-] package \xpackage{kvoptions}, 2010/12/23, v3.10,\\
-% \CTAN{macros/latex/contrib/oberdiek/kvoptions.dtx}
+% \item[-] package \xpackage{intcalc}, 2019/12/15, v1.3,
+% \url{https://ctan.org/pkg/intcalc}
%
-% \item[-] package \xpackage{pageslts}, 2011/08/08, v1.2a,\\
-% \CTAN{macros/latex/contrib/pageslts/pageslts.dtx}\\
+% \item[-] package \xpackage{papermas}, 2023-04-12, v1.1a,
+% \url{https://ctan.org/pkg/papermas} (Because you are reading the documentation for the \xpackage{papermas}
+% package, it can be assumed that you already have some version of it~-- is it the current one?)
% \end{description}
%
% \DescribeMacro{papermas-example.tex}
-% The \texttt{papermas-example.tex} requires the same files as all
-% documents using the \xpackage{papermas} package, and additionally:
+% The |papermas-example.tex| requires the same files as all
+% documents using the \xpackage{papermas} package and additionally:
% \begin{description}
-% \item[-] class \xpackage{article}, 2007/10/19, v1.4h, from \xpackage{classes.dtx}:\\
-% \CTAN{macros/latex/base/classes.dtx}
-%
-% \item[-] package \xpackage{papermas}, 2011/08/22, v1.0h,\\
-% \CTAN{macros/latex/contrib/papermas/papermas.dtx}\\
-% (Well, it is the example file for this package, and because you are reading the
-% documentation for the \xpackage{papermas} package, it can be assumed that you already
-% have some version of it -- is it the current one?)
+% \item[-] class \xpackage{article}, 2022/07/02, v1.4n, from \xpackage{classes}: \url{https://ctan.org/pkg/classes}
% \end{description}
%
% \DescribeMacro{totpages}
% As possible alternative in section \ref{sec:Alternatives} there is listed
% \begin{description}
-% \item[-] package \xpackage{totpages}, 2005/09/19, v2.00,\\
-% \CTAN{macros/latex/contrib/totpages/totpages.dtx}
+% \item[-] package \xpackage{totpages}, 2005/09/19, v2.00, \url{https://ctan.org/pkg/totpages}
% \end{description}
%
% \DescribeMacro{Oberdiek}
% \DescribeMacro{holtxdoc}
-% \DescribeMacro{atveryend}
-% \DescribeMacro{intcalc}
% \DescribeMacro{kvoptions}
-% All packages of \textsc{Heiko Oberdiek's} bundle `oberdiek'
-% (especially \xpackage{holtxdoc}, \xpackage{atveryend}, \xpackage{intcalc},
-% and \xpackage{kvoptions})
+% All packages of the `oberdiek' bundle
+% (especially \xpackage{holtxdoc} and \xpackage{kvoptions})
% are also available in a TDS compliant ZIP archive:\\
-% \CTAN{install/macros/latex/contrib/oberdiek.tds.zip}.\\
+% \url{https://mirror.ctan.org/install/macros/latex/contrib/oberdiek.tds.zip}.\\
% It is probably best to download and use this, because the packages in there
% are quite probably both recent and compatible among themselves.\\
%
+% \DescribeMacro{intcalc}
+% The \xpackage{intcalc} is available at \url{https://www.ctan.org/pkg/intcalc}, also as \xfile{tds}:\\
+% \url{https://mirrors.ctan.org/install/macros/latex/contrib/intcalc.tds.zip}.\\
+%
% \DescribeMacro{hyperref}
-% \noindent \xpackage{hyperref} is not included in that bundle and needs to be downloaded
-% separately,\\
-% \url{http://mirror.ctan.org/install/macros/latex/contrib/hyperref.tds.zip}.\\
+% \noindent \xpackage{hyperref} is not included in that bundle and needs to be downloaded separately,\\
+% \url{https://mirror.ctan.org/install/macros/latex/contrib/hyperref.tds.zip}.\\
%
-% \DescribeMacro{M\"{u}nch}
+% \DescribeMacro{Münch}
% A hyperlinked list of my (other) packages can be found at
-% \url{http://www.Uni-Bonn.de/~uzs5pv/LaTeX.html}.\\
+% \url{https://ctan.org/author/muench-hm}.\\
%
% \subsection{Package, unpacking TDS}
-%
-% \paragraph{Package.} This package is available on \CTAN{}:
+% \paragraph{Package.} This package is available on \url{https://www.CTAN.org}.
% \begin{description}
-% \item[\CTAN{macros/latex/contrib/papermas/papermas.dtx}]\hspace*{0.1cm} \\
+% \item[\url{https://mirror.ctan.org/macros/latex/contrib/papermas/papermas.dtx}]\ %
% The source file.
-% \item[\CTAN{macros/latex/contrib/papermas/papermas.pdf}]\hspace*{0.1cm} \\
+% \item[\url{https://mirror.ctan.org/macros/latex/contrib/papermas/papermas.pdf}]\ %
% The documentation.
-% \item[\CTAN{macros/latex/contrib/papermas/papermas-example.pdf}]\hspace*{0.1cm} \\
+% \item[\url{https://mirror.ctan.org/macros/latex/contrib/papermas/papermas-example.pdf}]\ %
% The compiled example file, as it should look like.
-% \item[\CTAN{macros/latex/contrib/papermas/README}]\hspace*{0.1cm} \\
+% \item[\url{https://mirror.ctan.org/macros/latex/contrib/papermas/README}]\ %
% The README file.
-% \item[\CTAN{install/macros/latex/contrib/papermas.tds.zip}]\hspace*{0.1cm} \\
+% \end{description}
+%
+% \noindent There is also a |papermas.tds.zip| available:
+% \begin{description}
+% \item[\url{https://mirror.ctan.org/install/macros/latex/contrib/papermas.tds.zip}]\ %
% Everything in TDS compliant, compiled format.
% \end{description}
% which additionally contains\\
@@ -1216,16 +991,16 @@ I do NOT think, that it is necessary to print THIS file, really\newline
% papermas.ins & The installation file.\\
% papermas.drv & The driver to generate the documentation.\\
% papermas.sty & The \xext{sty}le file.\\
-% papermas-example.tex & The example file.%
+% papermas-example.tex & The example file.
% \end{tabular}
%
% \bigskip
%
-% \noindent For required other packages, see the preceding subsection.
+% \noindent For required other packages please see the preceding subsection.
%
% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting
-% \docstrip\ archive. The files are extracted by running the
-% \xfile{.dtx} through \plainTeX:
+% \docstrip{} archive. The files are extracted by running the
+% \xext{dtx} through \plainTeX{}:
% \begin{quote}
% \verb|tex papermas.dtx|
% \end{quote}
@@ -1310,68 +1085,56 @@ I do NOT think, that it is necessary to print THIS file, really\newline
%
% \subsection{Refresh file name databases}
%
-% If your \TeX~distribution (\teTeX, \mikTeX,\dots) relies on file name
-% databases, you must refresh these. For example, \teTeX\ users run
-% \verb|texhash| or \verb|mktexlsr|.
+% If your \TeX~distribution (\TeX\,Live, \mikTeX, \dots) relies on
+% file name databases, you must refresh these. For example, \TeX\,Live\ users
+% run \verb|texhash| or \verb|mktexlsr|.
%
% \subsection{Some details for the interested}
%
-% \paragraph{Unpacking with \LaTeX.}
+% \paragraph{Unpacking with \LaTeX{}.}
% The \xfile{.dtx} chooses its action depending on the format:
% \begin{description}
-% \item[\plainTeX:] Run \docstrip\ and extract the files.
+% \item[\plainTeX:] Run \docstrip{} and extract the files.
% \item[\LaTeX:] Generate the documentation.
% \end{description}
-% If you insist on using \LaTeX\ for \docstrip\ (really,
-% \docstrip\ does not need \LaTeX), then inform the autodetect routine
+% If you insist on using \LaTeX{} for \docstrip{} (really,
+% \docstrip{} does not need \LaTeX ), then inform the autodetect routine
% about your intention:
% \begin{quote}
% \verb|latex \let\install=y\input{papermas.dtx}|
% \end{quote}
-% Do not forget to quote the argument according to the demands
-% of your shell.
+% Do not forget to quote the argument according to the demands of your shell.
%
% \paragraph{Generating the documentation.\label{GenDoc}}
% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate
% the documentation. The process can be configured by a
-% configuration file \xfile{ltxdoc.cfg}. For instance, put this
-% line into that file, if you want to have A4 as paper format:
+% configuration file \xfile{ltxdoc.cfg}. For instance, put the following
+% line into this file, if you want to have A4 as paper format:
% \begin{quote}
% \verb|\PassOptionsToClass{a4paper}{article}|
% \end{quote}
%
-% \noindent An example follows how to generate the
-% documentation with \pdfLaTeX :
+% \noindent An example follows how to generate the documentation with \pdfLaTeX :
%
% \begin{quote}
%\begin{verbatim}
-%pdflatex papermas.drv
+%pdflatex papermas.dtx
%makeindex -s gind.ist papermas.idx
-%pdflatex papermas.drv
+%pdflatex papermas.dtx
%makeindex -s gind.ist papermas.idx
-%pdflatex papermas.drv
+%pdflatex papermas.dtx
%\end{verbatim}
% \end{quote}
%
% \subsection{Compiling the example}
-%
-% The example file, \textsf{papermas-example.tex}, can be compiled via\\
-% \indent |latex papermas-example.tex|\\
-% or (recommended)\\
-% \indent |pdflatex papermas-example.tex|\\
-% but will need probably three compiler runs to get everything right.
+% The example file, \textsf{papermas-example.tex}, can be compiled via |(pdf)latex papermas-example.tex|
+% and will need at least two compiler runs to get everything right.
%
% \section{Acknowledgements}
%
-% I would like to thank \textsc{Heiko Oberdiek}
-% (heiko dot oberdiek at googlemail dot com) for providing
-% a~lot~(!) of useful packages
-% (from which I also got everything I know about creating a file in
-% \xext{dtx} format, ok, say it: copying),
-% and the \Newsgroup{comp.text.tex} and \Newsgroup{de.comp.text.tex}
-% newsgroups for their help in all things \TeX.
-%
-% \pagebreak
+% I would like to thank \textsc{Heiko Oberdiek} for providing a lot of
+% useful packages (from which I also got everything I know about creating
+% a file in \xext{dtx} format, OK, say it: copying).
%
% \phantomsection
% \begin{History}\label{History}
@@ -1381,62 +1144,67 @@ I do NOT think, that it is necessary to print THIS file, really\newline
% \begin{Version}{2010/06/03 v1.0b}
% \item New |\papermassheets| and reruncheck introduced; several small changes.
% \item Example adapted to other examples of mine.
-% \item Updated references to other packages.
% \item TDS locations updated.
% \item Several changes in the documentation and the Readme file.
% \end{Version}
% \begin{Version}{2010/06/24 v1.0c}
% \item \xpackage{holtxdoc} warning in \xfile{drv} updated.
-% \item Corrected the location of the package at CTAN.\\
+% \item Corrected the location of the package at CTAN.
% (TDS was still missing due to packaging error.)
-% \item Updated references to other packages: \xpackage{hyperref} and \xpackage{pagesLTS}.
-% \item Added a list of my other packages.
% \item Several changes to the documentation.
% \item Introduced new \textbf{option}: |decimalsep|.
% \end{Version}
% \begin{Version}{2010/07/29 v1.0d}
% \item Corrected given url of \texttt{papermas.tds.zip} and other urls.
-% \item There is a new version of the used \xpackage{hyperref} package: 2010/06/18,~v6.81g.
-% \item There is a new version of the used \xpackage{pagesLTS} package: 2010/07/29,~v1.1e.
-% \item Included a |\CheckSum|.
+% \item Included a |\CheckSum| [was leter removed again].
% \end{Version}
% \begin{Version}{2011/02/01 v1.0e}
-% \item Updated to version 2010/12/16 v6.81z of the \xpackage{hyperref} package.
% \item Removed wrong \%\ from the driver file.
% \item Changed the |\unit| definition (got rid of an old |\rm|).
% \item Replaced the list of my packages with a link to a web page list of those,
% which has the advantage of showing the recent versions of all those packages.
% \item Now using |\@ifundefined|.
% \item Removed |/muench/| from the path at diverse locations.
-% \item There is a new version of the used \xpackage{pagesLTS} package: 2011/02/01,~v1.1m.
% \item Some small changes.
% \end{Version}
% \begin{Version}{2011/06/02 v1.0f}
-% \item There is a new version of the used \xpackage{kvoptions} package: 2010/12/23,~v3.10.
-% \item There is a new version of the used \xpackage{pagesLTS} package: 2011/03/17,~v1.1o.
% \item The \xpackage{holtxdoc} package was fixed (recent version: 2011/02/04,~v0.21),
% therefore the warning in \xfile{drv} could be removed.~-- Adapted the style of
% this documentation to new \textsc{Oberdiek} \xfile{dtx} style.
-% \item There is a new version of the used \xpackage{hyperref} package: 2011/04/17,~v6.82g.
% \item The rerun warnings are given after the \texttt{filelist} (if that is called
% with |\listfiles|) and the final \xpackage{papermas} information is presented
-% |\AtVeryVeryEnd| (now only ones instead of twice).
-% \item Replaced |\text| by |\textrm|.
+% |\AtVeryVeryEnd| (now only ones instead of twice)
+% [later replaced by use of the new hook management].
% \item Instead of compiling \textquotedblleft $a$ to the power of $b$\textquotedblright\ itself,
-% \xpackage{papermas} now uses the \xpackage{intcalc} package of \textsc{Heiko Oberdiek}.
+% \xpackage{papermas} now uses the \xpackage{intcalc} package.
% \item Removed five counters.
-% \item A lot of small changes (also in the README).
% \end{Version}
% \begin{Version}{2011/08/08 v1.0g}
% \item The \xpackage{pagesLTS} package has been renamed to \xpackage{pageslts}: 2011/08/08,~v1.2a.
% \item Replaced |\global\edef| by |\xdef|.
-% \item Minor details.
% \end{Version}
% \begin{Version}{2011/08/22 v1.0h}
-% \item Hot fix: \TeX{} 2011/06/27 has changed |\enddocument| and
-% thus broken the |\AtVeryVeryEnd| command/hooking
-% of \xpackage{atveryend} package as of 2011/04/23, v1.7.
-% Until it is fixed, |\AtEndAfterFileList| is used.
+% \item Hot fix: \TeX{} 2011-06-27 changed |\enddocument| and thus broke the |\AtVeryVeryEnd|
+% command/hooking of \xpackage{atveryend} package as of 2011-04-23, v1.7.
+% Until fixed, |\AtEndAfterFileList| was used. [changed back in v1.0i]
+% \item This version was archived at
+% \url{https://web.archive.org/web/20190417084752/https://mirror.ctan.org/install/macros/latex/contrib/papermas.tds.zip}.
+% \end{Version}
+% \begin{Version}{-{}-{}-{}-/-{}-/-{}- v1.0i}
+% \item Made |\newcommand|s robust.
+% \item Moved from |\AtEndAfterFileList| to |\AtVeryVeryEnd| again.
+% [later replaced by use of new hook management]
+% \item By error this version was never released to the public.
+% \end{Version}
+% \begin{Version}{2023-04-12 v1.1a}
+% \item |\NeedsTeXFormat{LaTeX2e}[2022-11-01]|, older package version available from archive
+% (see version 2011/08/22 v1.0h above).
+% \item Using the new hook management and \LaTeX's |\@abspage@last|.
+% \item Package \xpackage{pageslts} is neither needed nor used by the
+% \xpackage{papermas} package any longer.
+% \item Removed |\papermas@powerof| (obsolete since version 2011-06-02~v1.0f).
+% \item Converted to UTF-8.
+% \item A lot of details; extensive documentation updates.
% \end{Version}
% \end{History}
%
diff --git a/Master/texmf-dist/source/latex/papermas/papermas.ins b/Master/texmf-dist/source/latex/papermas/papermas.ins
index 23de29614be..6c264ef0b49 100644
--- a/Master/texmf-dist/source/latex/papermas/papermas.ins
+++ b/Master/texmf-dist/source/latex/papermas/papermas.ins
@@ -9,40 +9,42 @@
%% This is a generated file.
%%
%% Project: papermas
-%% Version: 2011/08/22 v1.0h
+%% Version: 2023-04-12 v1.1a
+%% Info: Computes paper mass of a printout
%%
-%% Copyright (C) 2010, 2011 by
-%% H.-Martin M"unch <Martin dot Muench at Uni-Bonn dot de>
-%%
-%% The usual disclaimer applys:
-%% If it doesn't work right that's your problem.
-%% (Nevertheless, send an e-mail to the maintainer
-%% when you find an error in this package.)
+%% Copyright (C) 2010 - 2023 by
+%% H.-Martin Muench <Martin dot Muench at Uni-Bonn dot de>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3c of this license or (at your option) any later
%% version. This version of this license is in
-%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% https://www.latex-project.org/lppl/lppl-1-3c.txt
%% and the latest version of this license is in
-%% http://www.latex-project.org/lppl.txt
+%% https://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of
-%% LaTeX version 2005/12/01 or later.
+%% LaTeX version 2005-12-01 or later.
%%
%% This work has the LPPL maintenance status "maintained".
%%
%% The Current Maintainer of this work is H.-Martin Muench.
%%
%% This work consists of the main source file papermas.dtx
-%% and the derived files
-%% papermas.sty, papermas.pdf, papermas.ins, papermas.drv,
-%% papermas-example.tex.
+%% the README, and the derived files
+%% papermas.sty, papermas.pdf,
+%% papermas.ins, papermas.drv,
+%% papermas-example.tex, papermas-example.pdf.
+%%
+%% In memoriam
+%% Claudia Simone Barth + 1996-01-30
+%% Tommy Muench + 2014-01-02
+%% Hans-Klaus Muench + 2014-08-24
%%
\input docstrip.tex
-\Msg{****************************************************************************}
-\Msg{* Installation}
-\Msg{* Package: papermas 2011/08/22 v1.0h Computes paper mass of a printout (HMM)}
-\Msg{****************************************************************************}
+\Msg{*****************************************************************************}
+\Msg{* Installation *}
+\Msg{* Package: papermas 2023-04-12 v1.1a Computes paper mass of a printout (HMM)*}
+\Msg{*****************************************************************************}
\keepsilent
\askforoverwritefalse
@@ -53,34 +55,36 @@
This is a generated file.
Project: papermas
-Version: 2011/08/22 v1.0h
+Version: 2023-04-12 v1.1a
+Info: Computes paper mass of a printout
-Copyright (C) 2010, 2011 by
- H.-Martin M"unch <Martin dot Muench at Uni-Bonn dot de>
-
-The usual disclaimer applys:
-If it doesn't work right that's your problem.
-(Nevertheless, send an e-mail to the maintainer
- when you find an error in this package.)
+Copyright (C) 2010 - 2023 by
+ H.-Martin Muench <Martin dot Muench at Uni-Bonn dot de>
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either
version 1.3c of this license or (at your option) any later
version. This version of this license is in
- http://www.latex-project.org/lppl/lppl-1-3c.txt
+ https://www.latex-project.org/lppl/lppl-1-3c.txt
and the latest version of this license is in
- http://www.latex-project.org/lppl.txt
+ https://www.latex-project.org/lppl.txt
and version 1.3c or later is part of all distributions of
-LaTeX version 2005/12/01 or later.
+LaTeX version 2005-12-01 or later.
This work has the LPPL maintenance status "maintained".
The Current Maintainer of this work is H.-Martin Muench.
This work consists of the main source file papermas.dtx
-and the derived files
- papermas.sty, papermas.pdf, papermas.ins, papermas.drv,
- papermas-example.tex.
+the README, and the derived files
+ papermas.sty, papermas.pdf,
+ papermas.ins, papermas.drv,
+ papermas-example.tex, papermas-example.pdf.
+
+In memoriam
+ Claudia Simone Barth + 1996-01-30
+ Tommy Muench + 2014-01-02
+ Hans-Klaus Muench + 2014-08-24
\endpreamble
\let\MetaPrefix\DoubleperCent
@@ -101,7 +105,7 @@ and the derived files
\Msg{* To finish the installation you have to move the following}
\Msg{* file into a directory searched by TeX:}
\Msg{*}
-\Msg{* papermas.sty}
+\Msg{* papermas.sty}
\Msg{*}
\Msg{* To produce the documentation run the file `papermas.drv'}
\Msg{* through (pdf)LaTeX, e.g.}
@@ -111,7 +115,7 @@ and the derived files
\Msg{* makeindex -s gind.ist papermas.idx}
\Msg{* pdflatex papermas.drv}
\Msg{*}
-\Msg{* At least two runs are necessary e. g. to get the}
+\Msg{* At least two runs are necessary e.g. to get the}
\Msg{* references right!}
\Msg{*}
\Msg{* Happy TeXing!}
diff --git a/Master/texmf-dist/tex/latex/papermas/papermas.sty b/Master/texmf-dist/tex/latex/papermas/papermas.sty
index 4b52b2fd111..108d095f821 100644
--- a/Master/texmf-dist/tex/latex/papermas/papermas.sty
+++ b/Master/texmf-dist/tex/latex/papermas/papermas.sty
@@ -9,81 +9,87 @@
%% This is a generated file.
%%
%% Project: papermas
-%% Version: 2011/08/22 v1.0h
+%% Version: 2023-04-12 v1.1a
+%% Info: Computes paper mass of a printout
%%
-%% Copyright (C) 2010, 2011 by
-%% H.-Martin M"unch <Martin dot Muench at Uni-Bonn dot de>
-%%
-%% The usual disclaimer applys:
-%% If it doesn't work right that's your problem.
-%% (Nevertheless, send an e-mail to the maintainer
-%% when you find an error in this package.)
+%% Copyright (C) 2010 - 2023 by
+%% H.-Martin Muench <Martin dot Muench at Uni-Bonn dot de>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3c of this license or (at your option) any later
%% version. This version of this license is in
-%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% https://www.latex-project.org/lppl/lppl-1-3c.txt
%% and the latest version of this license is in
-%% http://www.latex-project.org/lppl.txt
+%% https://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of
-%% LaTeX version 2005/12/01 or later.
+%% LaTeX version 2005-12-01 or later.
%%
%% This work has the LPPL maintenance status "maintained".
%%
%% The Current Maintainer of this work is H.-Martin Muench.
%%
%% This work consists of the main source file papermas.dtx
-%% and the derived files
-%% papermas.sty, papermas.pdf, papermas.ins, papermas.drv,
-%% papermas-example.tex.
+%% the README, and the derived files
+%% papermas.sty, papermas.pdf,
+%% papermas.ins, papermas.drv,
+%% papermas-example.tex, papermas-example.pdf.
+%%
+%% In memoriam
+%% Claudia Simone Barth + 1996-01-30
+%% Tommy Muench + 2014-01-02
+%% Hans-Klaus Muench + 2014-08-24
%%
-\NeedsTeXFormat{LaTeX2e}[2009/09/24]
-\ProvidesPackage{papermas}[2011/08/22 v1.0h
- Computes paper mass of a printout (HMM)]
+\NeedsTeXFormat{LaTeX2e}[2022-11-01]
+\ProvidesPackage{papermas}[2023-04-12 v1.1a Computes paper mass of a printout (HMM)]
%% Allows to compute the number of sheets of paper
%% needed to print a document as well as the
%% mass of that printed version of the document,
-%% useful e. g. when sending it by mail to determine the postage.
+%% useful e.g. to determine the postage when sending it by snail mail.
%% Warning/Disclaimer: Mass of (printer's) ink has to be added
%% and that of envelope, address sticker, stamps,...!
%% So, this is only an estimation without guarantee -
%% do not sue me, if you have got to pay excess postage!
-\RequirePackage{kvoptions}[2010/12/23]% v3.10
-\RequirePackage{pageslts}[2011/08/08]% v1.2a
-\RequirePackage{intcalc}[2007/09/27]% v1.1; for intcalcPow
-%% papermas may work with earlier versions of LaTeX and those
-%% packages, but this was not tested. Please consider updating
-%% your LaTeX and packages to the most recent version
-%% (if they are not already the most recent version).
+\providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion}
+
+\IfFormatAtLeastTF{2022/11/01}{\relax}{%
+ \PackageError{papermas}{%
+ Newer LaTeX format needed or older papermas package%
+ }{Needed LaTeX format version: 2022-11-01 or newer.\MessageBreak%
+ Found\space\space LaTeX format version: \fmtversion.\MessageBreak%
+ Either update your TeX distribution\MessageBreak%
+ or use an archived version of papermas\MessageBreak%
+ (see section History in the documentation).\MessageBreak%
+ }
+ }
+
+\RequirePackage{kvoptions}[2022-06-15]% v3.15 Key value format for package options (HO)
+\RequirePackage{intcalc}[2019/12/15]% v1.3 Expandable calculations with integers (HO)
\SetupKeyvalOptions{family = papermas,prefix = papermas@}
-\DeclareStringOption[4]{format}[4]% paper foormat, ISO A...,
-%% default: (ISO A) 4
-\DeclareStringOption[80]{masss}[80]% specific mass of the paper,
-%% default: 80 (g/(m^2))
-\DeclareStringOption[2]{pagespersheet}[2]% number of pages per sheet,
-%% for duplex printing this is 2.
+\DeclareStringOption[4]{format}[4]% paper format, ISO A..., default: (ISO A) 4
+\DeclareStringOption[80]{masss}[80]% specific mass of the paper, default: 80 (g/(m^2))
+\DeclareStringOption[2]{pagespersheet}[2]% number of pages per sheet, for duplex printing this is 2.
\DeclareStringOption[.]{decimalsep}[.]% decimal separator,
-%% e. g. "." or ",": decimalsep={,} - brackets are needed!!!
-%% decimalsep={,\,} does not work for screen, aux, log output!
+%% e.g. "." or ",": decimalsep={,} - brackets are needed!!!
+%% decimalsep={,\,} does not work for screen, aux, log output!
\ProcessKeyvalOptions*
-\gdef\unit#1{\mathord{\thinspace\mathrm{#1}}}%
-
-\@ifundefined{papermasstotal}{\gdef\papermasstotal{\textbf{??}}}{}
-\@ifundefined{papermasstotal}{\gdef\papermasstotal{\textbf{??}}}{}
-\@ifundefined{papermasformat}{\gdef\papermasformat{\textbf{??}}}{}
-\@ifundefined{papermasmasss}{\gdef\papermasmasss{\textbf{??}}}{}
-\@ifundefined{papermaspagespersheet}{\gdef\papermaspagespersheet{\textbf{??}}}{}
-\@ifundefined{papermassheets}{\gdef\papermassheets{\textbf{??}}}{}
+\def\papermas@undefined{\textbf{??}}
+\let\papermassPages\papermas@undefined
+\let\papermasstotal\papermas@undefined
+\let\papermasformat\papermas@undefined
+\let\papermasmasss\papermas@undefined
+\let\papermaspagespersheet\papermas@undefined
+\let\papermassheets\papermas@undefined
+\let\papermas@rerun\z@
-\newcommand\papermas@totmass{%
+\DeclareRobustCommand\papermas@totmass{%
\newcounter{papermasA}% paper mass for ISO A...
- \setcounter{papermasA}{\papermas@format}% e. g. 4
+ \setcounter{papermasA}{\papermas@format}% e.g. 4
\ifnum \value{papermasA}<0%
\PackageError{papermas}{Option format has no valid value}%
{The format option of the papermas package\MessageBreak%
@@ -91,196 +97,188 @@
because this should be the paper format\MessageBreak%
ISO A 0, 1, 2, 3,...\MessageBreak%
Found instead: \papermas@format \MessageBreak%
- }
+ }%
\else%
- \newcounter{papermasmasss}% always 0
- \setcounter{papermasmasss}{\papermas@masss}% default: 80
- \multiply \value{papermasmasss} 100 % default: 8000
+ \newcounter{papermasmasss}%
+ \setcounter{papermasmasss}{\papermas@masss}% default 80
+ \multiply \value{papermasmasss} 100 % default 8000
\ifnum \value{papermasmasss}<1%
\PackageError{papermas}{Option masss has no valid value}%
{The masss option of the papermas package\MessageBreak%
only takes positive numbers,\MessageBreak%
because this should be the mass per square meter\MessageBreak%
of a single sheet of your paper.\MessageBreak%
- Found instead: \papermas@masss \MessageBreak%
- }
- \else
- \newcounter{papermasPPS}% is 0
+ Found instead: \papermas@masss\MessageBreak%
+ }%
+ \else%
+ \newcounter{papermasPPS}%
\setcounter{papermasPPS}{\papermas@pagespersheet}% default 2
- \ifnum \value{papermasPPS} < 1%
- \PackageError{papermas}{%
- The number of pages per sheet must be positive.}{%
+ \ifnum \value{papermasPPS}<1%
+ \PackageError{papermas}{The number of pages per sheet must be positive.}{%
You cannot print less than one TeX page per sheet of paper.\MessageBreak%
The value found was \papermas@pagespersheet .\MessageBreak%
- }
- \else
- \newcounter{papermas@sheets}
- \setcounter{papermas@sheets}{\arabic{pagesLTS.pagenr}}%
+ }%
+ \else%
+ \newcounter{papermas@sheets}%
+ \let\papermassPages\m@ne%
+ \xdef\papermassmd{\number\maxdimen}%
+ \ifnum \@abspage@last=\papermassmd\relax%
+ \setcounter{papermas@sheets}{1}%
+ \gdef\papermas@rerun{1}%
+ \else%
+ \setcounter{papermas@sheets}{\@abspage@last}%
+ \xdef\papermassPages{\@abspage@last}%
+ \fi%
\divide \value{papermas@sheets} by \value{papermasPPS}%
- \newcounter{papermas@tmpn}
+ \newcounter{papermas@tmpn}%
\setcounter{papermas@tmpn}{\arabic{papermas@sheets}}%
\multiply \value{papermas@tmpn} \value{papermasPPS}%
- \ifnum \value{papermas@tmpn}=\value{pagesLTS.pagenr}
- \relax
- \else
- \addtocounter{papermas@sheets}{1}%
- \fi
- \multiply \value{papermasmasss} \value{papermas@sheets}
- % default: 8000 (no default for this)
- \divide \value{papermasmasss} by \intcalcPow{2}{\value{papermasA}}
- % default: 16000 / 2^(\value{papermasA})
+ \ifnum \value{papermas@tmpn}=\papermassPages%
+ \else \addtocounter{papermas@sheets}{1}%
+ \fi%
+ \multiply \value{papermasmasss} \value{papermas@sheets}%
+ % default: 8000 (no default for this)
+ \divide \value{papermasmasss} by \intcalcPow{2}{\value{papermasA}}%
+ % default: 16000 / 2^(\value{papermasA})
% for the example 297 is used
- \newcounter{papermas@tmpm}
- \setcounter{papermas@tmpm}{\arabic{papermasmasss}}% m:297 n: o: p: q:
- \setcounter{papermas@tmpn}{\arabic{papermasmasss}}% m:291 n:291 o: p: q:
- \divide \value{papermas@tmpn} by 100% m:297 n:2 o: p: q:
- \newcounter{papermas@tmpo}
- \setcounter{papermas@tmpo}{\arabic{papermas@tmpn}}% m:291 n:2 o:2 p: q:
- \multiply \value{papermas@tmpn} 10% m:297 n:20 o:2 p: q:
- \divide \value{papermas@tmpm} by 10% m:29 n:20 o:2 p: q:
- \newcounter{papermas@tmpp}
- \setcounter{papermas@tmpp}{\arabic{papermas@tmpm}}
- \addtocounter{papermas@tmpp}{-\arabic{papermas@tmpn}}%m:29 n:20 o:2 p:9 q:
- % 29 - 20 = 9
- \multiply \value{papermas@tmpm} 10% m:290 n:20 o:2 p:9 q:
- \newcounter{papermas@tmpq}
- \setcounter{papermas@tmpq}{\arabic{papermasmasss}}
- \addtocounter{papermas@tmpq}{-\arabic{papermas@tmpm}}%m:290 n:20 o:2 p:9 q:7
- % 297 - 290 = 7
- \ifnum\value{papermas@tmpq}>4
- \addtocounter{papermas@tmpp}{1}% m:290 n:20 o:2 p:10 q:7
- \ifnum\value{papermas@tmpp}>9% m:290 n:20 o:2 p:10 q:7
- \addtocounter{papermas@tmpo}{1}% m:290 n:20 o:3 p:10 q:7
- \setcounter{papermas@tmpp}{0}% m:290 n:20 o:3 p:0 q:7
- \fi
- \fi
+ \newcounter{papermas@tmpm}%
+ \setcounter{papermas@tmpm}{\arabic{papermasmasss}}% m:297 n: 0 o:0 p: 0 q:0
+ \setcounter{papermas@tmpn}{\arabic{papermasmasss}}% m:291 n:291 o:0 p: 0 q:0
+ \divide \value{papermas@tmpn} by 100% m:297 n: 2 o:0 p: 0 q:0
+ \newcounter{papermas@tmpo}%
+ \setcounter{papermas@tmpo}{\arabic{papermas@tmpn}}% m:291 n: 2 o:2 p: 0 q:0
+ \multiply \value{papermas@tmpn} 10% m:297 n: 20 o:2 p: 0 q:0
+ \divide \value{papermas@tmpm} by 10% m: 29 n: 20 o:2 p: 0 q:0
+ \newcounter{papermas@tmpp}%
+ \setcounter{papermas@tmpp}{\arabic{papermas@tmpm}}%
+ \addtocounter{papermas@tmpp}{-\arabic{papermas@tmpn}}%m: 29 n: 20 o:2 p: 9 q:0
+ % 29 - 20 = 9
+ \multiply \value{papermas@tmpm} 10% m:290 n: 20 o:2 p: 9 q:0
+ \newcounter{papermas@tmpq}%
+ \setcounter{papermas@tmpq}{\arabic{papermasmasss}}%
+ \addtocounter{papermas@tmpq}{-\arabic{papermas@tmpm}}%m:290 n: 20 o:2 p: 9 q:7
+ % 297 - 290 = 7
+ \ifnum\value{papermas@tmpq}>4%
+ \addtocounter{papermas@tmpp}{1}% m:290 n: 20 o:2 p:10 q:7
+ \ifnum\value{papermas@tmpp}>9% m:290 n: 20 o:2 p:10 q:7
+ \addtocounter{papermas@tmpo}{1}% m:290 n: 20 o:3 p:10 q:7
+ \setcounter{papermas@tmpp}{0}% m:290 n: 20 o:3 p: 0 q:7
+ \fi%
+ \fi%
+ \ifx\papermassPages\m@ne\relax\let\papermassPages\papermas@undefined\fi%
\edef\papermastmpr{\arabic{papermas@tmpo}\papermas@decimalsep\arabic{papermas@tmpp}}%
\xdef\papermas@mbs{\arabic{papermas@tmpo}}%
\edef\papermastmpformat{\papermas@format}%
\edef\papermastmpmasss{\papermas@masss}%
\edef\papermastmppagespersheet{\papermas@pagespersheet}%
\edef\papermastmpt{\arabic{papermas@sheets}}%
- \pagesLTS@ifcounter{papermassttl}
- \ifnum\value{papermassttl}=\value{papermasmasss}
- \relax
- \else
- \AtEndAfterFileList{%
- \PackageWarningNoLine{papermas}{%
- Number of pages may have changed.\MessageBreak%
- Rerun to get it right%
- }%
- }%
- \fi
- \setcounter{papermassttl}{\arabic{papermasmasss}}
+ \@ifundefined{c@papermassttl}{\newcounter{papermassttl}}{\relax}%
+ \ifnum\value{papermassttl}=\value{papermasmasss}%
+ \else\gdef\papermas@rerun{1}%
+ \fi%
+ \setcounter{papermassttl}{\arabic{papermasmasss}}%
\edef\papermastmps{\arabic{papermasmasss}}%
\if@filesw%
- \immediate\write\@auxout{\string
- \pagesLTS@ifcounter{papermassttl}}%
- \immediate\write\@auxout{\string
- \setcounter{papermassttl}{\papermastmps}}%
- \immediate\write\@auxout{\string
- \gdef\string\papermasstotal{\papermastmpr}}%
- \immediate\write\@auxout{\string
- \gdef\string\papermasformat{\papermastmpformat}}%
- \immediate\write\@auxout{\string
- \gdef\string\papermasmasss{\papermastmpmasss}}%
- \immediate\write\@auxout{\string
- \gdef\string\papermaspagespersheet{\papermastmppagespersheet}}%
- \immediate\write\@auxout{\string
- \gdef\string\papermassheets{\papermastmpt}}%
+ \immediate\write\@auxout{\string\@ifundefined{c@papermassttl}{\string\newcounter{papermassttl}}{\string\relax}}%
+ \immediate\write\@auxout{\string\setcounter{papermassttl}{\papermastmps}}%
+ \immediate\write\@auxout{\string\gdef\string\papermassPages{\papermassPages}}%
+ \immediate\write\@auxout{\string\gdef\string\papermasstotal{\papermastmpr}}%
+ \immediate\write\@auxout{\string\gdef\string\papermasformat{\papermastmpformat}}%
+ \immediate\write\@auxout{\string\gdef\string\papermasmasss{\papermastmpmasss}}%
+ \immediate\write\@auxout{\string\gdef\string\papermaspagespersheet{\papermastmppagespersheet}}%
+ \immediate\write\@auxout{\string\gdef\string\papermassheets{\papermastmpt}}%
+ \else\PackageError{papermas}{No writing to auxiliary file allowed}{%
+ It was not allowed to write to an .aux file.\MessageBreak%
+ This package does not work without access to an .aux file.\MessageBreak%
+ But it is OK if the .aux file was already updated by previouse compiler runs\MessageBreak%
+ and would not have changed anyway. In that case just press Enter or Return\MessageBreak%
+ to continue the compilation.}%
\fi%
\fi%
\fi%
\fi%
}
-\AtBeginDocument{%
- \gdef\papermas@undefined{\textbf{??}}
- \gdef\papermas@rerun{0}
- \ifx\papermasstotal\papermas@undefined \gdef\papermas@rerun{1} \fi
- \ifx\papermasformat\papermas@undefined \gdef\papermas@rerun{1} \fi
- \ifx\papermasmasss\papermas@undefined \gdef\papermas@rerun{1} \fi
- \ifx\papermaspagespersheet\papermas@undefined \gdef\papermas@rerun{1} \fi
- \ifx\papermassheets\papermas@undefined \gdef\papermas@rerun{1} \fi
- \ifx\papermas@rerun\pagesLTS@one
- \AtEndAfterFileList{
- \PackageWarningNoLine{papermas}{%
- Variable(s) still undefined!\MessageBreak%
- Rerun to get the variable(s) right%
- }
- }
- \fi
- }
-
-\AfterLastShipout{%
- \papermas@totmass%
- }%
+\newcounter{papermassSpace}
-\newcommand{\papermas@log}[1]{%
+\DeclareRobustCommand{\papermas@log}[1]{%
\ifnum#1>9%
- \addtocounter{pagesLTS.pnc.0}{1}%
+ \addtocounter{papermassSpace}{1}%
\papermas@log{\intcalcDiv{#1}{10}}%
\fi%
}
-\newcommand{\papermas@spaces}[2]{%
- \edef\papermas@remember{\arabic{pagesLTS.pnc.0}}%
- \setcounter{pagesLTS.pnc.0}{1}%
+\DeclareRobustCommand{\papermas@spaces}[2]{%
+ \setcounter{papermassSpace}{1}%
\papermas@log{#1}%
- \addtocounter{pagesLTS.pnc.0}{-#2}%
- \multiply \value{pagesLTS.pnc.0} -1%
- \papermas@space{\arabic{pagesLTS.pnc.0}}%
+ \addtocounter{papermassSpace}{-#2}%
+ \multiply\value{papermassSpace} -1%
+ \papermas@space{\arabic{papermassSpace}}%
\message{*^^J}%
- \setcounter{pagesLTS.pnc.0}{\papermas@remember}%
- }
-
-\newcommand{\papermas@space}[1]{%
- \ifnum \value{pagesLTS.pnc.0}>0%
- \message{}%
- \fi%
- \setcounter{pagesLTS.pnc.0}{#1}%
- \addtocounter{pagesLTS.pnc.0}{-1}%
- \ifnum \value{pagesLTS.pnc.0}>0%
- \papermas@space{\arabic{pagesLTS.pnc.0}}%
- \fi%
- }
-
-\AtEndAfterFileList{%
- \ifx\papermas@rerun\pagesLTS@zero%
- \message{^^J}%
- \message{papermas: ******************** Paper mass ********************^^J}%
- \message{papermas: * This document consists of \arabic{pagesLTS.pagenr} pages.}
- \papermas@spaces{\arabic{pagesLTS.pagenr}}{16}%
- \message{papermas: * When printing \papermaspagespersheet\space pages on one sheet of paper,}
- \papermas@spaces{\papermaspagespersheet}{6}%
- \message{papermas: * \papermassheets\space sheets will be needed.}
- \papermas@spaces{\papermassheets}{26}%
- \message{papermas: * For ISO A \papermasformat\space paper of \papermasmasss\space g/m^2 specific mass,}
- \papermas@spaces{\papermasmasss}{7}%
- \message{papermas: * the printout will have a mass of about \papermasstotal\space g.}
- \papermas@spaces{\papermas@mbs}{5}%
- \message{papermas: ****************************************************^^J}
- \message{^^J}
- \fi%
}
-\newcommand\papermas@powerof[2]{%
- \PackageError{papermas}{Obsolete command \string\papermas@powerof\space used}{%
- The command \string\papermas@powerof\space has been removed from the papermas package.\MessageBreak%
- Please use e.g. \string\intcalcPow\space from the intcalc package instead.\MessageBreak%
- You can now just type Return to continue, but this error message will be\MessageBreak%
- issued again when using \string\papermas@powerof,\space and the command might be\MessageBreak%
- removed completely from future versions of the papermas package.\MessageBreak%
- }%
- \AtEndAfterFileList{%
- \message{^^J%
- papermas: Please remember to replace the \string\papermas@powerof\space command!^^J^^J%
- }%
- }%
- \pagesLTS@ifcounter{papermas@result}%
- \setcounter{papermas@result}{\intcalcPow{#1}{#2}}%
+\DeclareRobustCommand{\papermas@space}[1]{%
+ \ifnum\value{papermassSpace}>0\relax\message{}\fi%
+ \setcounter{papermassSpace}{#1}%
+ \addtocounter{papermassSpace}{-1}%
+ \ifnum\value{papermassSpace}>0\relax\papermas@space{\arabic{papermassSpace}}\fi%
}
+\AddToHook{begindocument}{%
+ \@bsphack%
+ \ifx\papermassPages\papermas@undefined \gdef\papermas@rerun{1}\fi%
+ \ifx\papermasstotal\papermas@undefined \gdef\papermas@rerun{1}\fi%
+ \ifx\papermasformat\papermas@undefined \gdef\papermas@rerun{1}\fi%
+ \ifx\papermasmasss\papermas@undefined \gdef\papermas@rerun{1}\fi%
+ \ifx\papermaspagespersheet\papermas@undefined\gdef\papermas@rerun{1}\fi%
+ \ifx\papermassheets\papermas@undefined \gdef\papermas@rerun{1}\fi%
+ \@esphack%
+ \AddToHook{enddocument}{%
+ \AddToHook{enddocument/afterlastpage}{%
+ \papermas@totmass%
+ \AddToHook{enddocument/afteraux}{%
+ \ifx\papermassPages\m@ne\relax\gdef\papermas@rerun{1}%
+ \else\ifx\papermassPages\@abspage@last\else\gdef\papermas@rerun{1}\fi%
+ \fi%
+ \AddToHook{enddocument/info}[kernel/filelist]{%
+ \message{^^J}%
+ \message{papermas: ******************** Paper mass ********************^^J}%
+ \ifx\papermas@rerun\z@\relax%
+ \edef\papermassETest{\the\ReadonlyShipoutCounter\thetotalpages\PreviousTotalPages\@abspage@last}%
+ \edef\papermassEmpty{0001}%
+ \ifx\papermassEmpty\papermassETest\relax%
+ \PackageWarningNoLine{papermas}{Your document seems to consists of zero pages.\MessageBreak%
+ When printing no pages, no paper will be needed.\MessageBreak%
+ No paper has no mass.\MessageBreak%
+ Maybe just rerun or fix any mistakes}%
+ \gdef\papermassPages{0}%
+ \gdef\papermaspagespersheet{0}%
+ \gdef\papermasstotal{0}%
+ \else%
+ \ifnum \papermassPages=1\relax\message{papermas: * This document consists of 1 page.}%
+ \papermas@spaces{1}{16}% 16 because page vs. pages
+ \else \message{papermas: * This document consists of \papermassPages\space pages.}%
+ \papermas@spaces{\papermassPages}{15}%
+ \fi%
+ \ifnum \papermaspagespersheet=1\relax \message{papermas: * When printing one page on one sheet of paper,}%
+ \papermas@spaces{100}{6}%
+ \else \message{papermas: * When printing \papermaspagespersheet\space pages on one sheet of paper,}%
+ \papermas@spaces{\papermaspagespersheet}{5}%
+ \fi%
+ \ifnum \papermassheets=1\relax \message{papermas: * one sheet will be needed.}%
+ \papermas@spaces{100}{26}%
+ \else \message{papermas: * \papermassheets\space sheets will be needed.}%
+ \papermas@spaces{\papermassheets}{25}%
+ \fi%
+ \message{papermas: * For ISO A \papermasformat\space paper of \papermasmasss\space g/m^2 specific mass,}%
+ \papermas@spaces{\papermasmasss}{6}%
+ \message{papermas: * the printout will have a mass of about \papermasstotal\space g.}%
+ \papermas@spaces{\papermas@mbs}{4}%
+ \fi%
+ \else \PackageWarningNoLine{papermas}{Variables have changed.\MessageBreak Rerun to get them right}%
+ \fi%
+ \message{papermas: ****************************************************^^J^^J}%
+ }}}}}%
\endinput
%%
%% End of file `papermas.sty'.