From 5e729f818341f54090ea6ce534fa85aaa6d21b41 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 12 Mar 2020 22:41:10 +0000 Subject: swrule own package, from genmisc git-svn-id: svn://tug.org/texlive/trunk@54267 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/generic/genmisc/swrule.sty | 89 ------------------------ Master/texmf-dist/tex/generic/swrule/swrule.sty | 89 ++++++++++++++++++++++++ 2 files changed, 89 insertions(+), 89 deletions(-) delete mode 100644 Master/texmf-dist/tex/generic/genmisc/swrule.sty create mode 100644 Master/texmf-dist/tex/generic/swrule/swrule.sty (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/tex/generic/genmisc/swrule.sty b/Master/texmf-dist/tex/generic/genmisc/swrule.sty deleted file mode 100644 index 1632cf3c9d4..00000000000 --- a/Master/texmf-dist/tex/generic/genmisc/swrule.sty +++ /dev/null @@ -1,89 +0,0 @@ -% swrule.sty -% Written by Tobias G. Dussa -% 09oct01 -% Copyright (C) by Tobias G. Dussa -% -% Provides two macros to create english lines a.k.a. swelled rules (i.e. -% lines % that become thicker towards the middle, much like a very -% far-stretched diamond) that only use plain tex means. -% -% The macros provided are -% - \swrule{length}{maximum width} -% - \swrulex{length}{minimum width}{maximum width} -% -% The \swrule macro is just a shortcut for \swrulex{length}{0pt}{max width}. -% -% The minimum width is the width of the line at the far left and -% right ends, while the maximum width is the width of the line in -% the very middle. -% -% The english line is made up of many short lines of different widths. -% The counter variable \swrulecount specifies how many small line pieces -% should be used to approximate the english line. It is set to 50 by -% default. The larger this value is, the finer-grained the resulting -% english line will be, so that the steps will not be as obvious. -% The \swrulecount variable should never be set to one, as a division -% by zero would occur. Likewise, any value smaller than 1 is pointless, -% albeit possible. -% -% The style package is a quick hack. If any error should occur, then -% I would greatly appreciate learning about it. -% Likewise, any suggestion is appreciated. -% -% The style package is copyrighted but may be used and extended in -% any way, as long as a pointer to the original author is maintained. -% The author is not liable for any problem that may or may not result -% from using this package. Use at your own risk. -% -% Enjoy. - -\newcount\swrulecount -\newcount\swrulestep -\newdimen\swrulemin -\newdimen\swrulemax -\newdimen\swrulelength -\newdimen\swruleraise -\newdimen\swrulewidth -\newdimen\swruledelta -\newdimen\swrulepiece - -\swrulecount=50 - -\def\swrulex#1#2#3{% -\swrulestep=\swrulecount% -\advance\swrulestep by -1% -\swrulelength=#1% -\swrulemin=#2% -\swrulemax=#3% -\swrulewidth=\swrulemin% -\swruleraise=\swrulemax% -\advance\swruleraise by -\swrulemin% -\divide\swruleraise by 2% -\swruledelta=\swrulemax% -\advance\swruledelta by -\swrulemin% -\divide\swruledelta by \swrulestep% -\multiply\swrulestep by 2\advance\swrulestep by 1% -\swrulepiece=\swrulelength% -\divide\swrulepiece by \swrulestep% -\swrulestep=1% -\hbox{% -\loop% -\raise\swruleraise\hbox{\rule{\swrulepiece}{\swrulewidth}}% -\ifnum\swrulestep<\swrulecount% -\advance\swrulestep by 1% -\advance\swruleraise by -\swruledelta% -\advance\swrulewidth by 2\swruledelta% -\repeat% -\advance\swrulestep by -1% -\advance\swruleraise by \swruledelta% -\advance\swrulewidth by -2\swruledelta% -\loop% -\raise\swruleraise\hbox{\rule{\swrulepiece}{\swrulewidth}}% -\ifnum\swrulestep>1% -\advance\swrulestep by -1% -\advance\swruleraise by \swruledelta% -\advance\swrulewidth by -2\swruledelta% -\repeat% -}} - -\def\swrule#1#2{\swrulex{#1}{0pt}{#2}} diff --git a/Master/texmf-dist/tex/generic/swrule/swrule.sty b/Master/texmf-dist/tex/generic/swrule/swrule.sty new file mode 100644 index 00000000000..1632cf3c9d4 --- /dev/null +++ b/Master/texmf-dist/tex/generic/swrule/swrule.sty @@ -0,0 +1,89 @@ +% swrule.sty +% Written by Tobias G. Dussa +% 09oct01 +% Copyright (C) by Tobias G. Dussa +% +% Provides two macros to create english lines a.k.a. swelled rules (i.e. +% lines % that become thicker towards the middle, much like a very +% far-stretched diamond) that only use plain tex means. +% +% The macros provided are +% - \swrule{length}{maximum width} +% - \swrulex{length}{minimum width}{maximum width} +% +% The \swrule macro is just a shortcut for \swrulex{length}{0pt}{max width}. +% +% The minimum width is the width of the line at the far left and +% right ends, while the maximum width is the width of the line in +% the very middle. +% +% The english line is made up of many short lines of different widths. +% The counter variable \swrulecount specifies how many small line pieces +% should be used to approximate the english line. It is set to 50 by +% default. The larger this value is, the finer-grained the resulting +% english line will be, so that the steps will not be as obvious. +% The \swrulecount variable should never be set to one, as a division +% by zero would occur. Likewise, any value smaller than 1 is pointless, +% albeit possible. +% +% The style package is a quick hack. If any error should occur, then +% I would greatly appreciate learning about it. +% Likewise, any suggestion is appreciated. +% +% The style package is copyrighted but may be used and extended in +% any way, as long as a pointer to the original author is maintained. +% The author is not liable for any problem that may or may not result +% from using this package. Use at your own risk. +% +% Enjoy. + +\newcount\swrulecount +\newcount\swrulestep +\newdimen\swrulemin +\newdimen\swrulemax +\newdimen\swrulelength +\newdimen\swruleraise +\newdimen\swrulewidth +\newdimen\swruledelta +\newdimen\swrulepiece + +\swrulecount=50 + +\def\swrulex#1#2#3{% +\swrulestep=\swrulecount% +\advance\swrulestep by -1% +\swrulelength=#1% +\swrulemin=#2% +\swrulemax=#3% +\swrulewidth=\swrulemin% +\swruleraise=\swrulemax% +\advance\swruleraise by -\swrulemin% +\divide\swruleraise by 2% +\swruledelta=\swrulemax% +\advance\swruledelta by -\swrulemin% +\divide\swruledelta by \swrulestep% +\multiply\swrulestep by 2\advance\swrulestep by 1% +\swrulepiece=\swrulelength% +\divide\swrulepiece by \swrulestep% +\swrulestep=1% +\hbox{% +\loop% +\raise\swruleraise\hbox{\rule{\swrulepiece}{\swrulewidth}}% +\ifnum\swrulestep<\swrulecount% +\advance\swrulestep by 1% +\advance\swruleraise by -\swruledelta% +\advance\swrulewidth by 2\swruledelta% +\repeat% +\advance\swrulestep by -1% +\advance\swruleraise by \swruledelta% +\advance\swrulewidth by -2\swruledelta% +\loop% +\raise\swruleraise\hbox{\rule{\swrulepiece}{\swrulewidth}}% +\ifnum\swrulestep>1% +\advance\swrulestep by -1% +\advance\swruleraise by \swruledelta% +\advance\swrulewidth by -2\swruledelta% +\repeat% +}} + +\def\swrule#1#2{\swrulex{#1}{0pt}{#2}} -- cgit v1.2.3