texlive[66835] Master/texmf-dist: papermas (12apr23)

commits+karl at tug.org commits+karl at tug.org
Wed Apr 12 22:06:19 CEST 2023


Revision: 66835
          http://tug.org/svn/texlive?view=revision&revision=66835
Author:   karl
Date:     2023-04-12 22:06:19 +0200 (Wed, 12 Apr 2023)
Log Message:
-----------
papermas (12apr23)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/papermas/README
    trunk/Master/texmf-dist/doc/latex/papermas/papermas-example.pdf
    trunk/Master/texmf-dist/doc/latex/papermas/papermas-example.tex
    trunk/Master/texmf-dist/doc/latex/papermas/papermas.pdf
    trunk/Master/texmf-dist/source/latex/papermas/papermas.drv
    trunk/Master/texmf-dist/source/latex/papermas/papermas.dtx
    trunk/Master/texmf-dist/source/latex/papermas/papermas.ins
    trunk/Master/texmf-dist/tex/latex/papermas/papermas.sty

Modified: trunk/Master/texmf-dist/doc/latex/papermas/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/papermas/README	2023-04-12 20:06:05 UTC (rev 66834)
+++ trunk/Master/texmf-dist/doc/latex/papermas/README	2023-04-12 20:06:19 UTC (rev 66835)
@@ -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,47 +17,50 @@
 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/
+"papermas" is available on CTAN:
+https://ctan.org/pkg/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
+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
 
