texlive[61389] Master/texmf-dist: censor (23dec21)

commits+karl at tug.org commits+karl at tug.org
Thu Dec 23 22:33:04 CET 2021


Revision: 61389
          http://tug.org/svn/texlive?view=revision&revision=61389
Author:   karl
Date:     2021-12-23 22:33:04 +0100 (Thu, 23 Dec 2021)
Log Message:
-----------
censor (23dec21)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/censor/README
    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/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/censor/README	2021-12-23 21:32:49 UTC (rev 61388)
+++ trunk/Master/texmf-dist/doc/latex/censor/README	2021-12-23 21:33:04 UTC (rev 61389)
@@ -23,3 +23,8 @@
 V3.2 allows control over the characteristics (depth and height) of the
 censor blackout rule.  It also gives additional control on how to handle
 the censoring of periods.
+
+v4.0 overhauls the token censoring approach to incorporate tools from
+the tokcycle package, to provide more flexibility when censored material
+contains macros.
+

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	2021-12-23 21:32:49 UTC (rev 61388)
+++ trunk/Master/texmf-dist/doc/latex/censor/censor.tex	2021-12-23 21:33:04 UTC (rev 61389)
@@ -4,9 +4,6 @@
 
 \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}
 
@@ -15,7 +12,7 @@
 \LARGE The \textsf{censor} Package\\
 \small \rule{0in}{1em}Tools for Producing Redacted Documents\\
 \large \rule{0in}{2em} Steven B. Segletes\\
-steven.b.segletes.civ at mail.mil\\
+SSegletes at verizon.net\\
 \rule{0em}{2em}\today\\
 v\censorversionnumber
 \end{center}
@@ -196,7 +193,8 @@
 
 }
 
-Additionally, as of version 2.0, there is provided a block-censor
+
+As of version 2.0, there is provided a block-censor
 capability, for redacting larger blocks of text.  This new command
 is \verb|\blackout|, and is used in the form 
 \verb|\blackout{Block of text}|.  This nice thing about this command is
@@ -219,87 +217,106 @@
 \blackout{%
 The Liberty missile, with charge diameter (CD) of 
 80~mm, revealed a penetration capability of 1.30, 1.19, and 
-1.37~CD in three recent tests into armor steel.
-\bpar
-New paragraph.}
+1.37~CD in three recent tests into armor steel. xxx
 
+New paragraph.
+}
+
 \hrulefill
 
 }
 
-There is a caveat regarding the use of \verb|\blackout|.  
-The argument cannot end on so-called ``glue,'' such as a space
-or a carriage return.  The following examples are, thus, bad forms of
-the \verb|\blackout| command:
+Prior to V4.0, \verb|\blackout| did not conveniently work across 
+  environment boundaries, such as math or tabular mode.  
+One inconvenient option had been to \verb|\censor| text in the \texttt{tabular},
+  cell by cell.
+Alternatively, to blackout the whole tabular environment, you should use
+  the \verb|\censorbox| command as has been shown.
+Presently, there is a third option---to censor cell-by-cell using a
+  shorthand notation.
 
-\verb|\blackout{Ends in space.  Bad form }|
+The \verb|\blackout| macro now allows uncensored content to be \textit{escaped}
+  from its argument by delimiting it between \verb+|...|+ bars.
+Thus, the censoring directive \verb+\blackout{This |is a| test}+ renders as
+  \blackout{This |is a| test}.
 
-\verb|\blackout{Ends in carriage return.  Bad form|\\
-\verb|}|
+\begingroup
 
-Secondly, periods are not censored (as of version 2.1).  This is done
-because it is necessary to preserve the period-space combination that
-signifies end-of-sentence.  In this way, {\LaTeX} can preserve
-inter-word spacing in the redacted version that is identical to the
-unredacted version.
+\begin{verbatim}
+\blackout{
+|\begin{tabular}{|c|c|}
+\hline
+Title 1  & Title 2 \\
+\hline
+|a| & |bbb|\\
+|cc| & dd\\
+\hline
+\end{tabular}|
+}
+\end{verbatim}
 
