texlive[49168] Master/texmf-dist: censor (15nov18)
commits+karl at tug.org
commits+karl at tug.org
Thu Nov 15 23:21:25 CET 2018
Revision: 49168
http://tug.org/svn/texlive?view=revision&revision=49168
Author: karl
Date: 2018-11-15 23:21:25 +0100 (Thu, 15 Nov 2018)
Log Message:
-----------
censor (15nov18)
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 2018-11-15 22:21:11 UTC (rev 49167)
+++ trunk/Master/texmf-dist/doc/latex/censor/censor.tex 2018-11-15 22:21:25 UTC (rev 49168)
@@ -1,9 +1,12 @@
\documentclass{article}
-\usepackage{segletes}
+\usepackage{verbatimbox,xcolor}
\usepackage{censor}
\parindent 0in
\parskip 1em
+\makeatletter
+\long\def\bl at t#1#2{\ifx\bpar#2\par\else\ifx.#2\censordot\else\censor{#2}\fi\fi#1}
+\makeatother
\begin{document}
@@ -549,7 +552,7 @@
can be redefined as a blank space, as a null character, or something
else, at the users' discretion.
-\section{Summary \& Miscellany}
+\section{Usage Summary}
The complete set of commands available to the \textsf{censor} package,
to bring about text redaction, are:\\
@@ -589,6 +592,10 @@
use of the \verb|\StopCensoring| and \verb|\RestartCensoring| commands,
respectively. The default is censoring `on.'
+\subsection{\textit{Caveat Emptor}}
+
+Here is some added information that users of the package should know.
+
I have found that, in certain cases (for example, with captions created
using the \textsf{boxhandler} package), the censorbox command needs to
be protected by way of \verb|\protect\censorbox{...}|.
@@ -607,6 +614,43 @@
justification, because censored words are never hyphenated across line
boundaries, whereas the original text may have been.)
+Because the censor algorithm's
+ digest one token at a time, you have to be careful if
+ macros appear in the arguments to a \verb|\censor|,
+ \verb|\blackout|, or \verb|\xblackout|.
+In particular, you have to locate the macro \textit{and its arguments}
+ in a group, for example,
+ \verb|\blackout{In equation {\ref{eq:A}},| \verb|you will see...}|.
+The extra braces around \verb|\ref| and its argument are required
+ so that the censoring algorithm does not try to absorb the macro
+ without also absorbing its argument(s).
+
+Users have asked for color support in the package.
+I do not wish to hardwire color into the package---however,
+ if the \textsf{xcolor} package is loaded,
+ the following preamble definition will force censoring to be
+ in the selected color (in this example, red):
+
+\verb| \def\censorcolor{red}|\\
+\verb| \let\svcensorrule\censorrule|\\
+\verb| \renewcommand\censorrule[1]{%|\\
+\verb| \textcolor{\censorcolor}{\svcensorrule{#1}}}|
+
+Let's see if it works:
+
+{\let\svcensorrule\censorrule
+\renewcommand\censorrule[1]{\textcolor{red}{\svcensorrule{#1}}}
+\addtolength\leftskip{2.3em}
+Is this blacked out text censored in red?\\
+\blackout{Is this blacked out text censored in red?}\par}
+
+This technique can be used at the user's discretion to provide color
+ censoring.
+The value of \verb|\censorcolor| can be redefined on the fly to change
+ the color of the censoring.
+
+\section{Source Code}
+
The source code for \textsf{censor} is so short as to be included below:
\verbatiminput{censor.sty}
Modified: trunk/Master/texmf-dist/tex/latex/censor/censor.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/censor/censor.sty 2018-11-15 22:21:11 UTC (rev 49167)
+++ trunk/Master/texmf-dist/tex/latex/censor/censor.sty 2018-11-15 22:21:25 UTC (rev 49168)
@@ -1,7 +1,7 @@
% censor.sty
-\def\censorversionnumber{3.21}
+\def\censorversionnumber{3.22}
\ProvidesPackage{censor}
-[2013/06/24 \censorversionnumber
+[2018/11/15 \censorversionnumber
Provides capability for redaction of sensitive information]
%
@@ -29,6 +29,7 @@
% 3.20 - Specify depth/height of censor rule. Introduced \def\censordot{}
% 3.21 - Fixed bug regarding \xblackout rules remaining after a
% \StopCensoring
+% 3.22 - changed `\if to \ifx in definition of \bl at t, to handle macros like \%
\usepackage{pbox}
\usepackage{ifnextok}
@@ -73,8 +74,11 @@
% \def\bl at t#1#2{\censor{#2}#1}
% V2.10 DEFINITION (MADE \long IN V3.1):
-\long\def\bl at t#1#2{\if\bpar#2\par\else\if.#2\censordot\else\censor{#2}\fi\fi#1}
+%\long\def\bl at t#1#2{\if\bpar#2\par\else\if.#2\censordot\else\censor{#2}\fi\fi#1}
+% V3.22 DEFINITION
+\long\def\bl at t#1#2{\ifx\bpar#2\par\else\if.#2\censordot\else\censor{#2}\fi\fi#1}
+
%\def\bpar{_} %V3.00 DEFINITION
\let\bpar\par %AS OF V3.1, CAN HANDLE \par
@@ -106,7 +110,7 @@
\def\@afterspacelap{\llap{\censorrule{\afterspacelap}}}
\long\def\xbl at t#1#2{%
- \if\par#2%
+ \ifx\par#2%
\par\def\@justpar{T}%
\else%
\if T\@justspace%
More information about the tex-live-commits
mailing list