From 866a54256a3e665b4272e65691b8ebe5c1f97fb6 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 1 Jan 2019 22:50:26 +0000 Subject: clrstrip (1jan19) git-svn-id: svn://tug.org/texlive/trunk@49570 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/clrstrip/clrstrip.sty | 40 ++++++++--------------- 1 file changed, 14 insertions(+), 26 deletions(-) (limited to 'Master/texmf-dist/tex/latex/clrstrip') diff --git a/Master/texmf-dist/tex/latex/clrstrip/clrstrip.sty b/Master/texmf-dist/tex/latex/clrstrip/clrstrip.sty index f785157d92d..590b039b110 100644 --- a/Master/texmf-dist/tex/latex/clrstrip/clrstrip.sty +++ b/Master/texmf-dist/tex/latex/clrstrip/clrstrip.sty @@ -29,9 +29,9 @@ %% and the derived files clrstrip.pdf and %% clrstrip.sty. %% -\newcommand*\clrstrip@date{2018/09/27} +\newcommand*\clrstrip@date{2018-12-31} \ProvidesPackage{clrstrip} - [\clrstrip@date place contents into a full width colour strip] + [\clrstrip@date\space place contents into a full width colour strip] \RequirePackage{keyval} \newsavebox\clrstrip@box \newlength\clrstrip@innerT @@ -47,20 +47,14 @@ \clrstrip@left1sp \newcommand*\clrstrip@oarg{} \newcommand*\clrstrip@marg{} -\newif\ifclrstrip@afterheading -\clrstrip@afterheadingtrue \newcommand*\clrstrip@key{\define@key{clrstrip}} -\newcommand*\clrstrip@strip@a[1] - {% - \expandafter\clrstrip@strip@b\expandafter{\clrstrip@oarg}{#1}% - } -\newcommand*\clrstrip@strip@b[2] +\newcommand*\clrstrip@strip[1] {% \begingroup - \if\relax\detokenize{#1}\relax - \color{#2}% + \ifx\clrstrip@oarg\@empty + \color{#1}% \else - \color[#1]{#2}% + \expandafter\color\expandafter[\clrstrip@oarg]{#1}% \fi \advance\clrstrip@innerT\ht\clrstrip@box \advance\clrstrip@innerB\dp\clrstrip@box @@ -84,16 +78,10 @@ \hsize\clrstrip@width \clrstrip@preventIndent } -\newcommand*\clrstrip@preventIndent - {% - \ifclrstrip@afterheading - \expandafter\@firstoftwo - \else - \expandafter\@secondoftwo - \fi - {\@afterindentfalse\@afterheading} - {\noindent\ignorespaces}% - } +\newcommand*\clrstrip@afterheading{\@afterindentfalse\@afterheading} +\newcommand*\clrstrip@noindent{\noindent\ignorespaces} +\newcommand*\clrstrip@preventIndent{} +\let\clrstrip@preventIndent\clrstrip@afterheading \clrstrip@key{inner}{\clrstrip@innerT#1\relax\clrstrip@innerB#1\relax} \clrstrip@key{outer}{\clrstrip@outerT#1\relax\clrstrip@outerB#1\relax} \clrstrip@key{inner top}{\clrstrip@innerT#1\relax} @@ -102,8 +90,8 @@ \clrstrip@key{outer bot}{\clrstrip@outerB#1\relax} \clrstrip@key{width}{\clrstrip@width#1\relax} \clrstrip@key{left}{\clrstrip@left#1\relax} -\clrstrip@key{afterheading}[]{\clrstrip@afterheadingtrue} -\clrstrip@key{noindent}[]{\clrstrip@afterheadingfalse} +\clrstrip@key{afterheading}[]{\let\clrstrip@preventIndent\clrstrip@afterheading} +\clrstrip@key{noindent}[]{\let\clrstrip@preventIndent\clrstrip@noindent} \newcommand*\colorstripSet{\setkeys{clrstrip}} \newenvironment{colorstrip}[2][] {% @@ -116,12 +104,12 @@ \par \vskip\clrstrip@outerT \noindent - \expandafter\clrstrip@strip@a\expandafter{\clrstrip@marg}% + \expandafter\clrstrip@strip\expandafter{\clrstrip@marg}% \ifdim\clrstrip@left=1sp \advance\clrstrip@width-\linewidth \clrstrip@left-.5\clrstrip@width \fi - \rlap{\hskip\clrstrip@left\usebox\clrstrip@box}% + \rlap{\hskip\clrstrip@left\copy\clrstrip@box}% \par \vskip\clrstrip@outerB } -- cgit v1.2.3