-Thirdly, \verb|\blackout| does not work across environment boundaries,
-such as math or tabular mode.  You can blackout text in the table, cell
-by cell; But you cannot blackout the whole tabular environment with the
-\verb|\blackout| command (instead, you should use the \verb|\censorbox|
-command for tabular environments).
+\blackout{
+|\begin{tabular}{|c|c|}
+\hline
+Title 1  & Title 2 \\
+\hline
+|a| & |bbb|\\
+|cc| & dd\\
+\hline
+\end{tabular}|
+}
+\StopCensoring
+\blackout{
+|\begin{tabular}{|c|c|}
+\hline
+Title 1  & Title 2 \\
+\hline
+|a| & |bbb|\\
+|cc| & dd\\
+\hline
+\end{tabular}|
+}
 
-Finally, the argument to \verb|\blackout| can employ tokens; However,
-the tokens are expanded into one large blackout, regardless of whether
-the expanded token contains spaces.  Thus
+\endgroup
 
-\verb|\blackout{\today}|
 
-becomes \blackout{\today}, in spite of the fact that \verb|\today|,
-given at the moment by \today, contains spaces.
+\noindent**v4.0 CHANGE**:
+The restriction on \verb|\blackout| \textit{not} ending on glue
+  is no longer applicable.
 
+Finally, the argument to \verb|\blackout| can, in limited situations,
+  process macros; However,
+  the macros are not expanded by default.
+See section~\ref{S:A} for details on what is possible with respect to
+  the censoring of macro content with this package.
+
+
 The author received some negative feedback concerning the appearance
-resulting from a \verb|\blackout| command.  Generally, people did not
-like the fact that spaces were not blacked out, whether it was a concern
-over security or merely cosmetic.  To this end, the \verb|\xblackout|
-command is introduced in V3.10, which blacks out the text more
-completely, while simultaneously preserving the layout indentical to
-that of the uncensored document.
+  resulting from a \verb|\blackout| command.  Generally, people did not
+  like the fact that spaces were not blacked out.  
+To this end, the \verb|\xblackout| command is introduced in V3.10, which 
+  \textit{cosmetically} blacks out the text more completely
+  (note, however, that underneath the more complete blackout are still
+  the word-length blackouts that otherwise compose \verb|\blackout|).
 
-The additional blacking-out of the \verb|\xblackout| macro is controlled
-by five resettable lengths which lap additional blacking atop the
-result of \verb|\blackout|.  By default, these lengths are defined as:
+As of v4.0 of the package, 
+  the additional blacking-out of the \verb|\xblackout| macro is controlled
+  by one resettable length which laps additional blacking atop the
+  result of \verb|\blackout|.  
+This length is defined in the macro \verb|\spacelap|, with
+  a default value of \spacelap.
 
-\verb|\periodrlap = 1.6ex|\\
-\verb|\afterperiodlap = 1.2ex|\\
-\verb|\lletterlap = 0.55ex|\\
-\verb|\rletterlap = 0.55ex|\\
-\verb|\afterspacelap = 0.0ex|
+During \verb|\xblackout|, a
+  right- and left-lapped blacking of dimension \verb|\spacelap| is
+  applied before and after each space character, respectively.
 
-The length \verb|\periodrlap| is the length of right-lapped blackout
-applied just before printing a period.  Thus, this blacking is intended
-to cover the period not treated by \verb|\blackout|.  The length
-\verb|\afterperiodlap| is a left-lapped blackout applied just prior to
-word following a period.  Its intent is to back-cover the extra-wide
-spacing that follows a period.  The length \verb|\lletterlap| is the
-left-lapped blacking applied before a character.  It will help cover
-inter-word space if \verb|\afterspacelap| is not employed.  The length
-\verb|\rletterlap| is the right-lapped blacking applied after a
-character, which as with \verb|\lletterlap|, can help cover inter-word
-spacing if \verb|\afterspacelap| is not employed.  Finally, there is 
-\verb|\afterspacelap| which, if employed, is a left-lapped blacking
-applied before the character that follows a space.
-
 The blacking from \verb|\xblackout| is intended to be less ``choppy''
 than that of \verb|\blackout|.  However, it too has some drawbacks.  The
