texlive[49570] Master/texmf-dist: clrstrip (1jan19)
commits+karl at tug.org
commits+karl at tug.org
Tue Jan 1 23:50:26 CET 2019
Revision: 49570
http://tug.org/svn/texlive?view=revision&revision=49570
Author: karl
Date: 2019-01-01 23:50:26 +0100 (Tue, 01 Jan 2019)
Log Message:
-----------
clrstrip (1jan19)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/clrstrip/clrstrip.pdf
trunk/Master/texmf-dist/source/latex/clrstrip/clrstrip.dtx
trunk/Master/texmf-dist/tex/latex/clrstrip/clrstrip.sty
Modified: trunk/Master/texmf-dist/doc/latex/clrstrip/clrstrip.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/clrstrip/clrstrip.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/clrstrip/clrstrip.dtx 2019-01-01 22:50:09 UTC (rev 49569)
+++ trunk/Master/texmf-dist/source/latex/clrstrip/clrstrip.dtx 2019-01-01 22:50:26 UTC (rev 49570)
@@ -57,7 +57,7 @@
%<*driver>
\ProvidesFile{clrstrip.dtx}
[%
- \csname clrstrip at date\endcsname\
+ \csname clrstrip at date\endcsname\space
place contents into a full width colour strip%
]
\documentclass{l3doc}
@@ -85,9 +85,9 @@
\end{document}
%</driver>
%<*pkg>
-\newcommand*\clrstrip at date{2018/09/27}
+\newcommand*\clrstrip at date{2018-12-31}
\ProvidesPackage{clrstrip}
- [\clrstrip at date place contents into a full width colour strip]
+ [\clrstrip at date\space place contents into a full width colour strip]
\RequirePackage{keyval}
%</pkg>
% \fi
@@ -119,7 +119,7 @@
%
% It is meant to be lightweight and fast. So while packages like \pkg{tcolorbox}
% provide very pretty output, this package has a simplistic look achieved with
-% under 100~lines of code.
+% less than 100~lines of code.
%
% It is written as a docstrip file: executing |latex clrstrip.dtx| generates the
% \file{clrstrip.sty} file and typesets this documentation; execute
@@ -164,9 +164,9 @@
% And the code boxes in this section (except this one) are surrounded by
% \begin{colorstrip}{gray!15}[inner=2ex]
% |\begin{colorstrip}{gray!15}[inner bot=0pt, inner top=2ex]|\\
-% |\begin{verbatim} |\\
-% |\end{verbatim} |\\
-% |\end{colorstrip} |
+% |\begin{verbatim}|\\
+% |\end{verbatim} |\\
+% |\end{colorstrip}|
% \end{colorstrip}
%
% \section{Documentation}
@@ -229,12 +229,12 @@
% Ignores every value given to it. If used the indentation of the first line
% in a \env{colorstrip} will be prevented using the \LaTeX\ macros
% \cs{@afterindentfalse} and \cs{@afterheading}. This is the package default
-% since version 2018/09/25.
+% since version 2018-09-25.
% \item[noindent]
% Ignores every value given to it. If used the indentation of the first line
% in a \env{colorstrip} will be prevented using the \TeX\ primitives
% \cs{noindent} and \cs{ignorespaces}. This was the package default before
-% version 2018/09/25.
+% version 2018-09-25.
% \end{options}
%
% \subsection{Dependencies}
@@ -297,8 +297,8 @@
% \end{variable}
%
% \begin{variable}{\clrstrip at width}
-% Stores the lower inner padding. Gets reused to store the overall depth of
-% the colour strip locally.
+% Stores the width the text block inside of the colour strip should be wide.
+% Might be reused to calculate the skip to centre the text block locally.
% \begin{macrocode}
\newlength\clrstrip at width
% \end{macrocode}
@@ -327,15 +327,6 @@
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\clrstrip at preventIndent}
-% Stores whether \cs{@afterheading} should be used to prevent the indentation
-% of the first line (if true) or \cs{noindent} (if false)
-% \begin{macrocode}
-\newif\ifclrstrip at afterheading
-\clrstrip at afterheadingtrue
-% \end{macrocode}
-% \end{variable}
-%
% \subsection{Internal Macros}
%
% \begin{macro}{\clrstrip at key}
@@ -345,23 +336,21 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\clrstrip at strip@a,\clrstrip at strip@b}
-% Draws the colour strip using \cs{vrule}. \cs{clrstrip at strip@a} is used to
-% expand the optional argument for \cs{clrstrip at strip@b} and should be called
-% with the expanded mandatory argument as its argument. \cs{clrstrip at strip@b}
-% then sets the colour and draws the \cs{vrule}.
+% \begin{macro}{\clrstrip at strip}
+% Draws the colour strip using \cs{vrule}. \cs{clrstrip at strip} should be
+% called with the expanded \cs{clrstrip at marg} as its argument. It tests
+% whether the first optional argument is empty, sets the colour accordingly
+% and draws the \cs{vrule}. The arguments to \cs{color} need to be expanded as
+% \pkg{color} doesn't work with the unexpanded once depending on the chosen
+% colour model.
% \begin{macrocode}
-\newcommand*\clrstrip at strip@a[1]
+\newcommand*\clrstrip at strip[1]
{%
- \expandafter\clrstrip at strip@b\expandafter{\clrstrip at oarg}{#1}%
- }
-\newcommand*\clrstrip at strip@b[2]
- {%
\begingroup
- \if\relax\detokenize{#1}\relax
- \color{#2}%
+ \ifx\clrstrip at oarg\@empty
+ \color{#1}%
\else
- \color[#1]{#2}%
+ \expandafter\color\expandafter[\clrstrip at oarg]{#1}%
\fi
\advance\clrstrip at innerT\ht\clrstrip at box
\advance\clrstrip at innerB\dp\clrstrip at box
@@ -395,19 +384,21 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\clrstrip at afterheading,\clrstrip at noindent}
+% These two macros are the two options to suppress the indentation in a
+% \env{colorstrip}.
+% \begin{macrocode}
+\newcommand*\clrstrip at afterheading{\@afterindentfalse\@afterheading}
+\newcommand*\clrstrip at noindent{\noindent\ignorespaces}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\clrstrip at preventIndent}
-% Used to prevent the indentation of the first line in a \env{colorstrip}.
+% Used to prevent the indentation of the first line in a \env{colorstrip}. It
+% will be let to one of \cs{clrstrip at afterheading} or \cs{clrstrip at noindent}.
% \begin{macrocode}
-\newcommand*\clrstrip at preventIndent
- {%
- \ifclrstrip at afterheading
- \expandafter\@firstoftwo
- \else
- \expandafter\@secondoftwo
- \fi
- {\@afterindentfalse\@afterheading}
- {\noindent\ignorespaces}%
- }
+\newcommand*\clrstrip at preventIndent{}
+\let\clrstrip at preventIndent\clrstrip at afterheading
% \end{macrocode}
% \end{macro}
%
@@ -422,8 +413,8 @@
\clrstrip at key{outer bot}{\clrstrip at outerB#1\relax}
\clrstrip at key{width}{\clrstrip at width#1\relax}
\clrstrip at key{left}{\clrstrip at left#1\relax}
-\clrstrip at key{afterheading}[]{\clrstrip at afterheadingtrue}
-\clrstrip at key{noindent}[]{\clrstrip at afterheadingfalse}
+\clrstrip at key{afterheading}[]{\let\clrstrip at preventIndent\clrstrip at afterheading}
+\clrstrip at key{noindent}[]{\let\clrstrip at preventIndent\clrstrip at noindent}
% \end{macrocode}
%
% \subsection{User Level Macros}
@@ -454,12 +445,12 @@
\par
\vskip\clrstrip at outerT
\noindent
- \expandafter\clrstrip at strip@a\expandafter{\clrstrip at marg}%
+ \expandafter\clrstrip at strip\expandafter{\clrstrip at marg}%
\ifdim\clrstrip at left=1sp
\advance\clrstrip at width-\linewidth
\clrstrip at left-.5\clrstrip at width
\fi
- \rlap{\hskip\clrstrip at left\usebox\clrstrip at box}%
+ \rlap{\hskip\clrstrip at left\copy\clrstrip at box}%
\par
\vskip\clrstrip at outerB
}
Modified: trunk/Master/texmf-dist/tex/latex/clrstrip/clrstrip.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/clrstrip/clrstrip.sty 2019-01-01 22:50:09 UTC (rev 49569)
+++ trunk/Master/texmf-dist/tex/latex/clrstrip/clrstrip.sty 2019-01-01 22:50:26 UTC (rev 49570)
@@ -29,9 +29,9 @@
%% and the derived files clrstrip.pdf and
%% clrstrip.sty.
%%
-\newcommand*\clrstrip at date{2018/09/27}
+\newcommand*\clrstrip at date{2018-12-31}
\ProvidesPackage{clrstrip}
- [\clrstrip at date place contents into a full width colour strip]
+ [\clrstrip at date\space place contents into a full width colour strip]
\RequirePackage{keyval}
\newsavebox\clrstrip at box
\newlength\clrstrip at innerT
@@ -47,20 +47,14 @@
\clrstrip at left1sp
\newcommand*\clrstrip at oarg{}
\newcommand*\clrstrip at marg{}
-\newif\ifclrstrip at afterheading
-\clrstrip at afterheadingtrue
\newcommand*\clrstrip at key{\define at key{clrstrip}}
-\newcommand*\clrstrip at strip@a[1]
+\newcommand*\clrstrip at strip[1]
{%
- \expandafter\clrstrip at strip@b\expandafter{\clrstrip at oarg}{#1}%
- }
-\newcommand*\clrstrip at strip@b[2]
- {%
\begingroup
- \if\relax\detokenize{#1}\relax
- \color{#2}%
+ \ifx\clrstrip at oarg\@empty
+ \color{#1}%
\else
- \color[#1]{#2}%
+ \expandafter\color\expandafter[\clrstrip at oarg]{#1}%
\fi
\advance\clrstrip at innerT\ht\clrstrip at box
\advance\clrstrip at innerB\dp\clrstrip at box
@@ -84,16 +78,10 @@
\hsize\clrstrip at width
\clrstrip at preventIndent
}
-\newcommand*\clrstrip at preventIndent
- {%
- \ifclrstrip at afterheading
- \expandafter\@firstoftwo
- \else
- \expandafter\@secondoftwo
- \fi
- {\@afterindentfalse\@afterheading}
- {\noindent\ignorespaces}%
- }
+\newcommand*\clrstrip at afterheading{\@afterindentfalse\@afterheading}
+\newcommand*\clrstrip at noindent{\noindent\ignorespaces}
+\newcommand*\clrstrip at preventIndent{}
+\let\clrstrip at preventIndent\clrstrip at afterheading
\clrstrip at key{inner}{\clrstrip at innerT#1\relax\clrstrip at innerB#1\relax}
\clrstrip at key{outer}{\clrstrip at outerT#1\relax\clrstrip at outerB#1\relax}
\clrstrip at key{inner top}{\clrstrip at innerT#1\relax}
@@ -102,8 +90,8 @@
\clrstrip at key{outer bot}{\clrstrip at outerB#1\relax}
\clrstrip at key{width}{\clrstrip at width#1\relax}
\clrstrip at key{left}{\clrstrip at left#1\relax}
-\clrstrip at key{afterheading}[]{\clrstrip at afterheadingtrue}
-\clrstrip at key{noindent}[]{\clrstrip at afterheadingfalse}
+\clrstrip at key{afterheading}[]{\let\clrstrip at preventIndent\clrstrip at afterheading}
+\clrstrip at key{noindent}[]{\let\clrstrip at preventIndent\clrstrip at noindent}
\newcommand*\colorstripSet{\setkeys{clrstrip}}
\newenvironment{colorstrip}[2][]
{%
@@ -116,12 +104,12 @@
\par
\vskip\clrstrip at outerT
\noindent
- \expandafter\clrstrip at strip@a\expandafter{\clrstrip at marg}%
+ \expandafter\clrstrip at strip\expandafter{\clrstrip at marg}%
\ifdim\clrstrip at left=1sp
\advance\clrstrip at width-\linewidth
\clrstrip at left-.5\clrstrip at width
\fi
- \rlap{\hskip\clrstrip at left\usebox\clrstrip at box}%
+ \rlap{\hskip\clrstrip at left\copy\clrstrip at box}%
\par
\vskip\clrstrip at outerB
}
More information about the tex-live-commits
mailing list