summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/decorule/decorule.sty
blob: 88de293c1a907ad559ce0247bec3c0cb5850157a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
%%
%% This is file `decorule.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% decorule.dtx  (with options: `package')
%% 
%% This is a generated file.
%% 
%% Copyright © 2010 by Peter Flynn
%% 
%% This file was generated from an XML master source.
%% Amendments and corrections should be notified to the maintiner
%% for inclusion in future versions.
%% 
\NeedsTeXFormat{LaTeX2e}[2009/09/24]
\ProvidesPackage{decorule}[2020/04/01 v0.7
  A decorative swelled rule for LaTeX]
%%
%% Packages required for the class or package
%%
%% Allow infinitely-variable font scaling.
\RequirePackage{fix-cm}%
%% Provide for graphics (PNG, JPG, or PDF format (only) for pdflatex; EPS format (only) for standard \LaTeX{}).
\RequirePackage{graphicx}%
%%
%% ******************************************************************
%%
%% Preliminary declarations
\newcounter{DCR@min}
\setcounter{DCR@min}{1}
\newcounter{DCR@max}
\setcounter{DCR@max}{20}
\newcounter{DCR@step}
\setcounter{DCR@step}{1}
\newcounter{DCR@rotate}
\setcounter{DCR@rotate}{45}
\newcounter{DCR@size}
\newlength{\DCR@raise}
\newlength{\DCR@skip}
\newcommand{\DCR@symbol}{\ensuremath{\sim}}
%%
%% ******************************************************************
%%
%% The main macro
\newcommand{\decorule}{%
  \begingroup\fontencoding{OT1}\fontfamily{cmr}\selectfont%
  \setcounter{DCR@size}{\c@DCR@min}%
  \loop
    \setlength{\DCR@raise}{\c@DCR@size pt}%
    \divide\DCR@raise by2
    \raisebox{-\DCR@raise}{\fontsize{\c@DCR@size}{0}\selectfont
      \rotatebox{\the\c@DCR@rotate}{%
        \reflectbox{\hbox to\c@DCR@size pt{\hss\DCR@symbol\hss}}}}%
    \setlength{\DCR@skip}{\c@DCR@size pt}%
    \divide\DCR@skip by3
    \multiply\DCR@skip by2
    \kern-\DCR@skip
    \addtocounter{DCR@size}{\c@DCR@step}%
    \ifnum\c@DCR@size<\c@DCR@max
  \repeat
  \setlength{\DCR@raise}{\c@DCR@max pt}%
  \divide\DCR@raise by2
  \raisebox{-\DCR@raise}{%
    \fontsize{\c@DCR@max}{0}\selectfont
    \rotatebox{\the\c@DCR@rotate}{\reflectbox{\hbox
        to\c@DCR@max pt{\hss\DCR@symbol\hss}}}}%
  \loop
    \setlength{\DCR@skip}{\c@DCR@size pt}%
    \divide\DCR@skip by3
    \multiply\DCR@skip by2
    \kern-\DCR@skip
    \setlength{\DCR@raise}{\c@DCR@size pt}%
    \divide\DCR@raise by2
    \raisebox{-\DCR@raise}{%
    \fontsize{\c@DCR@size}{0}\selectfont
    \rotatebox{\the\c@DCR@rotate}{\reflectbox{\hbox
        to\c@DCR@size pt{\hss\DCR@symbol\hss}}}}%
    \addtocounter{DCR@size}{-\c@DCR@step}%
    \ifnum\c@DCR@size>\c@DCR@min
  \repeat
  \setlength{\DCR@skip}{\c@DCR@min pt}%
  \divide\DCR@skip by3
  \multiply\DCR@skip by2
  \kern-\DCR@skip
  \setlength{\DCR@raise}{\c@DCR@min pt}%
  \divide\DCR@raise by2
  \raisebox{-\DCR@raise}{%
  \fontsize{\c@DCR@min}{0}\selectfont
  \rotatebox{\the\c@DCR@rotate}{\reflectbox{\hbox
        to\c@DCR@min pt{\hss\DCR@symbol\hss}}}}%
  \endgroup}

\endinput
%%
%% End of file `decorule.sty'.