-x-blacking will extend past the left and right margins.  If a line of
-output ends on a period (as we show in our example below), that line and
-the beginning of the next line may have their blacked-out margins not in
-uniformity with other lines, based on the settings of the various
-lapping lengths employed.  If \verb|\periodrlap| is too large, it could
-blackout subsequent text in an unintended way.  With all these caveats,
-it may still be found preferable to \verb|\blackout|, as shown in the
-example below.
+x-blacking will extend past the margin(s).  It is also
+possible that not all margin extensions will be uniform in size.
+With all these caveats,
+it may still be found preferable to the \verb|\blackout| macro, as 
+  shown in the example below.
 
 {\addtolength{\leftskip}{2.3em}
 UNCENSORED RESTRICTED SOURCE: \hrulefill
@@ -318,7 +335,7 @@
 The Liberty missile, with charge diameter (CD) of 
 80~mm, revealed a penetration capability of 1.30, 1.19, and 
 1.37~CD in recent testing here.  The tests were into armor steel.
-\bpar
+
 New paragraph} with open text.
 
 CENSORED UNRESTRICTED OUTPUT (\verb|\blackout{}|): \hrulefill
@@ -327,7 +344,7 @@
 The Liberty missile, with charge diameter (CD) of 
 80~mm, revealed a penetration capability of 1.30, 1.19, and 
 1.37~CD in recent testing here.  The tests were into armor steel.
-\bpar
+
 New paragraph} with open text.
 
 CENSORED UNRESTRICTED OUTPUT (\verb|\xblackout{}|): \hrulefill
@@ -336,7 +353,7 @@
 The Liberty missile, with charge diameter (CD) of 
 80~mm, revealed a penetration capability of 1.30, 1.19, and 
 1.37~CD in recent testing here.  The tests were into armor steel.
-\bpar
+
 New paragraph} with open text.
 
 \hrulefill
@@ -365,15 +382,15 @@
 \verb|\def\Size{\censor*{2}}|\\
 \verb|\def\TableOne{\censorbox*[\small]{26}{5}{3.5}}|\\
 \verb||\\
-\verb|The {\Missile} missile, with charge diameter (CD) of|\\
-\verb|{\Size}~mm, revealed a penetration capability ranging from|\\
+\verb|The \Missile{} missile, with charge diameter (CD) of|\\
+\verb|\Size~mm, revealed a penetration capability ranging from|\\
 \verb|1.19--1.37~CD in three recent tests into armor steel, as|\\
 \verb|detailed in Table 1.|\\
 \verb||\\
 \verb|\begin{table}[ht]|\\
 \verb|\begin{center}|\\
-\verb|\textbf{Table 1. {\Missile} Missile Test Data}\\|\\
-\verb|{\TableOne}|\\
+\verb|\textbf{Table 1. \Missile{} Missile Test Data}\\|\\
+\verb|\TableOne{}|\\
 \verb|\end{center}|\\
 \verb|\end{table}|\\
 
@@ -414,7 +431,7 @@
 
 Because the redaction width is only approximate, it is possible that the
 censored and uncensored originals might have differing text
-justification.  In the text, the curly braces are placed around the
+justification.  In the text, the curly braces may be added after the
 keyword identifiers so as to produce the proper interaction with the
 surrounding whitespace and punctuation.
 
@@ -528,6 +545,71 @@
 commands, discussed in the prior section, are used in this mode, where
 the source file is in an unsecure environment.
 
