From 9c283e36ca83f396766a4d69436ef961ee0e37dd Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 10 Sep 2012 22:52:21 +0000 Subject: censor (10sep12) git-svn-id: svn://tug.org/texlive/trunk@27638 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/censor/README | 36 +++---- Master/texmf-dist/doc/latex/censor/censor.pdf | Bin 73222 -> 139641 bytes Master/texmf-dist/doc/latex/censor/censor.tex | 130 ++++++++++++++++++------ Master/texmf-dist/doc/latex/censor/manifest.txt | 23 ----- Master/texmf-dist/tex/latex/censor/censor.sty | 54 +++++++--- Master/tlpkg/bin/tlpkg-ctan-check | 1 + 6 files changed, 150 insertions(+), 94 deletions(-) delete mode 100644 Master/texmf-dist/doc/latex/censor/manifest.txt diff --git a/Master/texmf-dist/doc/latex/censor/README b/Master/texmf-dist/doc/latex/censor/README index d2cf0c8521b..40fcb839a52 100644 --- a/Master/texmf-dist/doc/latex/censor/README +++ b/Master/texmf-dist/doc/latex/censor/README @@ -1,26 +1,14 @@ -%% Copyright 2009 Steven B. Segletes -% -% This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either version 1.3 -% of this license or (at your option) any later version. -% The latest version of this license is in -% http://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of LaTeX -% version 2005/12/01 or later. -% -% This work has the LPPL maintenance status `maintained'. -% -% The Current Maintainer of this work is Steven B. Segletes. -% -% This work consists of all files listed in manifest.txt. -% -% This notice added 2010/01/04 by Clea F. Rees with the permission of -% Steven B. Segletes. +CENSOR -The censor package allows a convenient redaction/censor -capability to be employed, for those who need to protect -restricted information, as well as for those who are -forced to work in a more inefficient environment when -dealing with restricted information. +This package provides simple tools for creating redacted documents with +blacked-out text. It's tools are useful both for creating documents in +a restricted environment (for redacted release in an unrestricted +environment) as well as in an unrestricted environment (for eventual +transfer and completion in the restricted environment). -Author: Steven Segletes +As of V2.00, the ability to blackout larger blocks of text is available, +up to a whole paragraph simply, and even across paragraph boundaries +(with a small modification required to your text). + +V2.1 tries to minimize formatting discrepancies (i.e., text spacing) +between the redacted and unredacted versions of the document. diff --git a/Master/texmf-dist/doc/latex/censor/censor.pdf b/Master/texmf-dist/doc/latex/censor/censor.pdf index d223b38ea96..b77e70e3be7 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 2c0c5650fe3..76aedae652d 100644 --- a/Master/texmf-dist/doc/latex/censor/censor.tex +++ b/Master/texmf-dist/doc/latex/censor/censor.tex @@ -1,21 +1,3 @@ -%% Copyright 2009 Steven B. Segletes -% -% This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either version 1.3 -% of this license or (at your option) any later version. -% The latest version of this license is in -% http://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of LaTeX -% version 2005/12/01 or later. -% -% This work has the LPPL maintenance status `maintained'. -% -% The Current Maintainer of this work is Steven B. Segletes. -% -% This work consists of all files listed in manifest.txt. -% -% This notice added 2010/01/04 by Clea F. Rees with the permission of -% Steven B. Segletes. \documentclass{article} \usepackage{censor} @@ -29,9 +11,9 @@ \LARGE The \textsf{censor} Package\\ \small \rule{0in}{1em}Tools for Producing Redacted Documents\\ \large \rule{0in}{2em} Steven B. Segletes\\ -steven@arl.army.mil\\ -\rule{0em}{2em}2009/12/07\\ -v1.00 +steven.b.segletes.civ@mail.mil\\ +\rule{0em}{2em}2012/09/10\\ +v2.10 \end{center} \section{Introduction} @@ -114,7 +96,7 @@ UNCENSORED RESTRICTED SOURCE: \hrulefill \verb|\StopCensoring|\\ \verb| |\\ \verb|The \censor{Liberty} missile, with charge diameter (CD) of|\\ -\verb|\censor{80}~mm, revealed a penetration capability of 1.30|\\ +\verb|\censor{80}~mm, revealed a penetration capability of 1.30,|\\ \verb|1.19, and 1.37~CD in three recent tests into armor steel.| UNCENSORED RESTRICTED OUTPUT: \hrulefill @@ -122,11 +104,83 @@ UNCENSORED RESTRICTED OUTPUT: \hrulefill \StopCensoring The \censor{Liberty} missile, with charge diameter (CD) of -\censor{80}~mm, revealed a penetration capability of 1.30 1.19, and +\censor{80}~mm, revealed a penetration capability of 1.30, 1.19, and 1.37~CD in three recent tests into armor steel. \hrulefill +Additionally, 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 +that it can stretch across line boundaries conveniently (and across +paragraph boundaries, a little less conveniently). For example, + +}\RestartCensoring + +{\addtolength{\leftskip}{2.3em} +UNCENSORED RESTRICTED SOURCE: \hrulefill + +\verb|\blackout{|\\ +\verb|The Liberty missile, with charge diameter (CD) of 80~mm,|\\ +\verb|revealed a penetration capability of 1.30, 1.19, and 1.37~CD|\\ +\verb|in three recent tests into armor steel.}| + +CENSORED UNRESTRICTED OUTPUT: \hrulefill + +\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.} + +\hrulefill + +There are several caveats regarding the use of \verb|\blackout|. First, +its argument cannot, without help, extend across paragraph boundaries. +The help needed by \textsf{censor} is to insert the token \verb|\bpar| +on your blank lines that would normally constitute paragraph boundaries, +as shown in the example below: + +\verb|\blackout{|\\ +\verb|First paragraph to censor.|\\ +\verb| \bpar|\\ +\verb|Second paragraph to censor.}|\\ + +\vspace{-0.7em}% +will appear as + +\blackout{ +First paragraph to censor. + \bpar +Second paragraph to censor.} + +Secondly, 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: + +\verb|\blackout{Ends in space. Bad form }| + +\verb|\blackout{Ends in carriage return. Bad form|\\ +\verb|}| + +Thirdly, 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 spacing +in the redacted version that is identical to the unredacted version. + +Fourthly, \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. + +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 + +\verb|\blackout{\today}| + +becomes \blackout{\today}, in spite of the fact that \verb|\today|, +given at the moment by \today, constains spaces. + }\RestartCensoring \clearpage @@ -236,33 +290,38 @@ remained unaltered. Note also that the censored, unrestricted output may also be obtained from the no-longer-unrestricted source by removing the \verb|\StopCensoring| command at the beginning of the file. +It is not envisioned that the \verb|\blackout| command, discussed in the +prior section, is used in this mode, where the source file is in an +unsecure environment. + \clearpage \section{Miscellany} Censoring may be dynamically turned on and off in a document with the use of the \verb|\StopCensoring| and \verb|\RestartCensoring| commands. -In addition to these two commands, the \verb|\censor| and \verb|\censor*| -commands constitute the totality of commands available in the -\textsf{censor} package. +In addition to these two commands, the \verb|\censor|, \verb|\censor*|. +and \verb|\blackout| commands constitute the totality of commands +available in the \textsf{censor} package. It is preferable not to apply \verb|\censor| to whitespace, or text justification could be adversely affected. If one wished to censor a multi-word phrase, such as ``Little Bo Peep,'' it is recommended to do it as follows:\\ -\verb| \censor{Little} \censor{Bo} \censor{Peep}|\\ +\verb| \blackout{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{\censor{Little} \censor{Bo} \censor{Peep}}|\\ +\verb| \def\Name{\blackout{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| The source code for \textsf{censor} is so short as to be included below: \verb|\ProvidesPackage{censor}|\\ -\verb|[2009/12/07 v1.00|\\ +\verb|[2012/09/06 v2.10|\\ \verb| Provides capability for redaction of sensitive information]|\\ \verb||\\ \verb|\usepackage{pbox}|\\ +\verb|\usepackage{ifnextok}|\\ \verb||\\ \verb|\newcommand\censor{\@ifstar{\@cenlen}{\@cenword}}|\\ \verb| \newcommand\@cenlen[1]{\protect\rule[-.3ex]{#1 ex}{2.1ex}}|\\ @@ -275,7 +334,16 @@ The source code for \textsf{censor} is so short as to be included below: \verb||\\ \verb|\newcommand\StopCensoring{\let\censor\un@censor}|\\ \verb|\newcommand\RestartCensoring{%|\\ -\verb| \renewcommand\censor{\@ifstar{\@cenlen}{\@cenword}}}|\\ +\verb| \renewcommand\censor{\@ifstar{\@cenlen}{\@cenword}}}|\\ +\verb||\\ +\verb|\def\stringend{$}|\\ +\verb|\def\blackout#1{\censor@Block#1\stringend}|\\ +\verb|\def\censor@Block{\IfNextToken\stringend{\@gobble}%|\\ +\verb| {\IfNextToken\@sptoken{ \bl@t{\censor@Block}}%|\\ +\verb| {\bl@t{\censor@Block}}}}|\\ +\verb||\\ +\verb|\def\bl@t#1#2{\if\bpar#2\par\else\if.#2#2\else\censor{#2}\fi\fi#1}|\\ +\verb|\def\bpar{_}|\\ \verb||\\ \verb|\endinput|\\ diff --git a/Master/texmf-dist/doc/latex/censor/manifest.txt b/Master/texmf-dist/doc/latex/censor/manifest.txt deleted file mode 100644 index a012d4b41f0..00000000000 --- a/Master/texmf-dist/doc/latex/censor/manifest.txt +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009 Steven B. Segletes - -This work may be distributed and/or modified under the -conditions of the LaTeX Project Public License, either version 1.3 -of this license or (at your option) any later version. -The latest version of this license is in -http://www.latex-project.org/lppl.txt -and version 1.3 or later is part of all distributions of LaTeX -version 2005/12/01 or later. - -This work has the LPPL maintenance status `maintained'. - -The Current Maintainer of this work is Steven B. Segletes. - -This work consists of all files listed in manifest.txt. - -This file added 2010/01/04 by Clea F. Rees. - -README -censor.pdf -censor.sty -censor.tex -manifest.txt diff --git a/Master/texmf-dist/tex/latex/censor/censor.sty b/Master/texmf-dist/tex/latex/censor/censor.sty index 822e69a1c00..dfc71912de0 100644 --- a/Master/texmf-dist/tex/latex/censor/censor.sty +++ b/Master/texmf-dist/tex/latex/censor/censor.sty @@ -1,39 +1,37 @@ % censor.sty -%% Copyright 2009 Steven B. Segletes +\ProvidesPackage{censor} +[2012/09/10 v2.10 + Provides capability for redaction of sensitive information] + +%% Copyright 2009, 2012 Steven B. Segletes % -% This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either version 1.3 +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 % of this license or (at your option) any later version. % The latest version of this license is in % http://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of LaTeX +% and version 1.3 or later is part of all distributions of LaTeX % version 2005/12/01 or later. % % This work has the LPPL maintenance status `maintained'. -% -% The Current Maintainer of this work is Steven B. Segletes. % -% This work consists of all files listed in manifest.txt. -% -% This notice added 2010/01/04 by Clea F. Rees the permission of -% Steven B. Segletes. -\ProvidesPackage{censor} -[2009/12/07 v1.00 - Provides capability for redaction of sensitive information] +% The Current Maintainer of this work is Steven B. Segletes. +% Packege: CENSOR % CHOOSE MODE OF OPERATION: % 1) IF .tex FILE IS CREATED IN PRIVATE (SECURE) ENVIRONMENT: % a) To produce censored document, censor individual words with % \censor{word} -% b) To produce uncensored document, place \StopCensoring in preamble -% c) To produced a mixed document with some redaction, but elsewhere +% b) Censor text blocks with \blackout{...}, subject to limitations. +% c) To produce uncensored document, place \StopCensoring in preamble +% d) To produced a mixed document with some redaction, but elsewhere % turned off, place \StopCensoring and/or \RestartCensoring in % various document locations as needed. % % DISCLAIMER: Don't \censor whitespace (i.e., phrases), or justifications % could get fouled up. If space-laden phrase needs repeated censoring, % I suggest typesetting according to the following example: -% \def\CodeName{\censor{Little} \censor{Bo} \censor{Peep}} +% \def\CodeName{\blackout{Little Bo Peep}} % In the text, refer to {\CodeName} as often as needed. % % 2) IF .tex FILE IS INITIALLY CREATED IN PUBLIC (UNSECURE) ENVIRONMENT: @@ -67,7 +65,15 @@ % braces, so that surrounding white space and/or punctuation is properly % handled. +% VERSION: +% 1.00 - Initial release +% 2.00 - Added \blackout +% 2.10 - Allowed \blackout to cross paragraph boundaries with use of +% \bpar. Stopped censoring periods, in order to preserve +% end-of-sentence spacing, which differs from inter-word spacing. + \usepackage{pbox} +\usepackage{ifnextok} \newcommand\censor{\@ifstar{\@cenlen}{\@cenword}} \newcommand\@cenlen[1]{\protect\rule[-.3ex]{#1 ex}{2.1ex}} @@ -82,5 +88,21 @@ \newcommand\RestartCensoring{% \renewcommand\censor{\@ifstar{\@cenlen}{\@cenword}}} +\def\stringend{$} +\def\blackout#1{\censor@Block#1\stringend} +\def\censor@Block{\IfNextToken\stringend{\@gobble}% + {\IfNextToken\@sptoken{ \bl@t{\censor@Block}}% + {\bl@t{\censor@Block}}}} + +% V2.00 DEFINITION: +% \def\bl@t#1#2{\censor{#2}#1} + +% V2.10 DEFINITION: +\def\bl@t#1#2{\if\bpar#2\par\else\if.#2#2\else\censor{#2}\fi\fi#1} +\def\bpar{_} + +% ALTERNATE DEFINITION IF ABOVE PROVES PROBLEMATIC +%\def\bl@t#1#2{\if.#2#2\else\censor{#2}\fi#1} % JUST PERIODS, NO \bpar + \endinput diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index e3f50adbede..7abb83b80fa 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -537,6 +537,7 @@ my @TLP_no_check = ( "texworks", # binary "tie", # binary "ttfutils", # binary + "web", # binary "xdvi", # binary "xetex", # binary "xetexconfig", # our sources -- cgit v1.2.3