texlive[74794] Master/texmf-dist: censor (30mar25)
commits+karl at tug.org
commits+karl at tug.org
Sun Mar 30 22:33:14 CEST 2025
Revision: 74794
https://tug.org/svn/texlive?view=revision&revision=74794
Author: karl
Date: 2025-03-30 22:33:14 +0200 (Sun, 30 Mar 2025)
Log Message:
-----------
censor (30mar25)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/censor/censor.pdf
trunk/Master/texmf-dist/doc/latex/censor/censor.tex
trunk/Master/texmf-dist/tex/latex/censor/censor.sty
Modified: trunk/Master/texmf-dist/doc/latex/censor/censor.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/censor/censor.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/censor/censor.tex 2025-03-30 20:33:06 UTC (rev 74793)
+++ trunk/Master/texmf-dist/doc/latex/censor/censor.tex 2025-03-30 20:33:14 UTC (rev 74794)
@@ -654,22 +654,28 @@
\blackout{|Today's date is \expanded{\today}.|\\%
Today's date is \expanded{\today}.}
-If a control sequence is not expandable, then there is no way to
- censor its \textit{output}.
+If a control sequence is not expandable, then there is, in general, no way to
+ censor its \textit{output}.\footnote{%
+In some cases, such as
+ \texttt{\string\maketitle}, you can define
+ \texttt{\detokenize{\author{\censor{...}}}} in the preamble, to bring
+ about the effect, even if \texttt{\string\maketitle} falls within a
+ \texttt{\string\blackout} argument.
+}
Therefore, you have two options: you can remove it (and its arguments)
- from the blackout altogether, or else you can leave it (and its arguments)
- in the blackout, but ``escape'' them between $|$ escape character
- delimiters.
+ from the blackout altogether, or else you can leave it
+ in the blackout, but ``escape'' its non-typeset arguments between $|$ escape
+ character delimiters.
In either case, however, the output of the unexpandable macro will be
- visible to the reader, as in the example below, where the macro
- \verb|\ref| and its argument are escaped from the blackout.
+ visible to the reader, as in the example below, where the arguments to the
+ macro \verb|\ref| are escaped from the blackout.
%\settcEscapechar{|}
-\verb+\blackout{In Section |\ref{S:A}|, we discuss censored macros}+\\
+\verb+\blackout{In Section \ref|{S:A}|, we discuss censored macros}+\\
\StopCensoring
-\blackout{In Section |\ref{S:A}|, we discuss censored macros}\\
+\blackout{In Section \ref|{S:A}|, we discuss censored macros}\\
\RestartCensoring
-\blackout{In Section |\ref{S:A}|, we discuss censored macros}
+\blackout{In Section \ref|{S:A}|, we discuss censored macros}
\section{Can I Censor Math?}
Modified: trunk/Master/texmf-dist/tex/latex/censor/censor.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/censor/censor.sty 2025-03-30 20:33:06 UTC (rev 74793)
+++ trunk/Master/texmf-dist/tex/latex/censor/censor.sty 2025-03-30 20:33:14 UTC (rev 74794)
@@ -1,6 +1,6 @@
% censor.sty
-\def\censorversionnumber{4.4}
-\def\censorversiondate{2025/03/18}
+\def\censorversionnumber{4.5}
+\def\censorversiondate{2025/03/30}
\ProvidesPackage{censor}
[\censorversiondate\ \censorversionnumber\
Provides capability for redaction of sensitive information]
@@ -34,7 +34,7 @@
\newcommand\@cenlen[1]{\censorrule{#1 ex}}
\newcommand\@cenword[1]{\censorrule{\widthofpbox{#1}}}
-\newcommand\un at censor{\@ifstar{\un at cenlen}{\un at cenword}}
+\DeclareRobustCommand\un at censor{\@ifstar{\un at cenlen}{\un at cenword}}
\newcommand\un at cenlen[1]{\protect\underline{\hspace{#1 ex}}}
\newcommand\un at cenword[1]{#1}
@@ -46,8 +46,8 @@
}
\newcommand\RestartCensoring{%
\censortrue%
- \renewcommand\censor{\@ifstar{\@cenlen}{\@cenword}}%
- \renewcommand\censorbox{\@ifstar{\censor at dim}{\censor at box}}%
+ \DeclareRobustCommand\censor{\@ifstar{\@cenlen}{\@cenword}}%
+ \DeclareRobustCommand\censorbox{\@ifstar{\censor at dim}{\censor at box}}%
\let\censpace\sv at censpace%
}
@@ -222,7 +222,7 @@
\newcommand\censor at box[2][]{#1\setbox0\hbox{#2}%
\rule[-\the\dp0]{\the\wd0}{\the\ht0+\the\dp0}}
-\newcommand\un at censorbox{\@ifstar{\un at censor@dim}{\un at censor@box}}
+\DeclareRobustCommand\un at censorbox{\@ifstar{\un at censor@dim}{\un at censor@box}}
\newcommand\un at censor@dim[4][]{{#1%
\fbox{\rule[-#4\baselineskip]{0ex}{#3\baselineskip}
\rule{#2ex}{0ex}}}}
@@ -265,3 +265,4 @@
\StopCensoring and set true via \RestartCensoring. Thus, the current
state of censoring can be determined by the user.
4.4 - Now supports the use of unicode characters within the pdflatex engine.
+4.5 - Robustified use of \StopCensoring and \RestartCensoring
More information about the tex-live-commits
mailing list.