+\section{Can I Censor Control Sequences?\label{S:A}}
+
+In general, the \textsf{censor} package is designed to operate on
+  literal text.
+This is especially true if you are using the \verb|\censor| macro, which
+  is designed for use on a single word, rather than extended text.
+However, it is also clear that an extended text passage may contain 
+  various macro markup, for example, italic phrases.
+
+The \verb|\blackout| and \verb|\xblackout| macros can at least digest
+  control sequences in the input-text stream.
+How the sequences are handled will require some user intervention.
+By default, these macros will be echoed into the output stream in a literal
+  (unexpanded) form.
+
+Consider the following line of \LaTeX{} code:
+
+\verb|This is \textit{italic text}|\\
+\blackout{|This is \textit{italic text}|\\This is \textit{italic text}}
+
+It would normally render as in the 2nd line.  
+When included as part of the \verb|\blackout| argument, it renders as the
+  3rd line.
+The \verb|\textit| is still part of the blackout rendering, but the 
+  \textit{input} to \verb|\textit| has been censored and the
+  censor rule does not change its presented shape under the influence
+  of \verb|\textit|.
+
+Some macros, however, expand to literal text.
+Because they are, by default, carried literally into the output, they
+  will only expand into text \textit{after} the censoring has been 
+  applied.
+Consider the following line of \LaTeX{} code:
+
+\verb|Today's date is \today.|\\
+\blackout{|Today's date is \today.|\\Today's date is \today.}
+
+If the macro is expandable (and not all are), the \verb|\blackout| 
+  and \verb|\xblackout| macros are set up to intercept callouts to
+  the primitive \verb|\expanded| and act upon them prior to censoring.
+Therefore, with one small change to the above example, the problem
+  can be remedied:
+
+\verb|Today's date is \expanded{\today}.|\\
+\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}.
+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.
+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.
+
+%\settcEscapechar{|}
+\verb+In Section |\ref{S:A}|, we discuss censored macros+\\
+\StopCensoring
+\blackout{In Section |\ref{S:A}|, we discuss censored macros}\\
+\RestartCensoring
+\blackout{In Section |\ref{S:A}|, we discuss censored macros}
+
+
 \section{Censor Marks}
 
 The censor (blacking) mark is a \verb|\rule| which has a depth
@@ -540,17 +622,14 @@
 \verb|   \censorruleheight=|length
 \upshape
 
-In addition, it was mentioned that periods are not censored, so as to
-preserve the ability of \LaTeX{} to produce censored output of
-\textit{identical} spacing to the uncensored output.  If, however, the
-preservation of space is not essential, and the user does not wish to
-have periods appear in the censored output, the definition
-\verb|\censordot|, by default
+When using \verb|\blackout| and \verb|\xblackout|, periods are 
+  now censored by default.
+If, however, you wish the prior approach of not censoring periods,
+  you may redefine \verb|\censordot| to something else, for example,
 
-\verb|   \def\censordot{.}|
+\verb|   \renewcommand\censordot{.}|
 
-can be redefined as a blank space, as a null character, or something
-else, at the users' discretion.
+to make them visible in the censored document.
 
 \section{Usage Summary}
 
@@ -558,19 +637,18 @@
 to bring about text redaction, are:\\
 {~\\
 \verb|   \censor{|\it text\tt\}\\
-\verb|   \censor*{|\it width mult.\tt\}\\
+\verb|   \censor*{|\it width multiplier\tt\}\\
 \verb|   \censorbox[|\it pre-commands\tt]\{\it object box\tt\}\\
 \verb|   \censorbox*[|\it pre-commands\tt]\{\it width mult.\tt\}\{\it 
 height mult.\tt\}\{\it depth mult.\tt\}\\
 \verb|   \blackout{|\it extended text passage\tt\}\\
 \verb|   \xblackout{|\it extended text passage\tt\}\\
-\verb|   \bpar| \rmfamily\upshape(\it retained for backward compatibility
-              only\upshape)\\
 \verb|   \StopCensoring|\\
 \verb|   \RestartCensoring|\\
 \verb|   \censorruledepth=|\it length\\
 \verb|   \censorruleheight=|length\\
-\verb|   \def\censordot{.| \upshape or \it character\tt\}\\
+\verb|   \renewcommand\spacelap{|\it length\tt\}\\
+\verb|   \renewcommand\censordot{|\it token or instruction\tt\}\\
 ~\\}
 The star ({\tt*}) version of the commands is envisioned when the source
 document is being created in an unsecure environment, whereas, the
