summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/censor
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-02-19 23:59:36 +0000
committerKarl Berry <karl@freefriends.org>2013-02-19 23:59:36 +0000
commitdedf8767147c2376fa8eb76db9f363228890a8b4 (patch)
tree53d79622be5f1db2dc1a826269b6c29e92fc04a6 /Master/texmf-dist/tex/latex/censor
parent9759eb626127d860fadc3f37d96158685b176e65 (diff)
censor (19feb13)
git-svn-id: svn://tug.org/texlive/trunk@29170 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/censor')
-rw-r--r--Master/texmf-dist/tex/latex/censor/censor.sty28
1 files changed, 24 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/latex/censor/censor.sty b/Master/texmf-dist/tex/latex/censor/censor.sty
index dfc71912de0..7c3a60613b6 100644
--- a/Master/texmf-dist/tex/latex/censor/censor.sty
+++ b/Master/texmf-dist/tex/latex/censor/censor.sty
@@ -1,9 +1,9 @@
% censor.sty
\ProvidesPackage{censor}
-[2012/09/10 v2.10
+[2013/02/19 v3.00
Provides capability for redaction of sensitive information]
-%% Copyright 2009, 2012 Steven B. Segletes
+%% Copyright 2009, 2012, 2013 Steven B. Segletes
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -71,6 +71,7 @@
% 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.
+% 3.00 - \censorbox introduced to handle figures, tables, etc.
\usepackage{pbox}
\usepackage{ifnextok}
@@ -84,9 +85,14 @@
\newcommand\un@cenlen[1]{\protect\underline{\hspace{#1 ex}}}
\newcommand\un@cenword[1]{#1}
-\newcommand\StopCensoring{\let\censor\un@censor}
+\newcommand\StopCensoring{%
+ \let\censor\un@censor%
+ \let\censorbox\un@censorbox%
+}
\newcommand\RestartCensoring{%
- \renewcommand\censor{\@ifstar{\@cenlen}{\@cenword}}}
+ \renewcommand\censor{\@ifstar{\@cenlen}{\@cenword}}%
+ \renewcommand\censorbox{\@ifstar{\censor@dim}{\censor@box}}%
+}
\def\stringend{$}
\def\blackout#1{\censor@Block#1\stringend}
@@ -104,5 +110,19 @@
% ALTERNATE DEFINITION IF ABOVE PROVES PROBLEMATIC
%\def\bl@t#1#2{\if.#2#2\else\censor{#2}\fi#1} % JUST PERIODS, NO \bpar
+\newcommand\censorbox{\@ifstar{\censor@dim}{\censor@box}}
+ \newcommand\censor@dim[4][]{{#1%
+ \rule[-#4\baselineskip]{#2ex}{#3\baselineskip}}}
+ \newcommand\censor@box[2][]{#1\setbox0\hbox{#2}%
+ \rule[-\the\dp0]{\the\wd0}{\the\ht0+\the\dp0}}
+
+\newcommand\un@censorbox{\@ifstar{\un@censor@dim}{\un@censor@box}}
+ \newcommand\un@censor@dim[4][]{{#1%
+ \fbox{\rule[-#4\baselineskip]{0ex}{#3\baselineskip}
+ \rule{#2ex}{0ex}}}}
+ \newcommand\un@censor@box[2][]{#1#2}
+
+% NOTE: A \protect\censorbox{} MAY BE REQUIRED INSIDE SOME ENVIRONMENTS
+
\endinput