-`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
 
-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/
-
-
 3 INSTALLATION
 ==============
 
 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 @@
 
 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 @@
 5 PACKAGE COMPATIBILITY
 =======================
 
-papermas should be loaded AFTER package pageslts.
+papermas should be loaded quite late.
 
 
 6 AUTHOR/MAINTAINER
-=====================
+===================
 
-* H.-Martin M\xFCnch
+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 @@
 Bug address
 -----------
 Bug reports can be send to the maintainer:
-  H.-Martin M\xFCnch
+  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

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

Modified: trunk/Master/texmf-dist/doc/latex/papermas/papermas-example.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/papermas/papermas-example.tex	2023-04-12 20:06:05 UTC (rev 66834)
+++ trunk/Master/texmf-dist/doc/latex/papermas/papermas-example.tex	2023-04-12 20:06:19 UTC (rev 66835)
@@ -9,25 +9,21 @@
 %% 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>
+%% Copyright (C) 2010 - 2023 by
+%%     H.-Martin Muench <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.)
-%% 
 %% 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".
 %% 
@@ -34,42 +30,37 @@
 %% 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.
 %% 
-\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%
+%% In memoriam
+%%  Claudia Simone Barth + 1996-01-30
+%%  Tommy Muench         + 2014-01-02
+%%  Hans-Klaus Muench    + 2014-08-24
+%% 
+\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,
@@ -76,79 +67,26 @@
 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
 %%

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

Modified: trunk/Master/texmf-dist/source/latex/papermas/papermas.drv
===================================================================
--- trunk/Master/texmf-dist/source/latex/papermas/papermas.drv	2023-04-12 20:06:05 UTC (rev 66834)
+++ trunk/Master/texmf-dist/source/latex/papermas/papermas.drv	2023-04-12 20:06:19 UTC (rev 66835)
@@ -9,25 +9,21 @@
 %% 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>
+%% Copyright (C) 2010 - 2023 by
+%%     H.-Martin Muench <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.)
-%% 
 %% 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".
 %% 
@@ -34,23 +30,25 @@
 %% 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.
 %% 
-\NeedsTeXFormat{LaTeX2e}[2009/09/24]
+%% In memoriam
+%%  Claudia Simone Barth + 1996-01-30
+%%  Tommy Muench         + 2014-01-02
+%%  Hans-Klaus Muench    + 2014-08-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}

Modified: trunk/Master/texmf-dist/source/latex/papermas/papermas.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/papermas/papermas.dtx	2023-04-12 20:06:05 UTC (rev 66834)
+++ trunk/Master/texmf-dist/source/latex/papermas/papermas.dtx	2023-04-12 20:06:19 UTC (rev 66835)
@@ -1,69 +1,39 @@
 % \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.
+% the README, and the derived files
+%    papermas.sty, papermas.pdf,
+%    papermas.ins, papermas.drv,
+%    papermas-example.tex, papermas-example.pdf.
 %
-% Distribution:
-%    CTAN:macros/latex/contrib/papermas/papermas.dtx
-%    CTAN:macros/latex/contrib/papermas/papermas.pdf
-%    CTAN:install/macros/latex/contrib/papermas.tds.zip
+% "papermas" is available on CTAN:
+% https://ctan.org/pkg/papermas
 %
-% 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)
+% 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
 %
-% 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
-%
 %<*ignore>
 \begingroup
   \catcode123=1 %
@@ -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,25 +61,21 @@
 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>
+Copyright (C) 2010 - 2023 by
+    H.-Martin Muench <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.)
-
 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".
 
@@ -116,10 +82,16 @@
 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 @@
 \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 @@
 \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 @@
 % \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 @@
  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 @@
 %       \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 at last,\@auxout,\@bsphack,\@esphack,\@ifundefined,\addtocounter,\AddToHook,\arabic,\begin,\end}
+% \DoNotIndex{\bigskip,\DeclareMathAlphabet,\DeclareRobustCommand,\DeclareStringOption,\divide,\documentclass,\ensuremath}
+% \DoNotIndex{\familydefault,\format,\gdef,\if at filesw,\ifnum,\ifx,\immediate,\intcalcDiv,\intcalcPow,\listfiles,\m at ne}
+% \DoNotIndex{\markboth,\mathord,\mathup,\maxdimen,\message,\MessageBreak,\multiply,\NeedsTeXFormat,\newcounter,\newline}
+% \DoNotIndex{\newpage,\number,\PackageError,\PackageWarningNoLine,\pagenumbering,\papermas at decimalsep,\papermas at format}
+% \DoNotIndex{\papermas at log,\papermas at masss,\papermas at mbs,\papermas at pagespersheet,\papermas at powerof,\papermas at rerun}
+% \DoNotIndex{\papermas at space,\papermas at spaces,\papermas at totmass,\papermas at 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 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 @@
 % 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 @@
 % 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,66 +316,41 @@
 % |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.)\\
+% \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.
 %
-% \smallskip
-%
-% \noindent About how to get those packages, please see subsection~\ref{ss:Downloads}.
-%
-% \newpage
-%
 % \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,
@@ -464,100 +357,39 @@
 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}
 %</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 @@
 %% 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 @@
 
 %    \end{macrocode}
 %
-% For the handling of the options we need the \xpackage{kvoptions}
-% package of \textsc{Heiko Oberdiek} (see subsection~\ref{ss:Downloads}):
+% |\NeedsTeXFormat{LaTeX2e}[2022-11-01]| was demanded. Check for it:
 %
 %    \begin{macrocode}
-\RequirePackage{kvoptions}[2010/12/23]% v3.10
+\providecommand\IfFormatAtLeastTF{\@ifl at 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}
 %
-% For the total number of pages we need the \xpackage{pageslts}
-% package of myself (see subsection~\ref{ss:Downloads}):
+% For the handling of the options we need the \xpackage{kvoptions} package
+% and for |\intcalcPow| the \xpackage{intcalc} package:
 %
 %    \begin{macrocode}
-\RequirePackage{pageslts}[2011/08/08]% v1.2a
-\RequirePackage{intcalc}[2007/09/27]%  v1.1; for intcalcPow
-%    \end{macrocode}
-%
-% A last information for the user:
-%
-%    \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 @@
 %
 %    \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 at undefined{\textbf{??}}
 %    \end{macrocode}
-% \end{macro}
 %
-% \pagebreak
+% |\papermas at undefined| will also be needed later!
 %
-% Even if diverse commands are not defined yet, we do not want~a\\
-% \LaTeX \texttt{\ Error:~\ldots\ undefined}.
-%
 %    \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 at undefined
+\let\papermasstotal\papermas at undefined
+\let\papermasformat\papermas at undefined
+\let\papermasmasss\papermas at undefined
+\let\papermaspagespersheet\papermas at undefined
+\let\papermassheets\papermas at undefined
+\let\papermas at rerun\z@
 
 %    \end{macrocode}
 %
@@ -648,9 +474,9 @@
 % of the printed document.
 %
 %    \begin{macrocode}
-\newcommand\papermas at totmass{%
+\DeclareRobustCommand\papermas at totmass{%
   \newcounter{papermasA}% paper mass for ISO A...
-  \setcounter{papermasA}{\papermas at format}% e. g. 4
+  \setcounter{papermasA}{\papermas at format}% e.g. 4
 %    \end{macrocode}
 %
 % We check whether |papermasA| has a resonable value:
@@ -663,7 +489,7 @@
       because this should be the paper format\MessageBreak%
       ISO A 0, 1, 2, 3,...\MessageBreak%
       Found instead: \papermas at format \MessageBreak%
-     }
+     }%
   \else%
 %    \end{macrocode}
 %
@@ -672,17 +498,17 @@
 % |masss|, i.\,e. |\papermas at masss|.
 %
 %    \begin{macrocode}
-    \newcounter{papermasmasss}% always 0
-    \setcounter{papermasmasss}{\papermas at masss}% default: 80
+    \newcounter{papermasmasss}%
+    \setcounter{papermasmasss}{\papermas at 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 @@
         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 at masss \MessageBreak%
-       }
-    \else
+        Found instead: \papermas at masss\MessageBreak%
+       }%
+    \else%
 %    \end{macrocode}
 %
-% |masss| has a resonable value, and therefore also
-% |\papermas at masss| and |papermasmasss|.\\
-%
+% |masss| has a resonable value, and therefore also |\papermas at 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 at 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 at pagespersheet .\MessageBreak%
-          }
-      \else
+          }%
+      \else%
 %    \end{macrocode}
 %
-% |pagespersheet| has a resonable value, and therefore also\\
-% |\papermas at pagespersheet| and |papermasTmpA|.\\
+% |pagespersheet| has a resonable value, and therefore also |\papermas at pagespersheet| and |papermasTmpA|.\par
+% We introduce a new counter |papermas at sheets| for the number of sheets printed.\par
+% |\gdef\@abspage at last{...}| has not happened yet in first run.
 %
-% We introduce a new counter |papermas at 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|.
-%
 %    \begin{macrocode}
-        \newcounter{papermas at sheets}
-        \setcounter{papermas at sheets}{\arabic{pagesLTS.pagenr}}%
+        \newcounter{papermas at sheets}%
+        \let\papermassPages\m at ne%
+        \xdef\papermassmd{\number\maxdimen}%
+        \ifnum \@abspage at last=\papermassmd\relax%
+          \setcounter{papermas at sheets}{1}%
+          \gdef\papermas at rerun{1}%
+        \else%
+          \setcounter{papermas at sheets}{\@abspage at last}%
+          \xdef\papermassPages{\@abspage at last}%
+        \fi%
 %    \end{macrocode}
 %
 % When more than one page is printed on one sheet of paper,
@@ -744,14 +571,12 @@
 % one sheet of paper to the number of sheets needed.
 %
 %    \begin{macrocode}
-        \newcounter{papermas at tmpn}
+        \newcounter{papermas at tmpn}%
         \setcounter{papermas at tmpn}{\arabic{papermas at sheets}}%
         \multiply \value{papermas at tmpn} \value{papermasPPS}%
-        \ifnum \value{papermas at tmpn}=\value{pagesLTS.pagenr}
-          \relax
-        \else
-          \addtocounter{papermas at sheets}{1}%
-        \fi
+        \ifnum \value{papermas at tmpn}=\papermassPages%
+        \else \addtocounter{papermas at sheets}{1}%
+        \fi%
 %    \end{macrocode}
 %
 % Now we can multiply the specific mass of 100 sheets
@@ -758,15 +583,14 @@
 % with the number of sheets needed for printing:
 %
 %    \begin{macrocode}
-        \multiply \value{papermasmasss} \value{papermas at sheets}
-  % default:                  8000       (no default for this)
+        \multiply \value{papermasmasss} \value{papermas at 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\}}}$
@@ -773,8 +597,8 @@
 % 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:
@@ -781,41 +605,43 @@
 %
 %    \begin{macrocode}
         % for the example 297 is used
-        \newcounter{papermas at tmpm}
-        \setcounter{papermas at tmpm}{\arabic{papermasmasss}}%   m:297 n:    o:  p:  q:
-        \setcounter{papermas at tmpn}{\arabic{papermasmasss}}%   m:291 n:291 o:  p:  q:
-        \divide \value{papermas at tmpn} by 100%                 m:297 n:2   o:  p:  q:
-        \newcounter{papermas at tmpo}
-        \setcounter{papermas at tmpo}{\arabic{papermas at tmpn}}%   m:291 n:2   o:2 p:  q:
-        \multiply \value{papermas at tmpn} 10%                   m:297 n:20  o:2 p:  q:
-        \divide \value{papermas at tmpm} by 10%                  m:29  n:20  o:2 p:  q:
-        \newcounter{papermas at tmpp}
-        \setcounter{papermas at tmpp}{\arabic{papermas at tmpm}}
-        \addtocounter{papermas at tmpp}{-\arabic{papermas at tmpn}}%m:29  n:20  o:2 p:9 q:
-        %        29              - 20 = 9
-        \multiply \value{papermas at tmpm} 10%                   m:290 n:20  o:2 p:9 q:
-        \newcounter{papermas at tmpq}
-        \setcounter{papermas at tmpq}{\arabic{papermasmasss}}
-        \addtocounter{papermas at tmpq}{-\arabic{papermas at tmpm}}%m:290 n:20  o:2 p:9 q:7
-        %       297              - 290 = 7
+        \newcounter{papermas at tmpm}%
+        \setcounter{papermas at tmpm}{\arabic{papermasmasss}}%   m:297 n:  0 o:0 p: 0 q:0
+        \setcounter{papermas at tmpn}{\arabic{papermasmasss}}%   m:291 n:291 o:0 p: 0 q:0
+        \divide \value{papermas at tmpn} by 100%                 m:297 n:  2 o:0 p: 0 q:0
+        \newcounter{papermas at tmpo}%
+        \setcounter{papermas at tmpo}{\arabic{papermas at tmpn}}%   m:291 n:  2 o:2 p: 0 q:0
+        \multiply \value{papermas at tmpn} 10%                   m:297 n: 20 o:2 p: 0 q:0
+        \divide \value{papermas at tmpm} by 10%                  m: 29 n: 20 o:2 p: 0 q:0
+        \newcounter{papermas at tmpp}%
+        \setcounter{papermas at tmpp}{\arabic{papermas at tmpm}}%
+        \addtocounter{papermas at tmpp}{-\arabic{papermas at tmpn}}%m: 29 n: 20 o:2 p: 9 q:0
+        %                  29        -  20 = 9
+        \multiply \value{papermas at tmpm} 10%                   m:290 n: 20 o:2 p: 9 q:0
+        \newcounter{papermas at tmpq}%
+        \setcounter{papermas at tmpq}{\arabic{papermasmasss}}%
+        \addtocounter{papermas at tmpq}{-\arabic{papermas at 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 at tmpq}>4
-          \addtocounter{papermas at tmpp}{1}%                    m:290 n:20 o:2 p:10 q:7
-          \ifnum\value{papermas at tmpp}>9%                      m:290 n:20 o:2 p:10 q:7
-            \addtocounter{papermas at tmpo}{1}%                  m:290 n:20 o:3 p:10 q:7
-            \setcounter{papermas at tmpp}{0}%                    m:290 n:20 o:3 p:0  q:7
-          \fi
-        \fi
+        \ifnum\value{papermas at tmpq}>4%
+          \addtocounter{papermas at tmpp}{1}%                    m:290 n: 20 o:2 p:10 q:7
+          \ifnum\value{papermas at tmpp}>9%                      m:290 n: 20 o:2 p:10 q:7
+            \addtocounter{papermas at tmpo}{1}%                  m:290 n: 20 o:3 p:10 q:7
+            \setcounter{papermas at tmpp}{0}%                    m:290 n: 20 o:3 p: 0 q:7
+          \fi%
+        \fi%
+        \ifx\papermassPages\m at ne\relax\let\papermassPages\papermas at 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 at decimalsep|) is
-% the decimal separator) and the (other) options' values into
+% We write this into |\papermastmpr| (where |\papermas at decimalsep|)
+% is the decimal separator) and the (other) options' values into
 % temporary definitions, as well as the number of sheets:
 %
 %    \begin{macrocode}
@@ -827,14 +653,12 @@
         \edef\papermastmpt{\arabic{papermas at 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 at ifcounter{papermassttl}
+        \@ifundefined{c at papermassttl}{\newcounter{papermassttl}}{\relax}%
 %    \end{macrocode}
 %
 % If the |papermassttl| counter value already has the value of
@@ -841,21 +665,14 @@
 % |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 at rerun{1}%
+        \fi%
 %    \end{macrocode}
 %
 % In any case, we set the counter |papermassttl| to the
@@ -862,7 +679,7 @@
 % 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 @@
         \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 at 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 at 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 at ifcounter{papermassttl}}%
+          \immediate\write\@auxout{\string\@ifundefined{c at 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 at 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,158 +758,137 @@
 %    \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 at undefined{\textbf{??}}
-  \gdef\papermas at rerun{0}
-  \ifx\papermasstotal\papermas at undefined        \gdef\papermas at rerun{1} \fi
-  \ifx\papermasformat\papermas at undefined        \gdef\papermas at rerun{1} \fi
-  \ifx\papermasmasss\papermas at undefined         \gdef\papermas at rerun{1} \fi
-  \ifx\papermaspagespersheet\papermas at undefined \gdef\papermas at rerun{1} \fi
-  \ifx\papermassheets\papermas at undefined        \gdef\papermas at rerun{1} \fi
-  \ifx\papermas at rerun\pagesLTS at one
-    \AtEndAfterFileList{
-      \PackageWarningNoLine{papermas}{%
-        Variable(s) still undefined!\MessageBreak%
-        Rerun to get the variable(s) right%
-       }
-     }
-  \fi
-  }
+\newcounter{papermassSpace}
 
-
 %    \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\AfterLastShipout}
-% What we did not do yet, is to really \textit{call} the command
-% |\papermas at 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{macro}{\papermas at log}
 %    \begin{macrocode}
-\AfterLastShipout{%
-  \papermas at totmass%
-  }%
-
-%    \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{macrocode}
-\newcommand{\papermas at log}[1]{%
+\DeclareRobustCommand{\papermas at log}[1]{%
   \ifnum#1>9%
-    \addtocounter{pagesLTS.pnc.0}{1}%
+    \addtocounter{papermassSpace}{1}%
     \papermas at log{\intcalcDiv{#1}{10}}%
   \fi%
   }
 
-\newcommand{\papermas at spaces}[2]{%
-  \edef\papermas at remember{\arabic{pagesLTS.pnc.0}}%
-  \setcounter{pagesLTS.pnc.0}{1}%
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\papermas at spaces}
+%    \begin{macrocode}
+\DeclareRobustCommand{\papermas at spaces}[2]{%
+  \setcounter{papermassSpace}{1}%
   \papermas at log{#1}%
-  \addtocounter{pagesLTS.pnc.0}{-#2}%
-  \multiply \value{pagesLTS.pnc.0} -1%
-  \papermas at space{\arabic{pagesLTS.pnc.0}}%
+  \addtocounter{papermassSpace}{-#2}%
+  \multiply\value{papermassSpace} -1%
+  \papermas at space{\arabic{papermassSpace}}%
   \message{*^^J}%
-  \setcounter{pagesLTS.pnc.0}{\papermas at remember}%
   }
 
-\newcommand{\papermas at 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 at space{\arabic{pagesLTS.pnc.0}}%
-  \fi%
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\papermas at space}
+%    \begin{macrocode}
+\DeclareRobustCommand{\papermas at space}[1]{%
+  \ifnum\value{papermassSpace}>0\relax\message{}\fi%
+  \setcounter{papermassSpace}{#1}%
+  \addtocounter{papermassSpace}{-1}%
+  \ifnum\value{papermassSpace}>0\relax\papermas at 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 at undefined       \gdef\papermas at rerun{1}\fi%
+  \ifx\papermasstotal\papermas at undefined       \gdef\papermas at rerun{1}\fi%
+  \ifx\papermasformat\papermas at undefined       \gdef\papermas at rerun{1}\fi%
+  \ifx\papermasmasss\papermas at undefined        \gdef\papermas at rerun{1}\fi%
+  \ifx\papermaspagespersheet\papermas at undefined\gdef\papermas at rerun{1}\fi%
+  \ifx\papermassheets\papermas at undefined       \gdef\papermas at 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).\\
+% What we did not do yet, is to really \textit{call} the command |\papermas at totmass|.\newline
+% We do this after the last page, because we need the total number of pages.
 %
-% If no necessarity for a rerun was \textit{detected} (Check for other rerun warnings!),
-% the final |\PackageInfo| is given.
+%    \begin{macrocode}
+ \AddToHook{enddocument}{%
+  \AddToHook{enddocument/afterlastpage}{%
+   \papermas at totmass%
+%    \end{macrocode}
 %
+% After the final execution of the \xfile{aux}-file, everything should be defined.
+% Otherwise a rerun is needed.
+%
 %    \begin{macrocode}
-  \ifx\papermas at rerun\pagesLTS at zero%
-    \message{^^J}%
-    \message{papermas: ******************** Paper mass ********************^^J}%
-    \message{papermas: * This document consists of \arabic{pagesLTS.pagenr} pages.}
-    \papermas at spaces{\arabic{pagesLTS.pagenr}}{16}%
-    \message{papermas: * When printing \papermaspagespersheet\space pages on one sheet of paper,}
-    \papermas at spaces{\papermaspagespersheet}{6}%
-    \message{papermas: * \papermassheets\space sheets will be needed.}
-    \papermas at spaces{\papermassheets}{26}%
-    \message{papermas: * For ISO A \papermasformat\space paper of \papermasmasss\space g/m^2 specific mass,}
-    \papermas at spaces{\papermasmasss}{7}%
-    \message{papermas: * the printout will have a mass of about \papermasstotal\space g.}
-    \papermas at spaces{\papermas at mbs}{5}%
-    \message{papermas: ****************************************************^^J}
-    \message{^^J}
-  \fi%
-  }
-
+   \AddToHook{enddocument/afteraux}{%
+    \ifx\papermassPages\m at ne\relax\gdef\papermas at rerun{1}%
+    \else\ifx\papermassPages\@abspage at last\else\gdef\papermas at rerun{1}\fi%
+    \fi%
+    \AddToHook{enddocument/info}[kernel/filelist]{%
 %    \end{macrocode}
-% \end{macro}
 %
-% \begin{macro}{\papermas at powerof}
+% The final |\PackageInfo| is given, either giving values or a rerun warning.
 %
-% The command |\papermas at 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.
-%
 %    \begin{macrocode}
-\newcommand\papermas at powerof[2]{%
-  \PackageError{papermas}{Obsolete command \string\papermas at powerof\space used}{%
-    The command \string\papermas at 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 at 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 at powerof\space command!^^J^^J%
-     }%
-   }%
-  \pagesLTS at ifcounter{papermas at result}%
-  \setcounter{papermas at result}{\intcalcPow{#1}{#2}}%
-  }
-
+     \message{^^J}%
+     \message{papermas: ******************** Paper mass ********************^^J}%
+     \ifx\papermas at rerun\z@\relax%
+       \edef\papermassETest{\the\ReadonlyShipoutCounter\thetotalpages\PreviousTotalPages\@abspage at 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 at spaces{1}{16}% 16 because page vs. pages
+         \else \message{papermas: * This document consists of \papermassPages\space pages.}%
+               \papermas at spaces{\papermassPages}{15}%
+         \fi%
+         \ifnum \papermaspagespersheet=1\relax \message{papermas: * When printing one page on one sheet of paper,}%
+                \papermas at spaces{100}{6}%
+         \else \message{papermas: * When printing \papermaspagespersheet\space pages on one sheet of paper,}%
+               \papermas at spaces{\papermaspagespersheet}{5}%
+         \fi%
+         \ifnum \papermassheets=1\relax \message{papermas: * one sheet will be needed.}%
+                \papermas at spaces{100}{26}%
+         \else \message{papermas: * \papermassheets\space sheets will be needed.}%
+               \papermas at spaces{\papermassheets}{25}%
+         \fi%
+         \message{papermas: * For ISO A \papermasformat\space paper of \papermasmasss\space g/m^2 specific mass,}%
+           \papermas at spaces{\papermasmasss}{6}%
+         \message{papermas: * the printout will have a mass of about \papermasstotal\space g.}%
+           \papermas at spaces{\papermas at 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 at powerof}
+% The command |\papermas at 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 at powerof[2]{%
+%   \@ifundefined{c at papermas@result}{\newcounter{papermas at result}}{\relax}%
+%   \setcounter{papermas at result}{\intcalcPow{#1}{#2}}}%
+% \makeatother%
+% \end{verbatim}
 % \end{macro}
 %
 %    \begin{macrocode}
@@ -1113,102 +895,95 @@
 %</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 @@
 % 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,69 +1085,57 @@
 %
 % \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 |(pdf)latex papermas-example.tex|
+% and will need at least two compiler runs to get everything right.
 %
-% 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.
-%
 % \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.
+% 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).
 %
-% \pagebreak
-%
 % \phantomsection
 % \begin{History}\label{History}
 %   \begin{Version}{2010/06/01 v1.0(a)}
@@ -1381,27 +1144,21 @@
 %   \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,
@@ -1408,36 +1165,47 @@
 %             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 at last|.
+%     \item Package \xpackage{pageslts} is neither needed nor used by the
+%             \xpackage{papermas} package any longer.
+%     \item Removed |\papermas at 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}
 %
 % \bigskip

Modified: trunk/Master/texmf-dist/source/latex/papermas/papermas.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/papermas/papermas.ins	2023-04-12 20:06:05 UTC (rev 66834)
+++ trunk/Master/texmf-dist/source/latex/papermas/papermas.ins	2023-04-12 20:06:19 UTC (rev 66835)
@@ -9,25 +9,21 @@
 %% 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>
+%% Copyright (C) 2010 - 2023 by
+%%     H.-Martin Muench <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.)
-%% 
 %% 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".
 %% 
@@ -34,15 +30,21 @@
 %% 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,25 +55,21 @@
 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>
+Copyright (C) 2010 - 2023 by
+    H.-Martin Muench <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.)
-
 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".
 
@@ -78,10 +76,16 @@
 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 @@
 \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 @@
 \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!}

Modified: trunk/Master/texmf-dist/tex/latex/papermas/papermas.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/papermas/papermas.sty	2023-04-12 20:06:05 UTC (rev 66834)
+++ trunk/Master/texmf-dist/tex/latex/papermas/papermas.sty	2023-04-12 20:06:19 UTC (rev 66835)
@@ -9,25 +9,21 @@
 %% 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>
+%% Copyright (C) 2010 - 2023 by
+%%     H.-Martin Muench <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.)
-%% 
 %% 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".
 %% 
@@ -34,56 +30,66 @@
 %% 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.
 %% 
-\NeedsTeXFormat{LaTeX2e}[2009/09/24]
-\ProvidesPackage{papermas}[2011/08/22 v1.0h
-            Computes paper mass of a printout (HMM)]
+%% In memoriam
+%%  Claudia Simone Barth + 1996-01-30
+%%  Tommy Muench         + 2014-01-02
+%%  Hans-Klaus Muench    + 2014-08-24
+%% 
+\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 at 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}}}%
+\def\papermas at undefined{\textbf{??}}
+\let\papermassPages\papermas at undefined
+\let\papermasstotal\papermas at undefined
+\let\papermasformat\papermas at undefined
+\let\papermasmasss\papermas at undefined
+\let\papermaspagespersheet\papermas at undefined
+\let\papermassheets\papermas at undefined
+\let\papermas at rerun\z@
 
-\@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{??}}}{}
-
-\newcommand\papermas at totmass{%
+\DeclareRobustCommand\papermas at totmass{%
   \newcounter{papermasA}% paper mass for ISO A...
-  \setcounter{papermasA}{\papermas at format}% e. g. 4
+  \setcounter{papermasA}{\papermas at 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,11 +97,11 @@
       because this should be the paper format\MessageBreak%
       ISO A 0, 1, 2, 3,...\MessageBreak%
       Found instead: \papermas at format \MessageBreak%
-     }
+     }%
   \else%
-    \newcounter{papermasmasss}% always 0
-    \setcounter{papermasmasss}{\papermas at masss}% default: 80
-    \multiply \value{papermasmasss} 100 % default: 8000
+    \newcounter{papermasmasss}%
+    \setcounter{papermasmasss}{\papermas at 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%
@@ -102,58 +108,64 @@
         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 at masss \MessageBreak%
-       }
-    \else
-      \newcounter{papermasPPS}% is 0
+        Found instead: \papermas at masss\MessageBreak%
+       }%
+    \else%
+      \newcounter{papermasPPS}%
       \setcounter{papermasPPS}{\papermas at 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 at pagespersheet .\MessageBreak%
-          }
-      \else
-        \newcounter{papermas at sheets}
-        \setcounter{papermas at sheets}{\arabic{pagesLTS.pagenr}}%
+          }%
+      \else%
+        \newcounter{papermas at sheets}%
+        \let\papermassPages\m at ne%
+        \xdef\papermassmd{\number\maxdimen}%
+        \ifnum \@abspage at last=\papermassmd\relax%
+          \setcounter{papermas at sheets}{1}%
+          \gdef\papermas at rerun{1}%
+        \else%
+          \setcounter{papermas at sheets}{\@abspage at last}%
+          \xdef\papermassPages{\@abspage at last}%
+        \fi%
         \divide \value{papermas at sheets} by \value{papermasPPS}%
-        \newcounter{papermas at tmpn}
+        \newcounter{papermas at tmpn}%
         \setcounter{papermas at tmpn}{\arabic{papermas at sheets}}%
         \multiply \value{papermas at tmpn} \value{papermasPPS}%
-        \ifnum \value{papermas at tmpn}=\value{pagesLTS.pagenr}
-          \relax
-        \else
-          \addtocounter{papermas at sheets}{1}%
-        \fi
-        \multiply \value{papermasmasss} \value{papermas at sheets}
-  % default:                  8000       (no default for this)
-        \divide \value{papermasmasss} by \intcalcPow{2}{\value{papermasA}}
-  % default:               16000      /   2^(\value{papermasA})
+        \ifnum \value{papermas at tmpn}=\papermassPages%
+        \else \addtocounter{papermas at sheets}{1}%
+        \fi%
+        \multiply \value{papermasmasss} \value{papermas at 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 at tmpm}
-        \setcounter{papermas at tmpm}{\arabic{papermasmasss}}%   m:297 n:    o:  p:  q:
-        \setcounter{papermas at tmpn}{\arabic{papermasmasss}}%   m:291 n:291 o:  p:  q:
-        \divide \value{papermas at tmpn} by 100%                 m:297 n:2   o:  p:  q:
-        \newcounter{papermas at tmpo}
-        \setcounter{papermas at tmpo}{\arabic{papermas at tmpn}}%   m:291 n:2   o:2 p:  q:
-        \multiply \value{papermas at tmpn} 10%                   m:297 n:20  o:2 p:  q:
-        \divide \value{papermas at tmpm} by 10%                  m:29  n:20  o:2 p:  q:
-        \newcounter{papermas at tmpp}
-        \setcounter{papermas at tmpp}{\arabic{papermas at tmpm}}
-        \addtocounter{papermas at tmpp}{-\arabic{papermas at tmpn}}%m:29  n:20  o:2 p:9 q:
-        %        29              - 20 = 9
-        \multiply \value{papermas at tmpm} 10%                   m:290 n:20  o:2 p:9 q:
-        \newcounter{papermas at tmpq}
-        \setcounter{papermas at tmpq}{\arabic{papermasmasss}}
-        \addtocounter{papermas at tmpq}{-\arabic{papermas at tmpm}}%m:290 n:20  o:2 p:9 q:7
-        %       297              - 290 = 7
-        \ifnum\value{papermas at tmpq}>4
-          \addtocounter{papermas at tmpp}{1}%                    m:290 n:20 o:2 p:10 q:7
-          \ifnum\value{papermas at tmpp}>9%                      m:290 n:20 o:2 p:10 q:7
-            \addtocounter{papermas at tmpo}{1}%                  m:290 n:20 o:3 p:10 q:7
-            \setcounter{papermas at tmpp}{0}%                    m:290 n:20 o:3 p:0  q:7
-          \fi
-        \fi
+        \newcounter{papermas at tmpm}%
+        \setcounter{papermas at tmpm}{\arabic{papermasmasss}}%   m:297 n:  0 o:0 p: 0 q:0
+        \setcounter{papermas at tmpn}{\arabic{papermasmasss}}%   m:291 n:291 o:0 p: 0 q:0
+        \divide \value{papermas at tmpn} by 100%                 m:297 n:  2 o:0 p: 0 q:0
+        \newcounter{papermas at tmpo}%
+        \setcounter{papermas at tmpo}{\arabic{papermas at tmpn}}%   m:291 n:  2 o:2 p: 0 q:0
+        \multiply \value{papermas at tmpn} 10%                   m:297 n: 20 o:2 p: 0 q:0
+        \divide \value{papermas at tmpm} by 10%                  m: 29 n: 20 o:2 p: 0 q:0
+        \newcounter{papermas at tmpp}%
+        \setcounter{papermas at tmpp}{\arabic{papermas at tmpm}}%
+        \addtocounter{papermas at tmpp}{-\arabic{papermas at tmpn}}%m: 29 n: 20 o:2 p: 9 q:0
+        %                  29        -  20 = 9
+        \multiply \value{papermas at tmpm} 10%                   m:290 n: 20 o:2 p: 9 q:0
+        \newcounter{papermas at tmpq}%
+        \setcounter{papermas at tmpq}{\arabic{papermasmasss}}%
+        \addtocounter{papermas at tmpq}{-\arabic{papermas at tmpm}}%m:290 n: 20 o:2 p: 9 q:7
+        %                 297        - 290 = 7
+        \ifnum\value{papermas at tmpq}>4%
+          \addtocounter{papermas at tmpp}{1}%                    m:290 n: 20 o:2 p:10 q:7
+          \ifnum\value{papermas at tmpp}>9%                      m:290 n: 20 o:2 p:10 q:7
+            \addtocounter{papermas at tmpo}{1}%                  m:290 n: 20 o:3 p:10 q:7
+            \setcounter{papermas at tmpp}{0}%                    m:290 n: 20 o:3 p: 0 q:7
+          \fi%
+        \fi%
+        \ifx\papermassPages\m at ne\relax\let\papermassPages\papermas at undefined\fi%
         \edef\papermastmpr{\arabic{papermas at tmpo}\papermas at decimalsep\arabic{papermas at tmpp}}%
         \xdef\papermas at mbs{\arabic{papermas at tmpo}}%
         \edef\papermastmpformat{\papermas at format}%
@@ -160,34 +172,27 @@
         \edef\papermastmpmasss{\papermas at masss}%
         \edef\papermastmppagespersheet{\papermas at pagespersheet}%
         \edef\papermastmpt{\arabic{papermas at sheets}}%
-        \pagesLTS at 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 at papermassttl}{\newcounter{papermassttl}}{\relax}%
+        \ifnum\value{papermassttl}=\value{papermasmasss}%
+        \else\gdef\papermas at rerun{1}%
+        \fi%
+        \setcounter{papermassttl}{\arabic{papermasmasss}}%
         \edef\papermastmps{\arabic{papermasmasss}}%
         \if at filesw%
-          \immediate\write\@auxout{\string
-            \pagesLTS at 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 at 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%
@@ -194,93 +199,86 @@
   \fi%
   }
 
-\AtBeginDocument{%
-  \gdef\papermas at undefined{\textbf{??}}
-  \gdef\papermas at rerun{0}
-  \ifx\papermasstotal\papermas at undefined        \gdef\papermas at rerun{1} \fi
-  \ifx\papermasformat\papermas at undefined        \gdef\papermas at rerun{1} \fi
-  \ifx\papermasmasss\papermas at undefined         \gdef\papermas at rerun{1} \fi
-  \ifx\papermaspagespersheet\papermas at undefined \gdef\papermas at rerun{1} \fi
-  \ifx\papermassheets\papermas at undefined        \gdef\papermas at rerun{1} \fi
-  \ifx\papermas at rerun\pagesLTS at one
-    \AtEndAfterFileList{
-      \PackageWarningNoLine{papermas}{%
-        Variable(s) still undefined!\MessageBreak%
-        Rerun to get the variable(s) right%
-       }
-     }
-  \fi
-  }
+\newcounter{papermassSpace}
 
-\AfterLastShipout{%
-  \papermas at totmass%
-  }%
-
-\newcommand{\papermas at log}[1]{%
+\DeclareRobustCommand{\papermas at log}[1]{%
   \ifnum#1>9%
-    \addtocounter{pagesLTS.pnc.0}{1}%
+    \addtocounter{papermassSpace}{1}%
     \papermas at log{\intcalcDiv{#1}{10}}%
   \fi%
   }
 
-\newcommand{\papermas at spaces}[2]{%
-  \edef\papermas at remember{\arabic{pagesLTS.pnc.0}}%
-  \setcounter{pagesLTS.pnc.0}{1}%
+\DeclareRobustCommand{\papermas at spaces}[2]{%
+  \setcounter{papermassSpace}{1}%
   \papermas at log{#1}%
-  \addtocounter{pagesLTS.pnc.0}{-#2}%
-  \multiply \value{pagesLTS.pnc.0} -1%
-  \papermas at space{\arabic{pagesLTS.pnc.0}}%
+  \addtocounter{papermassSpace}{-#2}%
+  \multiply\value{papermassSpace} -1%
+  \papermas at space{\arabic{papermassSpace}}%
   \message{*^^J}%
-  \setcounter{pagesLTS.pnc.0}{\papermas at remember}%
   }
 
-\newcommand{\papermas at 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 at space{\arabic{pagesLTS.pnc.0}}%
-  \fi%
+\DeclareRobustCommand{\papermas at space}[1]{%
+  \ifnum\value{papermassSpace}>0\relax\message{}\fi%
+  \setcounter{papermassSpace}{#1}%
+  \addtocounter{papermassSpace}{-1}%
+  \ifnum\value{papermassSpace}>0\relax\papermas at space{\arabic{papermassSpace}}\fi%
   }
 
-\AtEndAfterFileList{%
-  \ifx\papermas at rerun\pagesLTS at zero%
-    \message{^^J}%
-    \message{papermas: ******************** Paper mass ********************^^J}%
-    \message{papermas: * This document consists of \arabic{pagesLTS.pagenr} pages.}
-    \papermas at spaces{\arabic{pagesLTS.pagenr}}{16}%
-    \message{papermas: * When printing \papermaspagespersheet\space pages on one sheet of paper,}
-    \papermas at spaces{\papermaspagespersheet}{6}%
-    \message{papermas: * \papermassheets\space sheets will be needed.}
-    \papermas at spaces{\papermassheets}{26}%
-    \message{papermas: * For ISO A \papermasformat\space paper of \papermasmasss\space g/m^2 specific mass,}
-    \papermas at spaces{\papermasmasss}{7}%
-    \message{papermas: * the printout will have a mass of about \papermasstotal\space g.}
-    \papermas at spaces{\papermas at mbs}{5}%
-    \message{papermas: ****************************************************^^J}
-    \message{^^J}
-  \fi%
-  }
-
-\newcommand\papermas at powerof[2]{%
-  \PackageError{papermas}{Obsolete command \string\papermas at powerof\space used}{%
-    The command \string\papermas at 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 at 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 at powerof\space command!^^J^^J%
-     }%
-   }%
-  \pagesLTS at ifcounter{papermas at result}%
-  \setcounter{papermas at result}{\intcalcPow{#1}{#2}}%
-  }
-
+\AddToHook{begindocument}{%
+ \@bsphack%
+  \ifx\papermassPages\papermas at undefined       \gdef\papermas at rerun{1}\fi%
+  \ifx\papermasstotal\papermas at undefined       \gdef\papermas at rerun{1}\fi%
+  \ifx\papermasformat\papermas at undefined       \gdef\papermas at rerun{1}\fi%
+  \ifx\papermasmasss\papermas at undefined        \gdef\papermas at rerun{1}\fi%
+  \ifx\papermaspagespersheet\papermas at undefined\gdef\papermas at rerun{1}\fi%
+  \ifx\papermassheets\papermas at undefined       \gdef\papermas at rerun{1}\fi%
+ \@esphack%
+ \AddToHook{enddocument}{%
+  \AddToHook{enddocument/afterlastpage}{%
+   \papermas at totmass%
+   \AddToHook{enddocument/afteraux}{%
+    \ifx\papermassPages\m at ne\relax\gdef\papermas at rerun{1}%
+    \else\ifx\papermassPages\@abspage at last\else\gdef\papermas at rerun{1}\fi%
+    \fi%
+    \AddToHook{enddocument/info}[kernel/filelist]{%
+     \message{^^J}%
+     \message{papermas: ******************** Paper mass ********************^^J}%
+     \ifx\papermas at rerun\z@\relax%
+       \edef\papermassETest{\the\ReadonlyShipoutCounter\thetotalpages\PreviousTotalPages\@abspage at 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 at spaces{1}{16}% 16 because page vs. pages
+         \else \message{papermas: * This document consists of \papermassPages\space pages.}%
+               \papermas at spaces{\papermassPages}{15}%
+         \fi%
+         \ifnum \papermaspagespersheet=1\relax \message{papermas: * When printing one page on one sheet of paper,}%
+                \papermas at spaces{100}{6}%
+         \else \message{papermas: * When printing \papermaspagespersheet\space pages on one sheet of paper,}%
+               \papermas at spaces{\papermaspagespersheet}{5}%
+         \fi%
+         \ifnum \papermassheets=1\relax \message{papermas: * one sheet will be needed.}%
+                \papermas at spaces{100}{26}%
+         \else \message{papermas: * \papermassheets\space sheets will be needed.}%
+               \papermas at spaces{\papermassheets}{25}%
+         \fi%
+         \message{papermas: * For ISO A \papermasformat\space paper of \papermasmasss\space g/m^2 specific mass,}%
+           \papermas at spaces{\papermasmasss}{6}%
+         \message{papermas: * the printout will have a mass of about \papermasstotal\space g.}%
+           \papermas at spaces{\papermas at 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'.



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