From da82d3fad207968953c72f12496f498ef2a0afe0 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 30 Jul 2018 21:12:14 +0000 Subject: clrstrip (30jul18) git-svn-id: svn://tug.org/texlive/trunk@48313 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/clrstrip/clrstrip.sty | 115 ++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/clrstrip/clrstrip.sty (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/latex/clrstrip/clrstrip.sty b/Master/texmf-dist/tex/latex/clrstrip/clrstrip.sty new file mode 100644 index 00000000000..c0e792fdd95 --- /dev/null +++ b/Master/texmf-dist/tex/latex/clrstrip/clrstrip.sty @@ -0,0 +1,115 @@ +%% +%% This is file `clrstrip.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% clrstrip.dtx (with options: `pkg') +%% +%% -------------------------------------------------------------- +%% clrstrip -- place contents into a full width colour strip +%% E-mail: jspratte@yahoo.de +%% Released under the LaTeX Project Public License v1.3c or later +%% See http://www.latex-project.org/lppl.txt +%% -------------------------------------------------------------- +%% +%% Copyright (C) 2018 Jonathan P. Spratte +%% +%% This work may be distributed and/or modified under the conditions of the +%% LaTeX Project Public License (LPPL), either version 1.3c of this license or +%% (at your option) any later version. The latest version of this license is in +%% the file: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This work is "maintained" (as per LPPL maintenance status) by +%% Jonathan P. Spratte. +%% +%% This work consists of the file clrstrip.dtx +%% and the derived files clrstrip.pdf and +%% clrstrip.sty. +%% +\ProvidesPackage{clrstrip} + [2018/07/30 place contents into a full width colour strip] +\RequirePackage{keyval} +\newsavebox\clrstrip@box +\newlength\clrstrip@innerT +\clrstrip@innerT\medskipamount +\newlength\clrstrip@innerB +\clrstrip@innerB\clrstrip@innerT +\newlength\clrstrip@outerT +\clrstrip@outerT\clrstrip@innerT +\newlength\clrstrip@outerB +\clrstrip@outerB\clrstrip@innerT +\newlength\clrstrip@width +\newlength\clrstrip@left +\clrstrip@left1sp +\newcommand*\clrstrip@oarg{} +\newcommand*\clrstrip@marg{} +\newcommand*\clrstrip@key{\define@key{clrstrip}} +\newcommand*\clrstrip@strip@a[1] + {% + \expandafter\clrstrip@strip@b\expandafter{\clrstrip@oarg}{#1}% + } +\newcommand*\clrstrip@strip@b[2] + {% + \begingroup + \if\relax\detokenize{#1}\relax + \color{#2}% + \else + \color[#1]{#2}% + \fi + \advance\clrstrip@innerT\ht\clrstrip@box + \advance\clrstrip@innerB\dp\clrstrip@box + \rlap + {% + \hskip-\paperwidth + \vrule + width 2\paperwidth + height \clrstrip@innerT + depth \clrstrip@innerB + }% + \endgroup + } +\newcommand\clrstrip@start[1][] + {% + \colorstripSet{#1}% + \ifdim\clrstrip@width=\z@ + \clrstrip@width\linewidth + \fi + \setbox\clrstrip@box\vbox\bgroup + \hsize\clrstrip@width + \noindent\ignorespaces + } +\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} +\clrstrip@key{inner bot}{\clrstrip@innerB#1\relax} +\clrstrip@key{outer top}{\clrstrip@outerB#1\relax} +\clrstrip@key{outer bot}{\clrstrip@outerB#1\relax} +\clrstrip@key{width}{\clrstrip@width#1\relax} +\clrstrip@key{left}{\clrstrip@left#1\relax} +\newcommand*\colorstripSet{\setkeys{clrstrip}} +\newenvironment{colorstrip}[2][] + {% + \def\clrstrip@oarg{#1}% + \def\clrstrip@marg{#2}% + \clrstrip@start + } + {% + \egroup + \par + \vskip\clrstrip@outerT + \noindent + \expandafter\clrstrip@strip@a\expandafter{\clrstrip@marg}% + \ifdim\clrstrip@left=1sp + \advance\clrstrip@width-\linewidth + \clrstrip@left-.5\clrstrip@width + \fi + \rlap{\hskip\clrstrip@left\usebox\clrstrip@box}% + \par + \vskip\clrstrip@outerB + } +%% +%% +%% End of file `clrstrip.sty'. -- cgit v1.2.3