summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/xhfill/xhfill.sty
blob: 3d413f697db90af99cfd4e675717987df46b1aff (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
%% $Id: xhfill.sty 500 2011-05-14 09:39:57Z herbert $
%%
%% This is file `xhfill.sty',
%%
%% IMPORTANT NOTICE:
%%
%% Package `xhfill'
%%
%% Herbert Voss <hvoss _at_ tug.org>
%%
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN archives
%% in directory macros/latex/base/lppl.txt.
%%
%% DESCRIPTION:
%%   `xhfill' is a package for extended hfillrules
%%
%% Usage
%% \xhrulefill{blue}{5pt}
%% \xrfill[raise]{ruleheight}[color]
%% \xhrectanglefill{<height>}{<linewidth>}
%% \xhrectanglefill{1cm}{1pt}
%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{xcolor}
\RequirePackage{calc}
\RequirePackage{xspace}
\def\fileversion{1.01}
\def\filedate{2011/05/14}

\ProvidesPackage{xhfill}[\filedate\ v \fileversion\ modify width and color of hrulefill]
%
\providecommand{\xhrulefill}[2]{%
    \leavevmode\color{#1}\leaders\hrule height #2%
    \hfill\color{black}\xspace}
%
\providecommand{\xhrectanglefill}[2]{%
  \rule{#2}{#1}\kern-#2\kern.1pt%
  \cleaders
  \hbox to 1pt{%
	\hss
	\rlap{\rule{1.2pt}{#2}}%
	\raisebox{#1-#2}{\rule{1.2pt}{#2}}%
	\hss
  }\hfill\kern.1pt\kern-#2\rule{#2}{#1}%
  \xspace%
}
\def\xrfill{\@ifnextchar[{\@xrfilli}{\@xrfilli[1ex]}}
\def\@xrfilli[#1]#2{%
  \@ifnextchar[{\@xrfillii[#1]{#2}}{\@xrfillii[#1]{#2}[black]}}
\def\@xrfillii[#1]#2[#3]{%
  \leaders
  \hbox{\raisebox{#1}{\color{#3}\rule{1.2pt}{#2}}}\hfill%
  \color{black}}
%
\def\xdotfill{\@ifnextchar[{\@xdotfilli}{\@xdotfilli[0.5ex]}}
\def\@xdotfilli[#1]#2{%
  \@ifnextchar[{\@xdotfillii[#1]{#2}}{\@xdotfillii[#1]{#2}[black]}}
\def\@xdotfillii[#1]#2[#3]{%
  \xleaders
  \hbox{\raisebox{#1}{\color{#3}\rule{1.2pt}{#2}\kern1.2pt}}\hfill%
  \color{black}}

\endinput