summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ncctools/nccrules.sty
blob: 8d9bf8802e96c8212b7136ef43da0c6e7df9f308 (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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
%%
%% This is file `nccrules.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% nccrules.dtx  (with options: `package')
%% 
%% IMPORTANT NOTICE:
%% 
%% This file is a generated file from the sources of the `ncctools'
%% bundle.
%% 
%% You are not allowed to modify this file.
%% 
%% You are allowed to distribute this file if and only if
%% it is distributed with the corresponding source files in
%% the `ncctools' bundle.
%% 
%% For the copying and distribution conditions of the source files,
%% see the README file distributed with the ncctools bundle.
%%
%% File: nccrules.dtx Copyright (C) 2005 by Alexander I. Rozhenko
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{nccrules}
      [2005/05/13 v1.0 More rules (NCC)]
\RequirePackage{mboxfill}
\newcommand\dashrule{}
\DeclareRobustCommand*\dashrule[3][\z@]{%
  \setbox\@tempboxa\vbox{}%
  \NCC@composedash{\NCC@vdash{#2}}{#3}%
  \setlength\@tempdima{#1}\leavevmode
  \raise\@tempdima\hbox{%
    \vbox to\@tempdimc{\vss\unvbox\@tempboxa\vss}}%
}
\newcommand*\dashrulefill[1][\z@]{%
  \@ifnextchar[{\NCC@dashfill{#1}}{\NCC@dashfill{#1}[]}%
}
\def\NCC@dashfill#1[#2]#3#4{%
  \NCC@composedash{}{#3}%
  \advance\@tempdimb-\@tempdimc
  \setbox\@tempboxa\hb@xt@-\@tempdimb
    {\hss\dashrule[#1]{#3}{#4}\hss}%
  \mboxfill[\@tempdimc][#2]{\box\@tempboxa}%
}
\def\NCC@composedash#1#2{%
  \@tempdimb\z@ % Last space
  \@tempdimc\z@ % Accumulator
  \@tempswatrue % True value means producing an entry
  \NCC@parsedash#2 ! !\@nil{%
    \advance\@tempdimc\@tempdima
    \if@tempswa #1\@tempswafalse \else
      \@tempdimb\@tempdima \@tempswatrue
    \fi
  }%
}
\def\NCC@parsedash#1 #2\@nil#3{%
  \if/#1/\else % Empty arg. ignored
    \ifx#1!\else % Exclamation mark ends the list
      \@defaultunits\@tempdima#1pt\relax\@nnil
      #3\NCC@parsedash#2\@nil{#3}%
    \fi
  \fi
}
\def\NCC@vdash#1{%
  \setbox\@tempboxa\vbox{%
    \unvbox\@tempboxa \vskip\@tempdimb
    \setbox\@tempboxa\hbox{}%
    \@tempskipa\@tempdima % Save rule height in \@tempskipa
    \NCC@composedash{\NCC@hdash}{#1}%
    \hb@xt@\@tempdimc{\hss\unhbox\@tempboxa\hss}%
  }%
}
\def\NCC@hdash{%
  \setbox\@tempboxa\hbox{%
    \unhbox\@tempboxa \kern\@tempdimb
    \vrule \@width\@tempdima \@height\@tempskipa
  }%
}
\def\NCC@fnoterule#1#2{%
  \setlength\@tempdima{#1}%
  \setbox\@tempboxa\hb@xt@\@tempdima{#2}%
  \@tempdima\ht\@tempboxa \advance\@tempdima\dp\@tempboxa
  \@tempdimb 2.8\p@ \@tempdimc .5\@tempdima
  \ifdim\@tempdimc>\@tempdimb \@tempdimb\@tempdimc \fi
  \advance\@tempdimb\@tempdimc
  \kern-\@tempdimb
  \box\@tempboxa
  \advance\@tempdimb -\@tempdima
  \kern\@tempdimb
}
\def\NCC@fnotedashrule#1#2#3{%
  \NCC@fnoterule{#1}{\def\@tempa{#2}%
    \ifx\@tempa\@empty
      \@tempskipb\@tempdima \dashrule{\@tempskipb}{#3}%
    \else
      \dashrulefill[\z@][s]{#2}{#3}%
    \fi
  }%
}
\def\NCC@fnotecreate#1{%
  \edef\@tempa{\noexpand\newcommand*%
    \expandafter\noexpand\csname #1footnoterule\endcsname}%
  \@tempa
}
\@onlypreamble\NCC@fnotecreate
\def\NCC@fnoteprepare#1#2{%
  \@ifnextchar[{#1{#2}}{#1{#2}[.4\columnwidth]}%
}
\@onlypreamble\NCC@fnoteprepare
\newcommand\newfootnoterule{\NCC@fnoteprepare\NCC@fnotedriver}
\def\NCC@fnotedriver#1[#2]#3{%
  \NCC@fnotecreate{#1}{\NCC@fnoterule{#2}{#3}}%
}
\@onlypreamble\newfootnoterule
\@onlypreamble\NCC@fnotedriver
\newcommand\newfootnotedashrule{\NCC@fnoteprepare\NCC@fnotedashdriver}
\def\NCC@fnotedashdriver#1[#2]#3#4{%
  \NCC@fnotecreate{#1}{\NCC@fnotedashrule{#2}{#3}{#4}}%
}
\@onlypreamble\newfootnotedashrule
\@onlypreamble\NCC@fnotedashdriver
\endinput
%%
%% End of file `nccrules.sty'.