summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/dashbox
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-01-12 23:54:01 +0000
committerKarl Berry <karl@freefriends.org>2006-01-12 23:54:01 +0000
commitc6c7be53ce73db70419555ec68104145679d64a8 (patch)
tree34f792d24180b9d673c0f2a98ff6533e5f5de021 /Master/texmf-dist/tex/latex/dashbox
parent53f50745b3fa0ec937708aa1f17bc3e3d24aef90 (diff)
dashbox
git-svn-id: svn://tug.org/texlive/trunk@814 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/dashbox')
-rw-r--r--Master/texmf-dist/tex/latex/dashbox/dashbox.sty145
1 files changed, 145 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/dashbox/dashbox.sty b/Master/texmf-dist/tex/latex/dashbox/dashbox.sty
new file mode 100644
index 00000000000..328aa690dff
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/dashbox/dashbox.sty
@@ -0,0 +1,145 @@
+%%
+%% This is file `dashbox.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% dashbox.dtx (with options: `package')
+%% Dashed and layered boxes.
+%%
+%% File `dashbox.dtx'.
+%% Copyright (C) 1997-2001 Reuben Thomas (rrt@sc3d.org)
+%% This file is distributed under the LaTeX Project Public License,
+%% and comes with no warranty.
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{dashbox}
+ [2001/12/11 v1.14 Dashed and layered boxes]
+\RequirePackage{calc}
+\RequirePackage{ifthen}
+\newlength{\dashlength} \setlength{\dashlength}{6pt}
+\newlength{\dashdash} \setlength{\dashdash}{3pt}
+\newlength{\layersize} \setlength{\layersize}{\dashdash}
+\newcommand{\hd@shrule}[1]{%
+ \hbox to #1%
+ {\vrule height \fboxrule width \dashdash%
+ \cleaders\hbox to \dashlength%
+ {\hfill\rule{\dashdash}{\fboxrule}\hfill}\hfill%
+ \ifthenelse{\lengthtest{#1 > 2\dashdash}}%
+ {\vrule height \fboxrule width \dashdash}{}%
+ }}
+\newcommand{\vd@shrule}[1]{%
+ \vbox to #1%
+ {\hrule height \dashdash width \fboxrule%
+ \cleaders\vbox to \dashlength%
+ {\vfill\rule{\fboxrule}{\dashdash}\vfill}\vfill%
+ \ifthenelse{\lengthtest{#1 > 2\dashdash}}%
+ {\hrule height \dashdash width \fboxrule}{}%
+ }}
+\newsavebox{\d@shedsavebox}
+\newlength{\d@shedboxwidth}
+\newlength{\d@shedboxtotalheight}
+\newcommand{\m@kedashbox}{%
+ \setlength{\d@shedboxtotalheight}%
+ {\dp\d@shedsavebox+\ht\d@shedsavebox+\fboxsep*2+\fboxrule*2}%
+ \raisebox{-\fboxrule-\fboxsep-\dp\d@shedsavebox}{%
+ \parbox[b]{\d@shedboxwidth}{%
+ \offinterlineskip%
+ \parskip=0pt%
+ \hd@shrule{\d@shedboxwidth}%
+ \kern-\fboxrule%
+ \par%
+ \parbox{\fboxrule}{\vd@shrule{\d@shedboxtotalheight}}%
+ \kern\fboxsep%
+ \parbox{\wd\d@shedsavebox}%
+ {\vspace{\fboxsep}\usebox{\d@shedsavebox}\vspace{\fboxsep}}%
+ \kern\fboxsep%
+ \parbox{\fboxrule}{\vd@shrule{\d@shedboxtotalheight}}%
+ \par%
+ \kern-\fboxrule%
+ \hd@shrule{\d@shedboxwidth}}%
+ }}
+\newcommand{\dbox}[1]{%
+ \sbox{\d@shedsavebox}{#1}%
+ \setlength{\d@shedboxwidth}{\wd\d@shedsavebox+\fboxsep*2+\fboxrule*2}%
+ \m@kedashbox}
+\def\dashbox{\@ifnextchar[\@dashbox\dbox}
+\def\@dashbox[#1]{\@ifnextchar[{\@idashbox[#1]}{\@idashbox[#1][c]}}
+\long\def\@idashbox[#1][#2]#3%
+ {\setlength{\d@shedboxwidth}{#1}%
+ \savebox{\d@shedsavebox}[#1-\fboxsep*2-\fboxrule*2][#2]{#3}%
+ \m@kedashbox}
+\newsavebox{\l@yersavebox}
+\newlength{\l@yerwidth}
+\newlength{\l@yerboxwidth}
+\newlength{\l@yertotalheight}
+\newlength{\l@yerlineheight}
+\newlength{\l@yervoffset}
+\newcommand{\m@kelayer}[1]{%
+ \setlength{\l@yertotalheight}%
+ {\dp\l@yersavebox+\ht\l@yersavebox+\layersize-#1\layersize}%
+ \setlength{\l@yerlineheight}%
+ {\ht\l@yersavebox-#1\layersize-\fboxrule}%
+ \setlength{\l@yervoffset}%
+ {-\layersize-\dp\l@yersavebox}%
+ \setlength{\l@yerboxwidth}%
+ {\wd\l@yersavebox+\layersize-#1\layersize}%
+ \parbox{\l@yerwidth}{%
+ \offinterlineskip%
+ \parskip=0pt%
+ \usebox{\l@yersavebox}%
+ \rule[\l@yerlineheight]{\layersize}{\fboxrule}%
+ \kern-\fboxrule%
+ \rule[\l@yervoffset]{\fboxrule}{\l@yertotalheight}%
+ \kern-\wd\l@yersavebox\kern-\layersize\kern#1\layersize
+ \rule[\l@yervoffset]{\fboxrule}{\layersize}%
+ \kern-\fboxrule
+ \rule[\l@yervoffset]{\l@yerboxwidth}{\fboxrule}%
+ }}
+\newcommand{\l@yer}[2]{%
+ \sbox{\l@yersavebox}{#2}%
+ \setlength{\l@yerwidth}{\wd\l@yersavebox+\layersize}%
+ \m@kelayer{#1}}
+\newcommand{\m@kedashlayer}[1]{%
+ \setlength{\l@yertotalheight}%
+ {\dp\l@yersavebox+\ht\l@yersavebox+\layersize-#1\layersize}%
+ \setlength{\l@yerlineheight}{\ht\l@yersavebox-#1\layersize-\fboxrule}%
+ \setlength{\l@yervoffset}{-\layersize-\dp\l@yersavebox}%
+ \setlength{\l@yerboxwidth}%
+ {\wd\l@yersavebox+\layersize-#1\layersize}%
+ \parbox{\l@yerwidth}{%
+ \offinterlineskip%
+ \parskip=0pt%
+ \usebox{\l@yersavebox}%
+ \raisebox{\l@yerlineheight}{\hd@shrule{\layersize}}%
+ \kern-\fboxrule%
+ \raisebox{\l@yervoffset}%
+ {\parbox[b]{\fboxrule}{\vd@shrule{\l@yertotalheight}}}%
+ \kern-\wd\l@yersavebox\kern-\layersize\kern#1\layersize
+ \raisebox{\l@yervoffset}%
+ {\parbox[b]{\fboxrule}{\vd@shrule{\layersize}}}%
+ \kern-\fboxrule
+ \raisebox{\l@yervoffset}%
+ {\hd@shrule{\l@yerboxwidth}}%
+ }}
+\newcommand{\dl@yer}[2]
+ {\sbox{\l@yersavebox}{#2}%
+ \setlength{\l@yerwidth}{\wd\l@yersavebox+\layersize}%
+ \m@kedashlayer{#1}}
+\newcounter{l@yercount}
+\newcommand{\l@yers}[3]
+ {\setcounter{l@yercount}{1}%
+ \sbox{\l@yersavebox}{#2}%
+ \whiledo{\not\(\value{l@yercount} > #1\)}%
+ {\sbox{\l@yersavebox}%
+ {#3{\value{l@yercount}}{\usebox{\l@yersavebox}}}%
+ \stepcounter{l@yercount}}%
+ \usebox{\l@yersavebox}%
+ }
+\newcommand{\lbox}[2][2]{%
+ \l@yers{#1}{#2}{\l@yer}}
+\newcommand{\dlbox}[2][2]{%
+ \l@yers{#1}{#2}{\dl@yer}}
+\endinput
+%%
+%% End of file `dashbox.sty'.