From 0b4ca5651a82505c8ca208424642dfa9fdcd3464 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 15 Nov 2018 22:21:25 +0000 Subject: censor (15nov18) git-svn-id: svn://tug.org/texlive/trunk@49168 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/censor/censor.pdf | Bin 190376 -> 201874 bytes Master/texmf-dist/doc/latex/censor/censor.tex | 48 ++++++++++++++++++++++++-- Master/texmf-dist/tex/latex/censor/censor.sty | 12 ++++--- 3 files changed, 54 insertions(+), 6 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/censor/censor.pdf b/Master/texmf-dist/doc/latex/censor/censor.pdf index 807fa99be10..6a85c480ddf 100644 Binary files a/Master/texmf-dist/doc/latex/censor/censor.pdf and b/Master/texmf-dist/doc/latex/censor/censor.pdf differ diff --git a/Master/texmf-dist/doc/latex/censor/censor.tex b/Master/texmf-dist/doc/latex/censor/censor.tex index b8425a92d34..1348942afa7 100644 --- a/Master/texmf-dist/doc/latex/censor/censor.tex +++ b/Master/texmf-dist/doc/latex/censor/censor.tex @@ -1,9 +1,12 @@ \documentclass{article} -\usepackage{segletes} +\usepackage{verbatimbox,xcolor} \usepackage{censor} \parindent 0in \parskip 1em +\makeatletter +\long\def\bl@t#1#2{\ifx\bpar#2\par\else\ifx.#2\censordot\else\censor{#2}\fi\fi#1} +\makeatother \begin{document} @@ -549,7 +552,7 @@ have periods appear in the censored output, the definition 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 @@ Censoring may be dynamically turned off and on in a document with the 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 @@ such that subsequent reference is done indirectly:\\ 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} diff --git a/Master/texmf-dist/tex/latex/censor/censor.sty b/Master/texmf-dist/tex/latex/censor/censor.sty index 2cf837b0d94..49e11906198 100644 --- a/Master/texmf-dist/tex/latex/censor/censor.sty +++ b/Master/texmf-dist/tex/latex/censor/censor.sty @@ -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@t, to handle macros like \% \usepackage{pbox} \usepackage{ifnextok} @@ -73,7 +74,10 @@ % \def\bl@t#1#2{\censor{#2}#1} % V2.10 DEFINITION (MADE \long IN V3.1): -\long\def\bl@t#1#2{\if\bpar#2\par\else\if.#2\censordot\else\censor{#2}\fi\fi#1} +%\long\def\bl@t#1#2{\if\bpar#2\par\else\if.#2\censordot\else\censor{#2}\fi\fi#1} + +% V3.22 DEFINITION +\long\def\bl@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@t#1#2{% - \if\par#2% + \ifx\par#2% \par\def\@justpar{T}% \else% \if T\@justspace% -- cgit v1.2.3