@@ -585,9 +663,6 @@
 pre-commands will typically be fontsize commands, so that measurements
 of ex's and \verb|\baselineskip| are done in a relevant fontsize.
 
-The \verb|\bpar| command is no longer needed, as of V3.10.  It is now
-made equivalent to \verb|\par|.
-
 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.'  
@@ -596,36 +671,50 @@
 
 Here is some added information that users of the package should know.
 
-I have found that, in certain cases (for example, with captions created
+\begin{itemize}
+
+\item As of package version v4.0, the token-cycling pseudo-environments of the
+  \textsf{tokcycle} package were used to process the tokens of 
+  the \verb|\blackout| and \verb|\xblackout| macros.
+While the syntax of these macros is unchanged, one has the additional
+  option of invoking them using the pseudo-environment syntax of
+  \textsf{tokcycle} as
+
+\verb|\blackoutenv Text to blackout\endblackoutenv|:\\
+\blackoutenv Text to blackout\endblackoutenv{} and\\
+\verb|\xblackoutenv Text to blackout\endxblackoutenv|:\\
+\xblackoutenv Text to blackout\endxblackoutenv.
+
+\item Because \verb|\blackout| and \verb|\xblackout| use 
+  tokcycle-package environments to perform their actions, the
+  macro \verb|\settcEscapechar| can be used to reset the escape 
+  character to something other than $|$, in accordance with 
+  the documented \textsf{tokcycle}-package commands.
+
+
+\item 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{...}|.
+be protected by way of \verb|\protect\blackout{...}|.
 
-It is preferable not to apply \verb|\censor| to whitespace, or text
+\item It is preferable not to apply \verb|\censor| to whitespace, or text
 justification could be adversely affected.  If one wishes to censor a
 multi-word phrase, such as ``Little Bo Peep,'' it is recommended to do
 it as follows:\\
-\verb|   \blackout{Little Bo Peep}|\\
+\verb|   \xblackout{Little Bo Peep}|\\
 If such a phrase is to be used repeatedly through a document, 
-it is most convenient to place it as a keyword identifier:\\
-\verb|   \def\Name{\blackout{Little Bo Peep}}|\\
+it is most convenient to place it as a macro:\\
+\verb|   \def\Name{\xblackout{Little Bo Peep}}|\\
 such that subsequent reference is done indirectly:\\
-\verb|   We examine the life of {\Name} in this report|\\
+\verb|   We examine the life of \Name{} in this report,|\\
+\verb|   assured that \Name{} line breaks.|\\
+\def\Name{\xblackout{Little Bo Peep}}
+\verb|   |We examine the life of \Name{} in this report, assured that 
+  \Name{} line breaks.\\
 (Even so, it should be noted that censoring can still affect text
 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.
+\item 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
@@ -640,7 +729,7 @@
 
 {\let\svcensorrule\censorrule
 \renewcommand\censorrule[1]{\textcolor{red}{\svcensorrule{#1}}}
-\addtolength\leftskip{2.3em}
+\addtolength\leftskip{2em}
 Is this blacked out text censored in red?\\
 \blackout{Is this blacked out text censored in red?}\par}
 
@@ -649,6 +738,8 @@
 The value of \verb|\censorcolor| can be redefined on the fly to change
   the color of the censoring.
 
+\end{itemize}
+
 \section{Source Code}
 
 The source code for \textsf{censor} is so short as to be included below:

Modified: trunk/Master/texmf-dist/tex/latex/censor/censor.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/censor/censor.sty	2021-12-23 21:32:49 UTC (rev 61388)
+++ trunk/Master/texmf-dist/tex/latex/censor/censor.sty	2021-12-23 21:33:04 UTC (rev 61389)
@@ -1,7 +1,7 @@
 % censor.sty
-\def\censorversionnumber{3.22}
+\def\censorversionnumber{4.0}
 \ProvidesPackage{censor}
-[2018/11/15 \censorversionnumber
+[2021/12/23 \censorversionnumber
  Provides capability for redaction of sensitive information]
 
 %
@@ -30,8 +30,10 @@
 % 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 \%
+% 4.0  - Recast \blackout and \xblackout in terms of tokcycle environments
+%      - Introduced \blackoutenv...\endblackoutenv and 
+%        \xblackoutenv...\endxblackoutenv
 \usepackage{pbox}
-\usepackage{ifnextok}
 
 \newlength\censorruledepth
 \newlength\censorruleheight
@@ -38,7 +40,7 @@
 
 \censorruledepth=-0.3ex% -0.3ex DEFAULT
 \censorruleheight=2.1ex%  2.1ex DEFAULT
-\def\censordot{.}% versus \def\censordot{ }%
+\def\censordot{\censor{.}}% versus \def\censordot{ }%
 
 \newcommand\censorrule[1]{\protect\rule[\censorruledepth]{#1}{\censorruleheight}}
 
@@ -53,91 +55,58 @@
 \newcommand\StopCensoring{%
            \let\censor\un at censor%
            \let\censorbox\un at censorbox%
-           \let\xblackout\blackout%
+           \renewcommand\censpace{ }%
 }
 \newcommand\RestartCensoring{%
            \renewcommand\censor{\@ifstar{\@cenlen}{\@cenword}}%
            \renewcommand\censorbox{\@ifstar{\censor at dim}{\censor at box}}%
-           \let\xblackout\sv at xblackout%
+           \let\censpace\sv at censpace%
 }
 
-\let\sv at tilde~
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-\def\stringend{$}
+\usepackage{tokcycle}[2021/03/10]
 
-\long\def\blackout#1{\def~{-}\censor at Block#1\stringend\let~\sv at tilde}
-\long\def\censor at Block{\IfNextToken\stringend{\@gobble}%
-  {\IfNextToken\@sptoken{ \bl at t{\censor at Block}}%
-  {\bl at t{\censor at Block}}}}
 
-% V2.00 DEFINITION:
-% \def\bl at t#1#2{\censor{#2}#1}
+\def\@dump#1{\addcytoks[1]{\expandafter\censor\expandafter{#1}}\def#1{}}
+\def\@append#1#2{\tc at defx#1{#1#2}}
 
-% 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}
+\def\spacelap{0.6ex}
+\def\censpace{\rlap{\censorrule{\spacelap}} \llap{\censorrule{\spacelap}}}
+\let\sv at censpace\censpace
 
-% V3.22 DEFINITION
-\long\def\bl at t#1#2{\ifx\bpar#2\par\else\if.#2\censordot\else\censor{#2}\fi\fi#1}
+\long\def\blackout#1{\blackoutenv#1\endblackoutenv}
+\long\def\xblackout#1{\xblackoutenv#1\endxblackoutenv}
 
-%\def\bpar{_} %V3.00 DEFINITION
-\let\bpar\par %AS OF V3.1, CAN HANDLE \par
+\newif\ifexpandarg
 
-\long\def\xblackout#1{\rule{0ex}{0ex}%
-  \def~{-}%
-  \def\@justpar{F}%
-  \def\@justperiod{F}%
-  \def\@justspace{F}%
-  \xcensor at Block#1\stringend%
-  \let~\sv at tilde%
- }
+\xtokcycleenvironment\xblackoutenv
+  {\ifx.##1\@dump\censored at word\addcytoks[1]{\censordot}\else
+    \@append\censored at word{##1}%
+    \tcpeek\@next\ifx\@next\@tcEscapeptr\@dump\censored at word\fi\fi}
+  {\tctestifcon\ifexpandarg{\expandafter\processtoks\expandafter{\expanded{##1}}}%
+    {\processtoks{##1}}\@dump\censored at word\expandargfalse}
+  {\@dump\censored at word\tctestifx{~##1}{\@append\censored at word{##1}}%
+    {\tctestifx{\expanded##1}{\expandargtrue}{\addcytoks{##1}}}}
+  {\@dump\censored at word\addcytoks{\censpace}}
+  {\def\censored at word{}}
+  {\@dump\censored at word}
+\xtokcycleenvironment\blackoutenv
+  {\ifx.##1\@dump\censored at word\addcytoks[1]{\censordot}\else
+    \@append\censored at word{##1}%
+    \tcpeek\@next\ifx\@next\@tcEscapeptr\@dump\censored at word\fi\fi}
+  {\tctestifcon\ifexpandarg{\expandafter\processtoks\expandafter{\expanded{##1}}}%
+    {\processtoks{##1}}\@dump\censored at word\expandargfalse}
+  {\@dump\censored at word\tctestifx{~##1}{\@append\censored at word{##1}}%
+    {\tctestifx{\expanded##1}{\expandargtrue}{\addcytoks{##1}}}}
+  {\@dump\censored at word\addcytoks{##1}}
+  {\def\censored at word{}}
+  {\@dump\censored at word}
 
-\let\sv at xblackout\xblackout
 
-\long\def\xcensor at Block{\IfNextToken\stringend{\@gobble}%
-  {\IfNextToken\@sptoken{ \def\@justspace{T}\xbl at t{\xcensor at Block}}%
-  {\xbl at t{\xcensor at Block}}}}
 
-\newlength\periodrlap\setlength\periodrlap{1.6ex}
-\newlength\afterperiodlap\setlength\afterperiodlap{1.2ex}
-\newlength\lletterlap\setlength\lletterlap{0.55ex}
-\newlength\rletterlap\setlength\rletterlap{0.55ex}
-\newlength\afterspacelap\setlength\afterspacelap{0.0ex}
+%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-\def\@periodrlap{\rlap{\censorrule{\periodrlap}}}
-\def\@afterperiodlap{\llap{\censorrule{\afterperiodlap}}}
-\def\@lletterlap{\llap{\censorrule{\lletterlap}}}
-\def\@rletterlap{\rlap{\censorrule{\rletterlap}}}
-\def\@afterspacelap{\llap{\censorrule{\afterspacelap}}}
-
-\long\def\xbl at t#1#2{%
-  \ifx\par#2%
-    \par\def\@justpar{T}%
-  \else%
-    \if T\@justspace%
-      \rule{0ex}{1ex}\@afterspacelap%
-    \fi%
-    \if.#2%
-      \def\@justperiod{T}%
-      \@periodrlap%
-      \censordot%
-    \else%
-      \if F\@justpar%
-        \if T\@justperiod%
-          \@afterperiodlap%
-        \else%
-          \@lletterlap%
-        \fi%
-      \fi%
-      \censor{#2}%
-      \@rletterlap%
-      \def\@justpar{F}%
-      \def\@justperiod{F}%
-      \def\@justspace{F}%
-    \fi%
-  \fi%
-  #1%
-}
-
 \newcommand\censorbox{\@ifstar{\censor at dim}{\censor at box}}
   \newcommand\censor at dim[4][]{{#1%
                       \rule[-#4\baselineskip]{#2ex}{#3\baselineskip}}}
@@ -152,3 +121,5 @@
 
 % NOTE: A \protect\censorbox{} MAY BE REQUIRED INSIDE SOME ENVIRONMENTS
 \endinput
+
+



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