summaryrefslogtreecommitdiff
path: root/macros/latex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-12-27 03:02:10 +0000
committerNorbert Preining <norbert@preining.info>2023-12-27 03:02:10 +0000
commita017c8624fa1cc7d2781f6f4e59e4bd12e7050f1 (patch)
tree297488965603056462abc889dbee46943be8c566 /macros/latex
parent13571bacab1894379c1ec2ae255c676db2f1664a (diff)
CTAN sync 202312270302
Diffstat (limited to 'macros/latex')
-rw-r--r--macros/latex/contrib/changebar/CATALOG2
-rw-r--r--macros/latex/contrib/changebar/MANIFEST2
-rw-r--r--macros/latex/contrib/changebar/README4
-rw-r--r--macros/latex/contrib/changebar/cbtest1-ltx.pdfbin0 -> 33692 bytes
-rw-r--r--macros/latex/contrib/changebar/cbtest1-pdf.pdfbin0 -> 104033 bytes
-rw-r--r--macros/latex/contrib/changebar/cbtest1.tex322
-rw-r--r--macros/latex/contrib/changebar/cbtest2-ltx.pdfbin0 -> 33610 bytes
-rw-r--r--macros/latex/contrib/changebar/cbtest2-pdf.pdfbin0 -> 103943 bytes
-rw-r--r--macros/latex/contrib/changebar/cbtest2.tex322
-rw-r--r--macros/latex/contrib/changebar/changebar.bug6
-rw-r--r--macros/latex/contrib/changebar/changebar.dtx418
-rw-r--r--macros/latex/contrib/changebar/changebar.ins4
-rw-r--r--macros/latex/contrib/changebar/changebar.pdfbin380646 -> 483766 bytes
-rw-r--r--macros/latex/contrib/xkeymask/README36
-rw-r--r--macros/latex/contrib/xkeymask/xkeymask.pdfbin0 -> 128411 bytes
-rw-r--r--macros/latex/contrib/xkeymask/xkeymask.sty109
-rw-r--r--macros/latex/contrib/xkeymask/xkeymask.tex123
17 files changed, 1303 insertions, 45 deletions
diff --git a/macros/latex/contrib/changebar/CATALOG b/macros/latex/contrib/changebar/CATALOG
index a4ecdec11f..395f902fe2 100644
--- a/macros/latex/contrib/changebar/CATALOG
+++ b/macros/latex/contrib/changebar/CATALOG
@@ -1,7 +1,7 @@
Name: ChangeBar
Problems-To: johannes.braams(at)texniek.nl
Author: J.L. Braams
-Version: 3.6d
+Version: 3.7a
Description:
diff --git a/macros/latex/contrib/changebar/MANIFEST b/macros/latex/contrib/changebar/MANIFEST
index d6394a66b2..aea5dfa1fe 100644
--- a/macros/latex/contrib/changebar/MANIFEST
+++ b/macros/latex/contrib/changebar/MANIFEST
@@ -6,7 +6,7 @@
% change bars to a document. Relies on \specials.
%
% changebar.pdf -- The printed version of the package, including
-% a description of the use of the amcroƛ.
+% a description of the use of the macro's.
%
% changebar.ins -- The installation script.
%
diff --git a/macros/latex/contrib/changebar/README b/macros/latex/contrib/changebar/README
index ffc63526e7..209e8748d3 100644
--- a/macros/latex/contrib/changebar/README
+++ b/macros/latex/contrib/changebar/README
@@ -1,6 +1,6 @@
changebar bundle
- May 06, 2022
+ December 24, 2023
This bundle contains a package that I maintain to add changebars to a
LaTeX document.
@@ -14,7 +14,7 @@ be used to compare two versions of a document and automatically add
the changebars.
The file chbar.1, also contributed, documents the workings of chbar.sh
-Copyright (C) 2022 Johannes L. Braams johannes.braams(at)texniek.nl
+Copyright (C) 2023 Johannes L. Braams johannes.braams(at)texniek.nl
This program can be redistributed and/or modified under the terms
of the LaTeX Project Public License Distributed from CTAN
diff --git a/macros/latex/contrib/changebar/cbtest1-ltx.pdf b/macros/latex/contrib/changebar/cbtest1-ltx.pdf
new file mode 100644
index 0000000000..b15937eb8f
--- /dev/null
+++ b/macros/latex/contrib/changebar/cbtest1-ltx.pdf
Binary files differ
diff --git a/macros/latex/contrib/changebar/cbtest1-pdf.pdf b/macros/latex/contrib/changebar/cbtest1-pdf.pdf
new file mode 100644
index 0000000000..61b3ca3cd0
--- /dev/null
+++ b/macros/latex/contrib/changebar/cbtest1-pdf.pdf
Binary files differ
diff --git a/macros/latex/contrib/changebar/cbtest1.tex b/macros/latex/contrib/changebar/cbtest1.tex
new file mode 100644
index 0000000000..040518bbd9
--- /dev/null
+++ b/macros/latex/contrib/changebar/cbtest1.tex
@@ -0,0 +1,322 @@
+\documentclass[12pt,twoside]{article}
+\usepackage{amsmath}
+\usepackage[outerbars,color]{changebar}
+\ifx\pdfoutput\undefined
+\else\ifnum\pdfoutput>0
+ \usepackage{pdfcolmk}
+\fi\fi
+
+%\setcounter{changebargrey}{60}
+\cbcolor{red}
+
+\usepackage{fancyhdr}
+
+%Header-footer instructions
+\pagestyle{fancy}
+\setlength{\headheight}{15pt}
+\lhead{\scriptsize Changebar test file}
+\chead{}
+\rhead{v3.5}
+\lfoot{Onecolumn text}
+\cfoot{Page \thepage}
+\rfoot{}
+\renewcommand{\headrulewidth}{0.4pt} %print a rule below the header
+\renewcommand{\footrulewidth}{0.4pt} %print a rule above the footer
+
+\setcounter{page}{16}
+\setlength{\emergencystretch}{4em}
+
+\begin{document}
+
+%\tableofcontents
+
+\title{CHANGEBAR TEST FILE \\FOR ADVANCED FEATURES}
+\author{Piet van Oostrum}
+\maketitle
+
+\raggedbottom
+
+\begin {abstract}
+
+This file tests various advanced features of the changebar package.
+\cbstart\textcolor{red}{\textbf{Text that should have a changebar is
+ printed in red, so that it can easily be checked that the changebars are
+ in the proper position.} This changebar should be on the left.
+\cbend}
+
+This file contains the following features which in combinations used to
+give problems in versions of changebar before version 3.5:
+Twoside document, onecolumn and towcolumn text, figures, columns of
+figures, page changes in the midst of a document.
+
+This file tests various advanced features of the changebar package.
+This file contains the following features which in combinations used to
+give problems in versions of changebar before version 3.5:
+Twoside document, onecolumn and towcolumn text, figures, columns of
+figures, page changes in the midst of a document.
+It should work both with latex, followed by a supported Postscript driver,
+and with pdflatex.
+\end{abstract}
+
+\newpage
+
+This file tests various advanced features of the changebar package.
+\cbstart\textcolor{red}{Text that should have a changebar (like this) is
+ printed in red, so that it can easily be checked that the changebars are
+ in the proper position.On this page, the changebar should be on the right.
+\cbend}
+This file contains the following features which in combinations used to
+give problems in versions of changebar before version 3.5:
+Twoside document, onecolumn and towcolumn text, figures, columns of
+figures, page changes in the midst of a document.
+
+This file tests various advanced features of the changebar package.
+This file contains the following features which in combinations used to
+give problems in versions of changebar before version 3.5:
+Twoside document, onecolumn and towcolumn text, figures, columns of
+figures, page changes in the midst of a document.
+
+\cbstart[3mm] \textcolor{red}{Here is a thicker changebar. Text that should
+ have a changebar (like this) is printed in red, so that it can easily be
+ checked that the changebars are in the proper position.On this page, the
+ changebar should be on the right. We also include a formula with large
+ descenders which should be completely covered by the changebar:
+ $\displaystyle \cfrac{1}{2+\cfrac{1}{3+\cfrac{1}{4+\cdots}}}$
+ \cbend}
+
+\twocolumn
+\lfoot{Twocolumn page}
+
+\section{Introduction}
+
+\cbstart
+\color{red}
+This file tests various advanced features of the changebar package.
+This file contains the following features which in combinations used to
+give problems in versions of changebar before version 3.5:
+Twoside document, onecolumn and towcolumn text, figures, columns of
+figures, page changes in the midst of a document.
+It should work both with latex, followed by a supported Postscript driver,
+and with pdflatex.
+\cbend
+\color{black}
+
+\begin{figure}
+ \centering
+ \cbstart \color{red}
+ \fbox{
+ \parbox{0.8\linewidth}{
+ This is a figure. It has its
+ own changebar. This is a figure. This is a figure. It has its own
+ changebar. This is a figure. This is a figure. It has its own
+ changebar. This is a figure. This is a figure.\cbend}}
+ \color{black}
+ \caption{This is a test figure}
+\end{figure}
+
+This file tests various advanced features of the changebar package.
+This file contains the following features which in combinations used to
+give problems in versions of changebar before version 3.5:
+Twoside document, onecolumn and towcolumn text, figures, columns of
+figures, page changes in the midst of a document.
+
+\cbstart
+\color{red}
+Sections that have been added or modified are marked with a bar in
+the margins. This is a small paragraph that crosses a column boundary. It
+should have a changebar in both parts.\cbend
+\color{black}
+
+\section{Continuation}
+\cbstart
+\color{red}
+
+\begin{figure}
+\centering
+\color{red}
+ \fbox{
+ \parbox{0.8\linewidth}{ This is a figure. It inherits a changebar from
+ the environment. This is a figure. This is a figure. This is a
+ figure. This is a figure. It inherits a changebar from the
+ environment. This is a figure. This is a figure.}}
+\caption{This is a test figure}
+\color{black}
+\end{figure}
+\cbend
+\color{black}
+
+\begin{figure}[p]
+\centering \fbox{\parbox{.9\linewidth}{
+ This is a figure. This is a figure. This is a figure. This is a figure.
+ This is a figure. This is a figure. This is a figure. This is a figure.
+ This is a figure. This is a figure. This is a figure. This is a figure.
+ This is a figure. This is a figure. This is a figure. This is a figure.
+ }}
+ \caption{Test figure}
+\end{figure}
+
+\begin{figure}[p]
+\cbstart \color{red}
+\centering \fbox{\parbox{.9\linewidth}{
+ This is a figure. It has its own changebar. This is a figure. It has
+ its own changebar.
+ This is a figure. It has its own changebar. This is a figure. It has
+ its own changebar.
+ This is a figure. It has its own changebar. This is a figure. It has
+ its own changebar.
+ }} \cbend\color{black}
+ \caption{Test figure}
+\end{figure}
+
+\color{red}
+\cbstart
+
+\begin{figure}[p]
+\color{red}
+\centering \fbox{\parbox{.9\linewidth}{
+ This is a figure. It has a changebar from the environment. This is a
+ figure. It has a changebar from the environment.
+ This is a figure. It has a changebar from the environment. This is a
+ figure. It has a changebar from the environment.
+ }}
+ \caption{Test figure}
+\end{figure}
+
+This part contains a changebar that crosses several column and page
+boundaries. Please note that it crosses several figures also but those have
+their own changebars (or not), they do not fall inside the continuation
+changebar.
+
+\enlargethispage{1cm}
+\subsection{Enlarged column}
+
+\noindent\parbox{\linewidth}{%
+This file tests various advanced features of the changebar package.
+This file contains the following features which in combinations used to
+give problems in versions of changebar before version 3.5:
+Twoside document, onecolumn and towcolumn text, figures, columns of
+figures, page changes in the midst of a document.
+\\
+\textbf{This column is enlarged, therefore its extends in the footer.
+The changebar should also cover the extended text.}}
+
+This file contains the following features which in combinations used to
+give problems in versions of changebar before version 3.5:
+Twoside document, onecolumn and towcolumn text, figures, columns of
+figures, page changes in the midst of a document.
+It should work both with latex, followed by a supported Postscript driver,
+and with pdflatex.
+
+\section*{Specific issues}
+
+\addtocounter{page}{1}
+\textbf{Here we change the page number (skipping one page). Therefore we
+ have two even pages in a row. The page change is in the righthand column
+ which is not proper LaTeX coding, but it should be handled properly.}
+This file tests various advanced features of the changebar package.
+This file contains the following features which in combinations used to
+give problems in versions of changebar before version 3.5:
+Twoside document, onecolumn and towcolumn text, figures, columns of
+figures, page changes in the midst of a document.
+It should work both with latex, followed by a supported Postscript driver,
+and with pdflatex.
+
+This part contains a changebar that crosses several column and page
+boundaries. Please note that it crosses several figures also but those have
+their own changebars (or not), they do not fall inside the continuation
+changebar.
+
+
+This file tests various advanced features of the changebar package.
+This file contains the following features which in combinations used to
+give problems in versions of changebar before version 3.5:
+Twoside document, onecolumn and towcolumn text, figures, columns of
+figures, page changes in the midst of a document.
+It should work both with latex, followed by a supported Postscript driver,
+and with pdflatex.
+
+This part contains a changebar that crosses several column and page
+boundaries. Please note that it crosses several figures also but those have
+their own changebars (or not), they do not fall inside the continuation
+changebar.
+
+This file tests various advanced features of the changebar package.
+This file contains the following features which in combinations used to
+give problems in versions of changebar before version 3.5:
+Twoside document, onecolumn and towcolumn text, figures, columns of
+figures, page changes in the midst of a document.
+It should work both with latex, followed by a supported Postscript driver,
+and with pdflatex.
+
+\begin{figure}[p]
+\color{red}
+\centering \fbox{\parbox{.9\linewidth}{
+ This is a figure. It has a changebar from the environment. This is a
+ figure. It has a changebar from the environment.
+ This is a figure. It has a changebar from the environment. This is a
+ figure. It has a changebar from the environment.
+ }}
+ \caption{Test figure}
+\end{figure}
+
+\begin{figure}[p]
+\color{red}
+\centering \fbox{\parbox{.9\linewidth}{
+ This is a figure. It has a changebar from the environment. This is a
+ figure. It has a changebar from the environment.
+ This is a figure. It has a changebar from the environment. This is a
+ figure. It has a changebar from the environment.
+ This is a figure. It has a changebar from the environment. This is a
+ figure. It has a changebar from the environment.
+ }}
+ \caption{Test figure}
+\end{figure}
+
+\begin{figure}[p]
+\color{red}
+\centering \fbox{\parbox{.9\linewidth}{
+ This is a figure. It has a changebar from the environment. This is a
+ figure. It has a changebar from the environment.
+ This is a figure. It has a changebar from the environment. This is a
+ figure. It has a changebar from the environment.
+ }}
+ \caption{Test figure}
+\end{figure}
+
+\begin{figure}[p]
+\color{red}
+\centering \fbox{\parbox{.9\linewidth}{
+ This is a figure. It has a changebar from the environment. This is a
+ figure. It has a changebar from the environment.
+ This is a figure. It has a changebar from the environment. This is a
+ figure. It has a changebar from the environment.
+ }}
+ \caption{Test figure}
+\end{figure}
+
+This part contains a changebar that crosses several column and page
+boundaries. Please note that it crosses several figures also but those have
+their own changebars (or not), they do not fall inside the continuation
+changebar. \cbend
+\color{black} The last sentence of this part is outside the changebar.
+\\[1ex]
+
+\color{red}\cbstart
+\noindent\fbox{\parbox[t]{0.95\linewidth}{%
+This is a parbox. It should have a changebar along its total height.
+This is a parbox. It should have a changebar along its total height.
+This is a parbox. It should have a changebar along its total height.
+This is a parbox. It should have a changebar along its total height.
+This is a parbox. It should have a changebar along its total height.
+This is a parbox. It should have a changebar along its total height.
+This is a parbox. It should have a changebar along its total height.
+This is a parbox. It should have a changebar along its total height.
+}}\cbend\color{black}
+\\[2cm]
+There should be a lonely figure with a changebar at the right.
+\end{document}
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: t
+%%% End:
diff --git a/macros/latex/contrib/changebar/cbtest2-ltx.pdf b/macros/latex/contrib/changebar/cbtest2-ltx.pdf
new file mode 100644
index 0000000000..212f9f8da2
--- /dev/null
+++ b/macros/latex/contrib/changebar/cbtest2-ltx.pdf
Binary files differ
diff --git a/macros/latex/contrib/changebar/cbtest2-pdf.pdf b/macros/latex/contrib/changebar/cbtest2-pdf.pdf
new file mode 100644
index 0000000000..ecca6f17ea
--- /dev/null
+++ b/macros/latex/contrib/changebar/cbtest2-pdf.pdf
Binary files differ
diff --git a/macros/latex/contrib/changebar/cbtest2.tex b/macros/latex/contrib/changebar/cbtest2.tex
new file mode 100644
index 0000000000..1f53624e4e
--- /dev/null
+++ b/macros/latex/contrib/changebar/cbtest2.tex
@@ -0,0 +1,322 @@
+\documentclass[12pt,twoside]{article}
+\usepackage{amsmath}
+\usepackage[outerbars,xcolor]{changebar}
+\ifx\pdfoutput\undefined
+\else\ifnum\pdfoutput>0
+ \usepackage{pdfcolmk}
+\fi\fi
+
+%\setcounter{changebargrey}{60}
+\cbcolor{red}
+
+\usepackage{fancyhdr}
+
+%Header-footer instructions
+\pagestyle{fancy}
+\setlength{\headheight}{15pt}
+\lhead{\scriptsize Changebar test file}
+\chead{}
+\rhead{v3.5}
+\lfoot{Onecolumn text}
+\cfoot{Page \thepage}
+\rfoot{}
+\renewcommand{\headrulewidth}{0.4pt} %print a rule below the header
+\renewcommand{\footrulewidth}{0.4pt} %print a rule above the footer
+
+\setcounter{page}{16}
+\setlength{\emergencystretch}{4em}
+
+\begin{document}
+
+%\tableofcontents
+
+\title{CHANGEBAR TEST FILE \\FOR ADVANCED FEATURES}
+\author{Piet van Oostrum}
+\maketitle
+
+\raggedbottom
+
+\begin {abstract}
+
+This file tests various advanced features of the changebar package.
+\cbstart\textcolor{red}{\textbf{Text that should have a changebar is
+ printed in red, so that it can easily be checked that the changebars are
+ in the proper position.} This changebar should be on the left.
+\cbend}
+
+This file contains the following features which in combinations used to
+give problems in versions of changebar before version 3.5:
+Twoside document, onecolumn and towcolumn text, figures, columns of
+figures, page changes in the midst of a document.
+
+This file tests various advanced features of the changebar package.
+This file contains the following features which in combinations used to
+give problems in versions of changebar before version 3.5:
+Twoside document, onecolumn and towcolumn text, figures, columns of
+figures, page changes in the midst of a document.
+It should work both with latex, followed by a supported Postscript driver,
+and with pdflatex.
+\end{abstract}
+
+\newpage
+
+This file tests various advanced features of the changebar package.
+\cbstart\textcolor{red}{Text that should have a changebar (like this) is
+ printed in red, so that it can easily be checked that the changebars are
+ in the proper position.On this page, the changebar should be on the right.
+\cbend}
+This file contains the following features which in combinations used to
+give problems in versions of changebar before version 3.5:
+Twoside document, onecolumn and towcolumn text, figures, columns of
+figures, page changes in the midst of a document.
+
+This file tests various advanced features of the changebar package.
+This file contains the following features which in combinations used to
+give problems in versions of changebar before version 3.5:
+Twoside document, onecolumn and towcolumn text, figures, columns of
+figures, page changes in the midst of a document.
+
+\cbstart[3mm] \textcolor{red}{Here is a thicker changebar. Text that should
+ have a changebar (like this) is printed in red, so that it can easily be
+ checked that the changebars are in the proper position.On this page, the
+ changebar should be on the right. We also include a formula with large
+ descenders which should be completely covered by the changebar:
+ $\displaystyle \cfrac{1}{2+\cfrac{1}{3+\cfrac{1}{4+\cdots}}}$
+ \cbend}
+
+\twocolumn
+\lfoot{Twocolumn page}
+
+\section{Introduction}
+
+\cbstart
+\color{red}
+This file tests various advanced features of the changebar package.
+This file contains the following features which in combinations used to
+give problems in versions of changebar before version 3.5:
+Twoside document, onecolumn and towcolumn text, figures, columns of
+figures, page changes in the midst of a document.
+It should work both with latex, followed by a supported Postscript driver,
+and with pdflatex.
+\cbend
+\color{black}
+
+\begin{figure}
+ \centering
+ \cbstart \color{red}
+ \fbox{
+ \parbox{0.8\linewidth}{
+ This is a figure. It has its
+ own changebar. This is a figure. This is a figure. It has its own
+ changebar. This is a figure. This is a figure. It has its own
+ changebar. This is a figure. This is a figure.\cbend}}
+ \color{black}
+ \caption{This is a test figure}
+\end{figure}
+
+This file tests various advanced features of the changebar package.
+This file contains the following features which in combinations used to
+give problems in versions of changebar before version 3.5:
+Twoside document, onecolumn and towcolumn text, figures, columns of
+figures, page changes in the midst of a document.
+
+\cbstart
+\color{red}
+Sections that have been added or modified are marked with a bar in
+the margins. This is a small paragraph that crosses a column boundary. It
+should have a changebar in both parts.\cbend
+\color{black}
+
+\section{Continuation}
+\cbstart
+\color{red}
+
+\begin{figure}
+\centering
+\color{red}
+ \fbox{
+ \parbox{0.8\linewidth}{ This is a figure. It inherits a changebar from
+ the environment. This is a figure. This is a figure. This is a
+ figure. This is a figure. It inherits a changebar from the
+ environment. This is a figure. This is a figure.}}
+\caption{This is a test figure}
+\color{black}
+\end{figure}
+\cbend
+\color{black}
+
+\begin{figure}[p]
+\centering \fbox{\parbox{.9\linewidth}{
+ This is a figure. This is a figure. This is a figure. This is a figure.
+ This is a figure. This is a figure. This is a figure. This is a figure.
+ This is a figure. This is a figure. This is a figure. This is a figure.
+ This is a figure. This is a figure. This is a figure. This is a figure.
+ }}
+ \caption{Test figure}
+\end{figure}
+
+\begin{figure}[p]
+\cbstart \color{red}
+\centering \fbox{\parbox{.9\linewidth}{
+ This is a figure. It has its own changebar. This is a figure. It has
+ its own changebar.
+ This is a figure. It has its own changebar. This is a figure. It has
+ its own changebar.
+ This is a figure. It has its own changebar. This is a figure. It has
+ its own changebar.
+ }} \cbend\color{black}
+ \caption{Test figure}
+\end{figure}
+
+\color{red}
+\cbstart
+
+\begin{figure}[p]
+\color{red}
+\centering \fbox{\parbox{.9\linewidth}{
+ This is a figure. It has a changebar from the environment. This is a
+ figure. It has a changebar from the environment.
+ This is a figure. It has a changebar from the environment. This is a
+ figure. It has a changebar from the environment.
+ }}
+ \caption{Test figure}
+\end{figure}
+
+This part contains a changebar that crosses several column and page
+boundaries. Please note that it crosses several figures also but those have
+their own changebars (or not), they do not fall inside the continuation
+changebar.
+
+\enlargethispage{1cm}
+\subsection{Enlarged column}
+
+\noindent\parbox{\linewidth}{%
+This file tests various advanced features of the changebar package.
+This file contains the following features which in combinations used to
+give problems in versions of changebar before version 3.5:
+Twoside document, onecolumn and towcolumn text, figures, columns of
+figures, page changes in the midst of a document.
+\\
+\textbf{This column is enlarged, therefore its extends in the footer.
+The changebar should also cover the extended text.}}
+
+This file contains the following features which in combinations used to
+give problems in versions of changebar before version 3.5:
+Twoside document, onecolumn and towcolumn text, figures, columns of
+figures, page changes in the midst of a document.
+It should work both with latex, followed by a supported Postscript driver,
+and with pdflatex.
+
+\section*{Specific issues}
+
+\addtocounter{page}{1}
+\textbf{Here we change the page number (skipping one page). Therefore we
+ have two even pages in a row. The page change is in the righthand column
+ which is not proper LaTeX coding, but it should be handled properly.}
+This file tests various advanced features of the changebar package.
+This file contains the following features which in combinations used to
+give problems in versions of changebar before version 3.5:
+Twoside document, onecolumn and towcolumn text, figures, columns of
+figures, page changes in the midst of a document.
+It should work both with latex, followed by a supported Postscript driver,
+and with pdflatex.
+
+This part contains a changebar that crosses several column and page
+boundaries. Please note that it crosses several figures also but those have
+their own changebars (or not), they do not fall inside the continuation
+changebar.
+
+
+This file tests various advanced features of the changebar package.
+This file contains the following features which in combinations used to
+give problems in versions of changebar before version 3.5:
+Twoside document, onecolumn and towcolumn text, figures, columns of
+figures, page changes in the midst of a document.
+It should work both with latex, followed by a supported Postscript driver,
+and with pdflatex.
+
+This part contains a changebar that crosses several column and page
+boundaries. Please note that it crosses several figures also but those have
+their own changebars (or not), they do not fall inside the continuation
+changebar.
+
+This file tests various advanced features of the changebar package.
+This file contains the following features which in combinations used to
+give problems in versions of changebar before version 3.5:
+Twoside document, onecolumn and towcolumn text, figures, columns of
+figures, page changes in the midst of a document.
+It should work both with latex, followed by a supported Postscript driver,
+and with pdflatex.
+
+\begin{figure}[p]
+\color{red}
+\centering \fbox{\parbox{.9\linewidth}{
+ This is a figure. It has a changebar from the environment. This is a
+ figure. It has a changebar from the environment.
+ This is a figure. It has a changebar from the environment. This is a
+ figure. It has a changebar from the environment.
+ }}
+ \caption{Test figure}
+\end{figure}
+
+\begin{figure}[p]
+\color{red}
+\centering \fbox{\parbox{.9\linewidth}{
+ This is a figure. It has a changebar from the environment. This is a
+ figure. It has a changebar from the environment.
+ This is a figure. It has a changebar from the environment. This is a
+ figure. It has a changebar from the environment.
+ This is a figure. It has a changebar from the environment. This is a
+ figure. It has a changebar from the environment.
+ }}
+ \caption{Test figure}
+\end{figure}
+
+\begin{figure}[p]
+\color{red}
+\centering \fbox{\parbox{.9\linewidth}{
+ This is a figure. It has a changebar from the environment. This is a
+ figure. It has a changebar from the environment.
+ This is a figure. It has a changebar from the environment. This is a
+ figure. It has a changebar from the environment.
+ }}
+ \caption{Test figure}
+\end{figure}
+
+\begin{figure}[p]
+\color{red}
+\centering \fbox{\parbox{.9\linewidth}{
+ This is a figure. It has a changebar from the environment. This is a
+ figure. It has a changebar from the environment.
+ This is a figure. It has a changebar from the environment. This is a
+ figure. It has a changebar from the environment.
+ }}
+ \caption{Test figure}
+\end{figure}
+
+This part contains a changebar that crosses several column and page
+boundaries. Please note that it crosses several figures also but those have
+their own changebars (or not), they do not fall inside the continuation
+changebar. \cbend
+\color{black} The last sentence of this part is outside the changebar.
+\\[1ex]
+
+\color{red}\cbstart
+\noindent\fbox{\parbox[t]{0.95\linewidth}{%
+This is a parbox. It should have a changebar along its total height.
+This is a parbox. It should have a changebar along its total height.
+This is a parbox. It should have a changebar along its total height.
+This is a parbox. It should have a changebar along its total height.
+This is a parbox. It should have a changebar along its total height.
+This is a parbox. It should have a changebar along its total height.
+This is a parbox. It should have a changebar along its total height.
+This is a parbox. It should have a changebar along its total height.
+}}\cbend\color{black}
+\\[2cm]
+There should be a lonely figure with a changebar at the right.
+\end{document}
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: t
+%%% End:
diff --git a/macros/latex/contrib/changebar/changebar.bug b/macros/latex/contrib/changebar/changebar.bug
index bc04f1ca68..aed1dc80a7 100644
--- a/macros/latex/contrib/changebar/changebar.bug
+++ b/macros/latex/contrib/changebar/changebar.bug
@@ -201,10 +201,12 @@
% an extra page at the end of the document, filled with "spsp"
%
% v3.6d JLB: Added \relax at the end of \openin statements in order to
-% prevent teX from looking too far ahead.
+% prevent TeX from looking too far ahead.
+%
+% v3.7a JLB: Added support for LuaTeX based on the pdfTEX and XeTeX code
%
% Known problems
-% - changebars for mmarginal paragraphs collide with changebars
+% - changebars for marginal paragraphs collide with changebars
% for the main body of text
% - With PostScript a dictstack overflow seems to occur with
% many changebars. cb@maxpoint=20 seems to help
diff --git a/macros/latex/contrib/changebar/changebar.dtx b/macros/latex/contrib/changebar/changebar.dtx
index b07d80083f..6f34ad89ec 100644
--- a/macros/latex/contrib/changebar/changebar.dtx
+++ b/macros/latex/contrib/changebar/changebar.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% Copyright 1994-2022 (C) Johannes Braams. All rights reserved.
+%% Copyright 1994-2023 (C) Johannes Braams. All rights reserved.
%
% This file is part of the changebar package.
% -------------------------------------------
@@ -24,7 +24,7 @@
% and covered by LPPL is defined by the unpacking scripts (with
% extension .ins) which are part of the distribution.
% \fi
-% \CheckSum{2594}
+% \CheckSum{2949}
%
%\iffalse
% This file is built for \LaTeXe, so we make sure an error is
@@ -39,7 +39,7 @@
\ProvidesFile{changebar.dtx}
%</dtx>
%<+package>\ProvidesPackage{changebar}
- [2022-05-06 v3.6d Indicate changes with marginal bars]
+ [2023/12/24 v3.7a Indicate changes with marginal bars]
% \end{macrocode}
%
% \section{A driver for this document}
@@ -52,7 +52,7 @@
% \begin{macrocode}
%<*driver>
\documentclass{ltxdoc}
-\usepackage[pdftex,rightbars,color]{changebar}
+\usepackage[pdftex,rightbars,color,traceon,tracestacks]{changebar}
\cbcolor{red}
\DoNotIndex{\@@,\@Esphack,\@Mii,\@cons,\@empty,\@gobble}
\DoNotIndex{\@ifundefined,\@ne,\@spaces,\@whilenum}
@@ -134,14 +134,15 @@
% Apostolos Syropoulos}
% \changes{v3.6b}{2018/02/03}{Added a macro for pdf scaling for
% Xe\TeX}
-%
+% \changes{v3.6e}{2023/08/13}{Added supprt for luaTeX}
+%
% \title{The Changebar package
% \thanks{This file has version number \fileversion,
% last revised \filedate.}}
%
% \author{Michael Fine\\Distributed Systems Architecture \and
% Johannes Braams\\
-% \texttt{texniek at braams.xs4all.nl}}
+% \texttt{johannes.braams at texniek.nl}}
%
% \date{Printed \today}
%
@@ -224,7 +225,11 @@
% \item PDF\TeX
% \changes{v3.6a}{2011/04/30}{XeTeX added}
% \item Xe\TeX
-% \end{itemize}
+% \changes{3.6e}{2023/08/13}{luaTeX added}
+% \begin{changebar}
+% \item lua\TeX
+% \end{changebar}
+% \end{itemize}
% The drivers are represented in the normal typewriter method of
% typing these names, or by the same entirely in lower case.
% Since version 3.4d the driver can be specified in a configuration
@@ -733,6 +738,7 @@
% |\usepackage| call.
% \changes{v3.5a}{2005/05/23}{Added the option \Lopt{PDFTeX}}
% \changes{v3.6a}{2011/04/30}{Added the option \Lopt{XeTeX}}
+% \changes{v3.6e}{2023/08/13}{Added the option \Lopt{luaTeX}}
% Possible choices are:
% \begin{itemize}
% \item DVItoLN03
@@ -743,6 +749,8 @@
% \item V\TeX
% \item PDF\TeX
% \item Xe\TeX
+%
+% \cbstart\item luaTeX\cbend
% \end{itemize}
%
% The intent is that the driver names should be case-insensitive,
@@ -834,13 +842,44 @@
\fi}
% \end{macrocode}
%
-% Give a warning if we cannot support the \Lopt{xetex} option.
+% \begin{changebar}
+% \begin{macrocode}
+\DeclareOption{luaTeX}{\cb@luatexcheck}
+\DeclareOption{luatex}{\cb@luatexcheck}
+% \end{macrocode}
+% \changes{v3.6e}{2023/08/13}{luaTeX support added}
+% For the \Lopt{luatex} option we have to check that the current
+% \LaTeX{} run is using lua\TeX{}.
+% If it is, we initialize the option and open an additional output file.
+% If not, we ignore the option and issue a warning..
+% \begin{macrocode}
+\def\cb@luatexcheck{%
+ \ifx\directlua\@undefined \cb@luatexerror
+ \else
+ \global\chardef\cb@driver@setup=8\relax
+ \ifx\cb@writexy\@undefined
+ \newwrite\cb@writexy
+ \newread\cb@readxy
+ \immediate\openout\cb@writexy=\jobname.cb2\relax
+ \fi
+% \end{macrocode}
+% Redefine the |\cb@pdfxy| macro to write point coordinates to the
+% \file{.cb2} file.
% \begin{macrocode}
-\def\cb@xetexerror{\PackageError
+ \gdef\cb@pdfxy##1##2##3##4##5{%
+ \immediate\write\cb@writexy{##1.##2p##3,##4,##5}%
+ \expandafter\gdef\csname cb@##1.##2\endcsname{##3,##4,##5}}
+ \fi}
+% \end{macrocode}
+%
+% Give a warning if we cannot support the \Lopt{luatex} option.
+% \begin{macrocode}
+\def\cb@luatexerror{\PackageError
{changebar}%
- {XeTeX option cannot be used}%
- {You are not using XeLaTeX}}
+ {luaTeX option cannot be used}%
+ {You are not using luaLaTeX}}
% \end{macrocode}
+% \end{changebar}
%
% The new features of \LaTeXe\ make it possible to implement the
% \Lopt{outerbars} option.
@@ -1085,12 +1124,19 @@
% \begin{macrocode}
\def\xeTeX{XETEX}
% \end{macrocode}
+% \changes{v3.6e}{2023/08/13}{Added 'luaTeX' option}
+% \begin{changebar}
+% \begin{macrocode}
+ \def\luaTeX{LUATEX}
+% \end{macrocode}
+% \end{changebar}
%
% The choice has to be communicated to the macro
% \verb=\cb@setup@specials= that will be called from within
% \verb=\document=. For this purpose the control sequence
% \verb=\cb@driver@setup= is used. It receives a numeric value
% using \verb=\chardef=.
+% \changes{v3.6a}{2011/04/30}{Added 'XeTeX' option}
% \begin{macrocode}
\global\chardef\cb@driver@setup=0\relax
\ifx\tempa\LN \global\chardef\cb@driver@setup=0\fi
@@ -1100,11 +1146,14 @@
\ifx\tempa\Textures \global\chardef\cb@driver@setup=4\fi
\ifx\tempa\VTeX \global\chardef\cb@driver@setup=5\fi
\ifx\tempa\pdfTeX \cb@pdftexcheck\fi
+ \ifx\tempa\xeTeX \cb@xetexcheck\fi
% \end{macrocode}
-% \changes{v3.6a}{2011/04/30}{Added 'XeTeX' option}
+% \changes{v3.6e}{2023/08/13}{Added 'luaTeX' option}
+% \begin{changebar}
% \begin{macrocode}
- \ifx\tempa\xeTeX \cb@xetexcheck\fi
+ \ifx\tempa\luaTeX \cb@luatexcheck\fi
% \end{macrocode}
+% \end{changebar}
% \begin{macrocode}
\egroup}
% \end{macrocode}
@@ -1396,14 +1445,16 @@
%
% \begin{macro}{\cb@pdffind}
% The |\cb@pdffind| recursively searches through |\cb@pdfpoints| to find
-% point \#1 on pagecount \#2. |\cb@pdfpoints| contains entries of the
-% form \meta{pointnr}.\meta{pagecount}p\meta{x},\meta{y},\meta{z}pt.
+% point \#1 on pagecount \#2. |\cb@pdfpoints| contains entries of the
+% form\\
+% \meta{pointnr}.\meta{pagecount}p\meta{x},\meta{y},\meta{z}pt.
% When the point is found it is removed from |\cb@pdfpoints|. \#9
% contains the cumulative head of the list to construct the new list
% with the entry removed. \#3--\#8 are for pattern matching.
% \begin{macrocode}
\def\cb@pdffind##1##2##3.##4p##5,##6,##7pt##8\relax##9{%
- \def\cb@next{\cb@pdffind{##1}{##2}##8\relax{##9##3.##4p##5,##6,##7pt}}%
+ \def\cb@next{%
+ \cb@pdffind{##1}{##2}##8\relax{##9##3.##4p##5,##6,##7pt}}%
\ifnum ##1=##3
\ifnum ##2=##4
\def\cb@pdfx{##5sp}%
@@ -1495,6 +1546,15 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\cb@pdf@scale}
+% \changes{v3.6a}{2018/02/03}{Added macro for scale factor}
+% In order to get things in the right spot we need a little scaling
+% factor. We define it here.
+% \begin{macrocode}
+\def\cb@pdf@scale{0.996264009963}
+% \end{macrocode}
+% \end{macro}
+%
% The |\cb@connect| finds the coordinates of the begin and end points,
% converts them to PDF units and draws the bar with |\pdfliteral|. It
% also sets the color or gray level, if necessary. When any of the
@@ -1515,8 +1575,8 @@
\begingroup
\cb@dima=\cb@pdfz
\advance\cb@dima by-\cb@pdfx
- \advance\cb@dima by1in
- \cb@dima=0.996264009963\cb@dima\relax
+ \advance\cb@dima by1in%
+ \cb@dima=\cb@pdf@scale\cb@dima\relax
% \end{macrocode}
% First we let PDF save the graphics state. Then we generate the color
% selection code followed by the code to draw the changebar. Finally the
@@ -1533,8 +1593,8 @@
\edef\cb@temp{\expandafter\cb@removedim\the\cb@dima\space}%
\cb@dima=\cb@pdftopy
\advance\cb@dima-\cb@pdfy\relax
- \cb@dima=0.996264009963\cb@dima\relax
- ##3=0.996264009963##3\relax
+ \cb@dima=\cb@pdf@scale\cb@dima\relax
+ ##3=\cb@pdf@scale##3\relax
\pdfliteral direct{\expandafter\cb@removedim\the##3 w
\cb@temp 0 m
\cb@temp \expandafter\cb@removedim\the\cb@dima\space l S Q}%
@@ -1650,7 +1710,8 @@
\ifx\cb@pdfpoints\@empty\else
\ifnum##2<0\relax
\else
- \edef\cb@temp{\noexpand\cb@pdffind{##1}{##2}\cb@pdfpoints\relax{}}%
+ \edef\cb@temp{%
+ \noexpand\cb@pdffind{##1}{##2}\cb@pdfpoints\relax{}}%
\cb@temp
\fi
\fi
@@ -1661,13 +1722,15 @@
% \begin{macro}{\cb@pdffind}
% The |\cb@pdffind| recursively searches through |\cb@pdfpoints| to find
% point \#1 on pagecount \#2. |\cb@pdfpoints| contains entries of the
-% form \meta{pointnr}.\meta{pagecount}p\meta{x},\meta{y},\meta{z}pt.
+% form\\
+% \meta{pointnr}.\meta{pagecount}p\meta{x},\meta{y},\meta{z}pt.
% When the point is found it is removed from |\cb@pdfpoints|. \#9
% contains the cumulative head of the list to construct the new list
% with the entry removed. \#3--\#8 are for pattern matching.
% \begin{macrocode}
\def\cb@pdffind##1##2##3.##4p##5,##6,##7pt##8\relax##9{%
- \def\cb@next{\cb@pdffind{##1}{##2}##8\relax{##9##3.##4p##5,##6,##7pt}}%
+ \def\cb@next{%
+ \cb@pdffind{##1}{##2}##8\relax{##9##3.##4p##5,##6,##7pt}}%
\ifnum ##1=##3
\ifnum ##2=##4
\def\cb@pdfx{##5sp}%
@@ -1788,7 +1851,7 @@
\begingroup
\cb@dima=\cb@pdfz
\advance\cb@dima by-\cb@pdfx
- \advance\cb@dima by1in
+ \advance\cb@dima by1in%
\cb@dima=\cb@pdf@scale\cb@dima\relax
% \end{macrocode}
% First we let PDF save the graphics state. Then we generate the color
@@ -1831,19 +1894,11 @@
% \begin{macro}{\cb@checkPdfxy}
% The macro |\cb@checkPdfxy| checks if the coordinates of a point have
% changed during the current run. If so, we need to rerun \LaTeX.
-% \changes{v3.6c}{2018/03/09}{Use \cs{ifdim} instead of \cs{ifnum} as
-% \cs{cb@pdfx} is defined as a dimension}
% \begin{macrocode}
\gdef\cb@checkPdfxy##1##2##3##4##5{%
\cb@@findpdfpoint{##1}{##2}%
-% \end{macrocdode}
-%\begin{changebar}
-% \begin{macrocode
\ifdim##3sp=\cb@pdfx\relax
\ifdim##4sp=\cb@pdfy\relax
-% \end{macrocdode}
-%\end{changebar}
-% \begin{macrocode
\ifdim##5=\cb@pdfz\relax
\else
\cb@error
@@ -1864,6 +1919,294 @@
\let\cb@resetpoints\relax
% \end{macrocode}
%
+% \begin{changebar}
+% \changes{v3.6e}{2023/08/13}{lua\TeX{} support added}
+% The code for lua\TeX{}, like for pdf\TeX\ and Xe\TeX,
+% is more elaborate as the calculations have to
+% be done in \TeX. |\cb@defpoint| will write information about the
+% coordinates of the point to the \file{.aux} file, from where it will
+% be picked up in the next run. Then we will construct the PDF
+% code necessary to draw the changebars.
+% \begin{macrocode}
+\or
+ \immediate\closeout\cb@writexy
+ \immediate\openin\cb@readxy=\jobname.cb2\relax
+% \end{macrocode}
+% \end{changebar}
+%
+% \begin{changebar}
+% \begin{macro}{\cb@pdfpoints}
+% \begin{macro}{\cb@pdfpagenr}
+% The |\cb@pdfpoints| macro contains the list of coordinates of points
+% that have been read in memory from the \file{.cb2} file. The
+% |\cb@pdfpagenr| macro contains the next pagecount to be read in.
+% \begin{macrocode}
+ \def\cb@pdfpoints{}
+ \def\cb@pdfpagenr{0}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{changebar}
+%
+% \begin{changebar}
+% \begin{macro}{\cb@findpdfpoint}
+% The |\cb@findpdfpoint| macro finds the coordinates of point \#1 on
+% pagecount \#2. First we expand the arguments to get the real values.
+% \begin{macrocode}
+ \def\cb@findpdfpoint##1##2{%
+ \edef\cb@temp
+ {\noexpand\cb@@findpdfpoint{\the##1}{\the##2}}%
+ \cb@temp
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{changebar}
+%
+% \begin{changebar}
+% \begin{macro}{\pdfliteral}
+% For lua\TeX{} we also mimick PDF\TeX's command |\pdfliteral|.
+% \begin{macrocode}
+ \def\pdfliteral##1{\pdfextension literal {##1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cb@@findpdfpoint}
+% The |\cb@@findpdfpoint| macro finds the coordinates of point \#1 on
+% pagecount \#2. If the information is not yet in memory is it read from
+% the \file{.cb2} file. The coordinates of the current point in the text
+% will be delivered in |\cb@pdfx| and |\cb@pdfy|, and |\cb@pdfz| will get
+% the x coordinate of the changebar. If the point is unknown, |\cb@pdfx|
+% will be set to |\relax|.
+% \begin{macrocode}
+ \def\cb@@findpdfpoint##1##2{%
+ \ifnum##2<\cb@pdfpagenr\relax\else
+ \cb@pdfreadxy{##2}%
+ \fi
+ \let\cb@pdfx\relax
+ \ifx\cb@pdfpoints\@empty\else
+ \ifnum##2<0\relax
+ \else
+ \edef\cb@temp{%
+ \noexpand\cb@pdffind{##1}{##2}\cb@pdfpoints\relax{}}%
+ \cb@temp
+ \fi
+ \fi
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{changebar}
+%
+% \begin{changebar}
+% \begin{macro}{\cb@pdffind}
+% The |\cb@pdffind| recursively searches through |\cb@pdfpoints| to find
+% point \#1 on pagecount \#2. |\cb@pdfpoints| contains entries of the
+% form\\
+% \meta{pointnr}.\meta{pagecount}p\meta{x},\meta{y},\meta{z}pt.
+% When the point is found it is removed from |\cb@pdfpoints|. \#9
+% contains the cumulative head of the list to construct the new list
+% with the entry removed. \#3--\#8 are for pattern matching.
+% \begin{macrocode}
+ \def\cb@pdffind##1##2##3.##4p##5,##6,##7pt##8\relax##9{%
+ \def\cb@next{%
+ \cb@pdffind{##1}{##2}##8\relax{##9##3.##4p##5,##6,##7pt}}%
+ \ifnum ##1=##3
+ \ifnum ##2=##4
+ \def\cb@pdfx{##5sp}%
+ \def\cb@pdfy{##6sp}%
+ \def\cb@pdfz{##7pt}%
+ \let\cb@next\relax
+ \gdef\cb@pdfpoints{##9##8}%
+ \fi
+ \fi
+ \ifx\relax##8\relax
+ \let\cb@next\relax
+ \fi
+ \cb@next
+ }%
+% \end{macrocode}
+% \end{macro}
+% \end{changebar}
+%
+% \begin{changebar}
+% \begin{macro}{\cb@pdfreadxy}
+% The |\cb@pdfreadxy| macro reads lines from the \file{.cb2} file in
+% |\cb@pdfpoints| until the pagecount is greater than \#1 or the end of
+% the file is reached. This ensures that all entries belonging to the
+% current column are in memory.
+% \begin{macrocode}
+ \def\cb@pdfreadxy##1{%
+ \let\cb@next\relax
+ \ifeof\cb@readxy
+ \global\let\cb@pdfpagenr\cb@maxpoint
+ \else
+ {\endlinechar=-1\read\cb@readxy to\cb@temp
+ \ifx\cb@temp\@empty\else
+ \expandafter\cb@pdfparsexy\cb@temp
+ \ifnum\cb@pdfpg<0\else
+ \xdef\cb@pdfpoints{\cb@pdfpoints\cb@temp}%
+ \cb@trace{PDFpoints=\cb@pdfpoints}%
+ \global\let\cb@pdfpagenr\cb@pdfpg
+ \fi
+ \ifnum\cb@pdfpg>##1\else
+ \global\def\cb@next{\cb@pdfreadxy{##1}}%
+ \fi
+ \fi
+ }%
+ \fi
+ \cb@next
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cb@pdfparsexy}
+% The |\cb@pdfparsexy| macro extracts the pagecount from an entry read in
+% from the \file{.cb2} file.
+% \begin{macrocode}
+ \def\cb@pdfparsexy##1.##2p##3,##4,##5pt{%
+ \def\cb@pdfpg{##2}}%
+% \end{macrocode}
+% \end{macro}
+% \end{changebar}
+%
+% \begin{changebar}
+% As PDF is not a programming language it does not have any variables to
+% remember the coordinates of the current point. Therefore we write the
+% information to the \file{.aux} file and read it in in the next run. We
+% write the x,y coordinates of the current point in the text and the x
+% coordinate of the change bar.
+% We also need the value of |\cb@pagecount| here, not during the write.
+% \begin{macrocode}
+ \def\cb@defpoint##1##2{%
+ \if@filesw
+ \begingroup
+ \edef\point{{\the##1}{\the\cb@pagecount}}%
+ \let\the=\z@
+ \savepos
+ \edef\cb@temp{\write\@auxout
+ {\string\cb@pdfxy\point
+ {\the\lastxpos}{\the\lastypos}{\the##2}}}%
+ \cb@temp
+ \endgroup
+ \fi
+ \cb@trace@defpoint##1##2%
+ }%
+% \end{macrocode}
+% \end{changebar}
+%
+% \begin{changebar}
+% \begin{macro}{\cb@cvtpct}
+% The macro |\cb@cvtpct| converts a percentage between 0 and 100 to a
+% decimal fraction.
+% \begin{macrocode}
+ \def\cb@cvtpct##1{%
+ \ifnum##1<0 0\else
+ \ifnum##1>99 1\else
+ \ifnum##1<10 0.0\the##1\else
+ 0.\the##1\fi\fi\fi}
+% \end{macrocode}
+% \end{macro}
+% \end{changebar}
+%
+% \begin{changebar}
+% \begin{macro}{\cb@pdf@scale}
+% \changes{v3.6a}{2018/02/03}{Added macro for scale factor}
+% In order to get things in the right spot we need a little scaling
+% factor. We define it here.
+% \begin{macrocode}
+\def\cb@pdf@scale{0.996264009963}
+% \end{macrocode}
+% \end{macro}
+%
+% The |\cb@connect| finds the coordinates of the begin and end points,
+% converts them to PDF units and draws the bar with |\pdfliteral|. It
+% also sets the color or gray level, if necessary. When any of the
+% points is unknown the bar is skipped and a rerun is signalled.
+% \begin{macrocode}
+ \def\cb@connect##1##2##3{%
+ \cb@findpdfpoint{##1}\cb@pagecount
+ \ifx\cb@pdfx\relax\cb@rerun
+ \else
+ \let\cb@pdftopy\cb@pdfy
+ \cb@findpdfpoint{##2}\cb@pagecount
+ \ifx\cb@pdfx\relax\cb@rerun
+ \else
+% \end{macrocode}
+% We do everything in a group, so that we can freely use all kinds of
+% registers.
+% \begin{macrocode}
+ \begingroup
+ \cb@dima=\cb@pdfz
+ \advance\cb@dima by-\cb@pdfx
+ \advance\cb@dima by1in%
+ \cb@dima=\cb@pdf@scale\cb@dima\relax
+% \end{macrocode}
+% First we let PDF save the graphics state. Then we generate the color
+% selection code followed by the code to draw the changebar. Finally the
+% graphics state is restored. We cannot use the color commands from the
+% color package here, as the generated PDF code may be moved to the next
+% line.
+% \begin{macrocode}
+ \ifx\cb@current@color\@undefined
+ \def\cb@temp{\cb@cvtpct\c@changebargrey}%
+ \pdfliteral{q \cb@temp\space g \cb@temp\space G}%
+ \else
+ \pdfliteral{q \cb@current@color}%
+ \fi
+ \edef\cb@temp{\expandafter\cb@removedim\the\cb@dima\space}%
+ \cb@dima=\cb@pdftopy
+ \advance\cb@dima-\cb@pdfy\relax
+ \cb@dima=\cb@pdf@scale\cb@dima\relax
+ ##3=\cb@pdf@scale##3\relax
+ \pdfliteral{\expandafter\cb@removedim\the##3 w
+ \cb@temp 0 m
+ \cb@temp \expandafter\cb@removedim\the\cb@dima\space l S Q}%
+ \endgroup
+% \end{macrocode}
+% We look up the two unused points to get them removed from |\cb@pdfpoints|.
+% \begin{macrocode}
+ \cb@cntb=##1\relax
+ \ifodd\cb@cntb\advance\cb@cntb 1\else\advance\cb@cntb -1\fi
+ \cb@findpdfpoint\cb@cntb\cb@pagecount
+ \cb@cntb=##2\relax
+ \ifodd\cb@cntb\advance\cb@cntb 1\else\advance\cb@cntb -1\fi
+ \cb@findpdfpoint\cb@cntb\cb@pagecount
+ \fi
+ \fi
+ \cb@trace@connect##1##2##3%
+ }%
+% \end{macrocode}
+% \end{changebar}
+%
+% \begin{changebar}
+% \begin{macro}{\cb@checkPdfxy}
+% The macro |\cb@checkPdfxy| checks if the coordinates of a point have
+% changed during the current run. If so, we need to rerun \LaTeX.
+% \begin{macrocode}
+ \gdef\cb@checkPdfxy##1##2##3##4##5{%
+ \cb@@findpdfpoint{##1}{##2}%
+ \ifdim##3sp=\cb@pdfx\relax
+ \ifdim##4sp=\cb@pdfy\relax
+ \ifdim##5=\cb@pdfz\relax
+ \else
+ \cb@error
+ \fi
+ \else
+ \cb@error
+ \fi
+ \else
+ \cb@error
+ \fi
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% For lua\TeX{} we don't need a limit on the number of bar points.
+% \begin{macrocode}
+ \def\cb@maxpoint{9999999}
+ \let\cb@resetpoints\relax
+% \end{macrocode}
+%\end{changebar}
+%
% When code for other drivers should be added it can be inserted
% here. When someone makes a mistake and somehow selects an
% unknown driver a warning is issued and the macros are defined to
@@ -1876,15 +2219,16 @@
\let\cb@resetpoints\relax
\fi
% \end{macrocode}
-% The last thing to do is to forget about |\cb@setup@specials|.
-% \begin{macrocode}
-\global\let\cb@setup@specials\relax}
-% \end{macrocode}
-% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
+% The last thing to do is to forget about |\cb@setup@specials|.
+% \begin{macrocode}
+\global\let\cb@setup@specials\relax}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\cbstart}
% The macro |\cbstart| starts a new changebar. It has an (optional)
% argument that will be used to determine the width of the bar.
diff --git a/macros/latex/contrib/changebar/changebar.ins b/macros/latex/contrib/changebar/changebar.ins
index 21a5332223..f9c86c4943 100644
--- a/macros/latex/contrib/changebar/changebar.ins
+++ b/macros/latex/contrib/changebar/changebar.ins
@@ -10,7 +10,7 @@
%%
%% IMPORTANT NOTICE:
%%
-%% Copyright (C) 1994-2018 Johannes Braams, All rights reserved.
+%% Copyright (C) 1994-2023 Johannes Braams, All rights reserved.
%%
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN
@@ -24,7 +24,7 @@
\preamble
This is a generated file.
-Copyright (C) 1994-2022 Johannes Braams, All rights reserved.
+Copyright (C) 1994-2023 Johannes Braams, All rights reserved.
This file was generated from file(s) of the changebar package.
--------------------------------------------------------------
diff --git a/macros/latex/contrib/changebar/changebar.pdf b/macros/latex/contrib/changebar/changebar.pdf
index bbe1281088..c12a901d4a 100644
--- a/macros/latex/contrib/changebar/changebar.pdf
+++ b/macros/latex/contrib/changebar/changebar.pdf
Binary files differ
diff --git a/macros/latex/contrib/xkeymask/README b/macros/latex/contrib/xkeymask/README
new file mode 100644
index 0000000000..2ac9e6099e
--- /dev/null
+++ b/macros/latex/contrib/xkeymask/README
@@ -0,0 +1,36 @@
+xkeymask v1.0
+-------------
+
+This package is an extension of the xkeyval package by Hendri Adriaens that offers additional macros for "masking" certain keys.
+
+See for more information the pdf documentation of this package.
+
+
+Installation
+------------
+
+CTAN:/macros/latex/contrib/xkeymask: official location
+ |
+ |- README : should not be installed
+ |- xkeymask.tex : should not be installed
+ |- xkeymask.pdf : /doc/latex/xkeymask
+ |- xkeymask.sty : /tex/latex/xkeymask
+
+See the documentation of your LaTeX distribution or the TeX Frequently Asked Questions for more information on installing xkeymask into your LaTeX distribution
+(https://texfaq.org/#installing).
+
+
+License
+-------
+
+Copyright (C) 2022-2023 Ramkumar Ramachandra
+
+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. The latest version of this license can be found at https://www.latex-project.org/lppl.txt.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer is Ramkumar Ramachandra.
+
+This work consists of the file xkeymask.sty.
+
+The following files constitute the xkeymask bundle and must be distributed as a whole: README, xkeymask.sty, xkeymask.tex, xkeymask.pdf.
diff --git a/macros/latex/contrib/xkeymask/xkeymask.pdf b/macros/latex/contrib/xkeymask/xkeymask.pdf
new file mode 100644
index 0000000000..bd52d93c26
--- /dev/null
+++ b/macros/latex/contrib/xkeymask/xkeymask.pdf
Binary files differ
diff --git a/macros/latex/contrib/xkeymask/xkeymask.sty b/macros/latex/contrib/xkeymask/xkeymask.sty
new file mode 100644
index 0000000000..492e55c5f2
--- /dev/null
+++ b/macros/latex/contrib/xkeymask/xkeymask.sty
@@ -0,0 +1,109 @@
+% xkeymask package by Ramkumar Ramachandra.
+%%
+%% --------------------------------------------
+%% Copyright (C) 2022-2023 Ramkumar Ramachandra
+%% --------------------------------------------
+%%
+%% 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. The latest version of this license
+%% can be found at:
+%% https://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions
+%% of LaTeX version 2008/05/04 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% This Current Maintainer is Ramkumar Ramachandra.
+%%
+%% This work consists of the file xkeymask.sty.
+%%
+%% The following files constitute the xkeymask bundle and
+%% must be distributed as a whole:
+%% README, xkeymask.sty, xkeymask.tex, xkeymask.pdf.
+%%
+\RequirePackage{kvoptions, xkeyval}
+\ProvidesPackage{xkeymask}[v1.0 An extension of xkeyval with a mask]
+
+% Option processing
+\newif\ifxkeymask@prefix
+\DeclareStringOption{prefix}
+\AddToKeyvalOption*{prefix}{\xkeymask@prefixtrue}
+\ProcessKeyvalOptions*
+
+\ifxkeymask@prefix
+ % We patch xkeyval's \setkeys to use a mask to ignore keys
+ \makeatletter
+ % Our global mask
+ \def\XKM@mask{}
+
+ % First we define \appendmask
+ \long\def\XKM@appendmask[#1]{
+ \XKV@for@o\XKV@fams\XKV@tfam{
+ \xdef\XKM@hdr{\XKV@prefix\XKV@tfam @}
+ \XKV@for@o{#1}\XKV@tempa{
+ % Remove spaces around key name
+ \expandafter\KV@@sp@def\expandafter\XKV@tempa\expandafter{\XKV@tempa}
+ \XKV@addtolist@x\XKM@mask{\XKM@hdr\XKV@tempa}
+ }
+ }
+ }
+ \def\appendmask{\XKV@testopta{\XKV@testoptc\XKM@appendmask}}
+
+ % Query the mask for a key
+ \long\def\XKM@ifinmask[#1]#2#3{
+ \XKV@checksanitizea{#1}\XKV@tempc
+ \XKV@for@o\XKV@fams\XKV@tfam{
+ \XKV@for@o\XKV@tempc\XKV@tempb{
+ \xdef\XKM@hdr{\XKV@prefix\XKV@tfam @}
+ \xdef\XKV@tempd{\XKV@prefix\XKV@tfam @\XKV@tempb}
+ \@expandtwoargs\in@\XKV@tempd\XKM@mask
+ \ifin@
+ #2
+ \else
+ #3
+ \fi
+ }
+ }
+ }
+ \def\ifinmask{\XKV@testopta{\XKV@testoptc\XKM@ifinmask}}
+
+ % A quick way to clear the mask
+ \def\clearmask{\global\let\XKM@mask\@empty}
+
+ % Now we override the definition of \XKV@setkeys
+ \long\def\XKM@setkeys[#1]#2{
+ \XKV@checksanitizea{#2}\XKV@resb
+ \let\XKV@resa\@empty
+ \XKV@for@o\XKV@fams\XKV@tfam{
+ \XKV@for@o\XKV@resb\XKV@tempb{
+ \expandafter\XKV@g@tkeyname\XKV@tempb=\@nil\XKV@tempc
+ % Remove spaces around key name
+ \expandafter\KV@@sp@def\expandafter\XKV@tempc\expandafter{\XKV@tempc}
+ \xdef\XKV@tempd{\XKV@prefix\XKV@tfam @\XKV@tempc}
+ % If \XKV@tempd is in \XKM@mask,
+ % remove the corresponding kv from \XKV@resb
+ \@expandtwoargs\in@\XKV@tempd\XKM@mask
+ \ifin@\else\XKV@addtolist@o\XKV@resa\XKV@tempb\fi
+ }
+ }
+ \ifnum\XKV@depth=\z@\let\XKV@rm\@empty\fi
+ \expandafter\XKV@s@tkeys\expandafter{\XKV@resa}{#1}
+ \let\CurrentOption\@empty
+ }
+
+ % A dispatcher to \XKM@setkeys or \XKV@setkeys
+ \long\def\XKM@setkeys@dispatch{
+ \xdef\XKV@tempa{\xkeymask@prefix @}
+ \ifx\XKV@prefix\XKV@tempa
+ \expandafter\XKM@setkeys
+ \else
+ \expandafter\XKV@setkeys
+ \fi
+ }
+
+ % Finally, override \setkeys itself to call the dispatcher
+ \def\setkeys{\XKV@testopta{\XKV@testoptc\XKM@setkeys@dispatch}}
+ \makeatother
+\fi
diff --git a/macros/latex/contrib/xkeymask/xkeymask.tex b/macros/latex/contrib/xkeymask/xkeymask.tex
new file mode 100644
index 0000000000..4f5e472f80
--- /dev/null
+++ b/macros/latex/contrib/xkeymask/xkeymask.tex
@@ -0,0 +1,123 @@
+% xkeymask package by Ramkumar Ramachandra.
+%%
+%% --------------------------------------------
+%% Copyright (C) 2022-2023 Ramkumar Ramachandra
+%% --------------------------------------------
+%%
+%% 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. The latest version of this license
+%% can be found at:
+%% https://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions
+%% of LaTeX version 2008/05/04 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% This Current Maintainer is Ramkumar Ramachandra.
+%%
+%% This work consists of the file xkeymask.sty.
+%%
+%% The following files constitute the xkeymask bundle and
+%% must be distributed as a whole:
+%% README, xkeymask.sty, xkeymask.tex, xkeymask.pdf.
+%%
+\documentclass[a4paper]{ltxdoc}
+\usepackage{minted, amsmath, framed}
+\usepackage[margin=0.8in]{geometry}
+\usepackage[prefix=bonak]{xkeymask}
+
+\makeatletter
+\define@cmdkey[bonak]{frame}{D}{(#1)}
+\define@cmdkey[bonak]{layer}{D}{(#1)}
+\define@cmdkey[bonak]{layer}{d}{(#1)}
+\define@cmdkey[bonak]{painting}{D}{(#1)}
+\define@cmdkey[bonak]{painting}{E}{(#1)}
+\define@cmdkey[bonak]{painting}{d}{(#1)}
+\makeatother
+
+\newcommand{\prim}[6]{
+ \ensuremath{\mathsf{{#1}}_{#2}^{#3,#4,#5}}
+ \setkeys*[bonak]{#1}{#6}}
+
+\newcommand{\framep}[5]{\prim{frame}{#1}{#2}{#3}{#4}{#5}}
+\newcommand{\layer}[5]{\prim{layer}{#1}{#2}{#3}{#4}{#5}}
+\newcommand{\painting}[5]{\prim{painting}{#1}{#2}{#3}{#4}{#5}}
+
+\newcommand{\eqnarg}[3]{\ifinmask[bonak]{#1}[#2]{\{#2:#3\}}{(#2:#3)}}
+\begin{document}
+\title{The \texttt{xkeymask} package}
+\author{Ramkumar Ramachandra}
+\maketitle
+This package is an extension of the \texttt{xkeyval} package by Hendri Adriaens that offers macros for ``masking'' certain keys, so that they are not used in certain places. The package was originally written for the purposes of the \href{https://github.com/artagnon/bonak}{bonak} project, for hiding certain keys in certain places, and has been released for a wider audience. The idea is that one first imports the package with a desired ``prefix'' in the document preamble, and then creates masks use at certain points in the document. The mask can also be queried or cleared at some later point. The main user interface is provided by the |\appendmask|, |\clearmask|, and |\ifinmask| commands. The following example:
+
+\begin{minted}{latex}
+ \documentclass{article}
+ \usepackage{amsmath}
+ \usepackage[prefix=bonak]{xkeymask}
+
+ \makeatletter
+ \define@cmdkey[bonak]{frame}{D}{(#1)}
+ \define@cmdkey[bonak]{layer}{D}{(#1)}
+ \define@cmdkey[bonak]{layer}{d}{(#1)}
+ \define@cmdkey[bonak]{painting}{D}{(#1)}
+ \define@cmdkey[bonak]{painting}{E}{(#1)}
+ \define@cmdkey[bonak]{painting}{d}{(#1)}
+ \makeatother
+
+ \newcommand{\prim}[6]{
+ \ensuremath{\mathsf{{#1}}_{#2}^{#3,#4,#5}}
+ \setkeys*[bonak]{#1}{#6}}
+
+ \newcommand{\framep}[5]{\prim{frame}{#1}{#2}{#3}{#4}{#5}}
+ \newcommand{\layer}[5]{\prim{layer}{#1}{#2}{#3}{#4}{#5}}
+ \newcommand{\painting}[5]{\prim{painting}{#1}{#2}{#3}{#4}{#5}}
+
+ \newcommand{\eqnarg}[3]{\ifinmask[bonak]{#1}[#2]{\{#2:#3\}}{(#2:#3)}}
+
+ \begin{document}
+ With mask:
+ \appendmask[bonak]{layer}[D]
+ \appendmask[bonak]{painting}[D,E]
+ \appendmask[bonak]{cohfiller}[c]
+ \begin{align*}
+ \eqnarg{cohlayer}{d}{\framep{m}{n}{p}{q}{D=D}} \\
+ \eqnarg{cohlayer}{l}{\layer{m}{n}{p}{q}{D=D, d=d}} \\
+ \eqnarg{cohfiller}{c}{\painting{m}{n}{p}{q}{D=D, E=E, d=d}} \\
+ \end{align*}
+ Without mask:
+ \clearmask
+ \begin{align*}
+ \eqnarg{cohlayer}{d}{\framep{m}{n}{p}{q}{D=D}} \\
+ \eqnarg{cohlayer}{l}{\layer{m}{n}{p}{q}{D=D, d=d}} \\
+ \eqnarg{cohfiller}{c}{\painting{m}{n}{p}{q}{D=D, E=E, d=d}} \\
+ \end{align*}
+ \end{document}
+\end{minted}
+
+\newpage
+produces the following output:
+
+\begin{framed}
+ With mask:
+ \appendmask[bonak]{layer}[D]
+ \appendmask[bonak]{painting}[D,E]
+ \appendmask[bonak]{cohfiller}[c]
+ \begin{align*}
+ \eqnarg{cohlayer}{d}{\framep{m}{n}{p}{q}{D=D}} \\
+ \eqnarg{cohlayer}{l}{\layer{m}{n}{p}{q}{D=D, d=d}} \\
+ \eqnarg{cohfiller}{c}{\painting{m}{n}{p}{q}{D=D, E=E, d=d}} \\
+ \end{align*}
+ Without mask:
+ \clearmask
+ \begin{align*}
+ \eqnarg{cohlayer}{d}{\framep{m}{n}{p}{q}{D=D}} \\
+ \eqnarg{cohlayer}{l}{\layer{m}{n}{p}{q}{D=D, d=d}} \\
+ \eqnarg{cohfiller}{c}{\painting{m}{n}{p}{q}{D=D, E=E, d=d}} \\
+ \end{align*}
+\end{framed}
+
+\section*{Full source code listing}
+\inputminted{latex}{xkeymask.sty}
+\end{document}