texlive[52636] Master/texmf-dist: clrstrip (4nov19)
commits+karl at tug.org
commits+karl at tug.org
Mon Nov 4 23:15:53 CET 2019
Revision: 52636
http://tug.org/svn/texlive?view=revision&revision=52636
Author: karl
Date: 2019-11-04 23:15:52 +0100 (Mon, 04 Nov 2019)
Log Message:
-----------
clrstrip (4nov19)
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-11-04 22:15:41 UTC (rev 52635)
+++ trunk/Master/texmf-dist/source/latex/clrstrip/clrstrip.dtx 2019-11-04 22:15:52 UTC (rev 52636)
@@ -64,6 +64,7 @@
\usepackage{xcolor}
\usepackage{clrstrip}
\usepackage{duckuments}
+\usepackage[oldstyle,notextcomp,nott]{kpfonts}
^^A fix \duckuments at enquote in latest released version
\makeatletter
\ExplSyntaxOn
@@ -85,7 +86,7 @@
\end{document}
%</driver>
%<*pkg>
-\newcommand*\clrstrip at date{2019-06-03}
+\newcommand*\clrstrip at date{2019-11-03}
\ProvidesPackage{clrstrip}
[\clrstrip at date\space place contents into a full width colour strip]
\RequirePackage{keyval}
@@ -135,12 +136,11 @@
% \end{colorstrip}
%\end{verbatim}
% \end{colorstrip}
-% \noindent
% with \pkg{xcolor} and \pkg{duckuments} loaded:
% \begin{colorstrip}{red!5}
% \blindduck
% \end{colorstrip}
-% \noindent
+%
% The title of this documentation was typeset with
% \begin{colorstrip}{gray!15}[inner bot=0pt, inner top=2ex]
%\begin{verbatim}
@@ -159,9 +159,7 @@
% \footnotetext{E-mail: jspratte at yahoo.de}
%\end{verbatim}
% \end{colorstrip}
-%
-% \noindent
-% And the code boxes in this section (except this one) are surrounded by
+% 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}|\\
@@ -189,10 +187,11 @@
% surrounded by a strip of the specified \meta{color} which reaches across the
% full page width. \meta{color model} and \meta{color} are the arguments
% passed to \cs{color}. In the second optional argument \meta{key=value} you
-% can specify any of the options listed in \autoref{sec:opt}. After this
-% environment starts a new paragraph with the document specific
-% \cs{parindent}. As always you can suppress this indent with \cs{noindent}.
-% The result is not page breakable.
+% can specify any of the options listed in \autoref{sec:opt}. If you leave a
+% blank line after this environment the next paragraph will be indented, else
+% this indentation will be suppressed (this has been changed starting with
+% version 2019-11-03, in earlier versions you'd have to use \cs{noindent} to
+% suppress the paragraph indentation). The result is not page breakable.
% \end{function}
%
% \subsection{Options}\label{sec:opt}
@@ -218,9 +217,10 @@
% \item[outer bot=\meta{skip}]
% Specifies the vertical skip below the colour strip.
% \item[width=\meta{width}]
-% Sets the \cs{hsize} of the \cs{vbox} for the contents, resulting in the
-% specified \meta{width}. If \meta{width} is |0pt| (which is the initial
-% value) the width is the current \cs{linewidth}.
+% Sets the \cs{hsize} (and also \cs{linewidth} inside of the environment) of
+% the \cs{vbox} for the contents, resulting in the specified \meta{width}.
+% If \meta{width} is |0pt| (which is the initial value) the width is the
+% current surrounding \cs{linewidth}.
% \item[left=\meta{skip}]
% Specifies a horizontal skip from the left border of the text field for the
% contents. If \meta{skip} is |1sp| (which is the initial value) the
@@ -313,20 +313,14 @@
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\clrstrip at oarg}
-% Stores the first optional argument to \env{colorstrip} for later use.
+% \begin{variable}{\clrstrip at arg}
+% Stores the first optional and the mandatory argument to \env{colorstrip} for
+% later use.
% \begin{macrocode}
-\newcommand*\clrstrip at oarg{}
+\newcommand*\clrstrip at arg{}
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\clrstrip at marg}
-% Stores the mandatory argument to \env{colorstrip} for later use.
-% \begin{macrocode}
-\newcommand*\clrstrip at marg{}
-% \end{macrocode}
-% \end{variable}
-%
% \subsection{Internal Macros}
%
% \begin{macro}{\clrstrip at key}
@@ -336,37 +330,6 @@
% \end{macrocode}
% \end{macro}
%
-% \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 ones depending on the chosen
-% colour model.
-% \begin{macrocode}
-\newcommand*\clrstrip at strip[1]
- {%
- \begingroup
- \ifx\clrstrip at oarg\@empty
- \color{#1}%
- \else
- \expandafter\color\expandafter[\clrstrip at oarg]{#1}%
- \fi
- \advance\clrstrip at innerT\ht\clrstrip at box
- \advance\clrstrip at innerB\dp\clrstrip at box
- \rlap
- {%
- \hskip-\paperwidth
- \vrule
- width 2\paperwidth
- height \clrstrip at innerT
- depth \clrstrip at innerB
- }%
- \endgroup
- }
-% \end{macrocode}
-% \end{macro}
-%
% \begin{macro}{\clrstrip at start}
% Used to grab the second optional argument to \env{colorstrip}. Sets the
% specified keys and starts the grabbing of the contents inside the \cs{vbox}.
@@ -379,6 +342,7 @@
\fi
\setbox\clrstrip at box\vbox\bgroup
\hsize\clrstrip at width
+ \linewidth\hsize
\color at setgroup
\clrstrip at preventIndent
}
@@ -432,29 +396,66 @@
\newenvironment{colorstrip}[2][]
{%
% \end{macrocode}
-% Save the arguments for the usage in |\end{colorstrip}|.
+% Save the arguments for the usage in |\end{colorstrip}|. If the first argument
+% is empty \cs{color} won't get an optional argument, else store both the
+% optional and the mandatory one in \cs{clrstrip at arg}.
% \begin{macrocode}
- \def\clrstrip at oarg{#1}%
- \def\clrstrip at marg{#2}%
+ \def\clrstrip at arg{#1}%
+ \ifx\clrstrip at arg\@empty
+ \def\clrstrip at arg{{#2}}%
+ \else
+ \def\clrstrip at arg{[{#1}]{#2}}%
+ \fi
% \end{macrocode}
-% Start grabbing the contents
+% Start grabbing the contents.
% \begin{macrocode}
\clrstrip at start
}
{%
+% \end{macrocode}
+% End grabbing the contents.
+% \begin{macrocode}
\color at endgroup
\egroup
+% \end{macrocode}
+% Start a new paragraph (if none was started yet) and add the upper outer
+% padding.
+% \begin{macrocode}
\par
\vskip\clrstrip at outerT
\noindent
- \expandafter\clrstrip at strip\expandafter{\clrstrip at marg}%
+% \end{macrocode}
+% Draw the colour strip using a coloured \cs{vrule}.
+% \begin{macrocode}
+ \begingroup
+ \expandafter\color\clrstrip at arg
+ \advance\clrstrip at innerT\ht\clrstrip at box
+ \advance\clrstrip at innerB\dp\clrstrip at box
+ \rlap
+ {%
+ \hskip-\paperwidth
+ \vrule
+ width 2\paperwidth
+ height \clrstrip at innerT
+ depth \clrstrip at innerB
+ }%
+ \endgroup
+% \end{macrocode}
+% Output the contents of the colour strip.
+% \begin{macrocode}
\ifdim\clrstrip at left=1sp
\advance\clrstrip at width-\linewidth
\clrstrip at left-.5\clrstrip at width
\fi
\rlap{\hskip\clrstrip at left\copy\clrstrip at box}%
+% \end{macrocode}
+% Start a new paragraph and add the lower outer padding. Also use \LaTeX's
+% \cs{@endpetrue} mechanism to let the user control whether the text after this
+% environment will be indented or not.
+% \begin{macrocode}
\par
\vskip\clrstrip at outerB
+ \@endpetrue
}
% \end{macrocode}
% \end{macro}
Modified: trunk/Master/texmf-dist/tex/latex/clrstrip/clrstrip.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/clrstrip/clrstrip.sty 2019-11-04 22:15:41 UTC (rev 52635)
+++ trunk/Master/texmf-dist/tex/latex/clrstrip/clrstrip.sty 2019-11-04 22:15:52 UTC (rev 52636)
@@ -29,7 +29,7 @@
%% and the derived files clrstrip.pdf and
%% clrstrip.sty.
%%
-\newcommand*\clrstrip at date{2019-06-03}
+\newcommand*\clrstrip at date{2019-11-03}
\ProvidesPackage{clrstrip}
[\clrstrip at date\space place contents into a full width colour strip]
\RequirePackage{keyval}
@@ -45,29 +45,8 @@
\newlength\clrstrip at width
\newlength\clrstrip at left
\clrstrip at left1sp
-\newcommand*\clrstrip at oarg{}
-\newcommand*\clrstrip at marg{}
+\newcommand*\clrstrip at arg{}
\newcommand*\clrstrip at key{\define at key{clrstrip}}
-\newcommand*\clrstrip at strip[1]
- {%
- \begingroup
- \ifx\clrstrip at oarg\@empty
- \color{#1}%
- \else
- \expandafter\color\expandafter[\clrstrip at oarg]{#1}%
- \fi
- \advance\clrstrip at innerT\ht\clrstrip at box
- \advance\clrstrip at innerB\dp\clrstrip at box
- \rlap
- {%
- \hskip-\paperwidth
- \vrule
- width 2\paperwidth
- height \clrstrip at innerT
- depth \clrstrip at innerB
- }%
- \endgroup
- }
\newcommand\clrstrip at start[1][]
{%
\colorstripSet{#1}%
@@ -76,6 +55,7 @@
\fi
\setbox\clrstrip at box\vbox\bgroup
\hsize\clrstrip at width
+ \linewidth\hsize
\color at setgroup
\clrstrip at preventIndent
}
@@ -96,8 +76,12 @@
\newcommand*\colorstripSet{\setkeys{clrstrip}}
\newenvironment{colorstrip}[2][]
{%
- \def\clrstrip at oarg{#1}%
- \def\clrstrip at marg{#2}%
+ \def\clrstrip at arg{#1}%
+ \ifx\clrstrip at arg\@empty
+ \def\clrstrip at arg{{#2}}%
+ \else
+ \def\clrstrip at arg{[{#1}]{#2}}%
+ \fi
\clrstrip at start
}
{%
@@ -106,7 +90,19 @@
\par
\vskip\clrstrip at outerT
\noindent
- \expandafter\clrstrip at strip\expandafter{\clrstrip at marg}%
+ \begingroup
+ \expandafter\color\clrstrip at arg
+ \advance\clrstrip at innerT\ht\clrstrip at box
+ \advance\clrstrip at innerB\dp\clrstrip at box
+ \rlap
+ {%
+ \hskip-\paperwidth
+ \vrule
+ width 2\paperwidth
+ height \clrstrip at innerT
+ depth \clrstrip at innerB
+ }%
+ \endgroup
\ifdim\clrstrip at left=1sp
\advance\clrstrip at width-\linewidth
\clrstrip at left-.5\clrstrip at width
@@ -114,6 +110,7 @@
\rlap{\hskip\clrstrip at left\copy\clrstrip at box}%
\par
\vskip\clrstrip at outerB
+ \@endpetrue
}
%%
%%
More information about the tex-live-commits
mailing list