Article View: comp.text.tex
Article #10610hvdashln.sty file for dashed lines in array and tabular
From: etwz
Date: Thu, 21 Jan 1993 02:58
Date: Thu, 21 Jan 1993 02:58
117 lines
3996 bytes
3996 bytes
Hi,
A few days ago I posted a request for horizontal and vertical dashed
lines in matrix, in TeX or LaTeX. I received a style file that does
this job perfectly. After contact the author, Hiroshi Nakashima
(nakasima@kuis.kyoto-u.ac.jp), I was encouraged to post the style file
and a sample test file to the group.
I hope this will fill a gap in LaTeX, as using dash lines to represent
matrix partitioning is a common practice yet there is no related
definition in LaTeX. May be some FTP sites will store this style file.
Thanks IWAKUMA, Tetsuo for sending me the file and Donald Arseneau for
some suggestions.
Weimin ZHANG,
University of South Australia
(weimin@spri.levels.unisa.edu.au)
% ---- start of the style file ----
% hvdashln.sty : h(orizontal and )v(ertical )dash(ed )l(i)n(e).sty
%
% By nakasima@kuis.kyoto-u.ac.jp
%
% \hdashline is for the horizontal dashed line
% \vdashline is for the vertical one
%
% parameters :
%
% \hdashlinewidth (w)
% \hdashlinegap (g)
%
% w=4pt
% |--- --- --- ---|
% g=4pt
%
\newcount\hdl@columns
\let\hdl@mkpream\@mkpream
\def\@mkpream{\hdl@columns\@ne \hdl@mkpream}
\def\@addamp{\if@firstamp\@firstampfalse
\else\edef\@preamble{\@preamble &}\advance\hdl@columns\@ne\fi}
\def\hdashline{\multispan{\hdl@columns}\unskip
\vrule\@height\arrayrulewidth\@width\hdashlinewidth
\hskip.5\hdashlinegap
\xleaders\hbox{\hskip.5\hdashlinegap
\vrule\@height\arrayrulewidth\@width\hdashlinewidth
\hskip.5\hdashlinegap}\hfill
\hskip.5\hdashlinegap
\vrule\@height\arrayrulewidth\@width\hdashlinewidth\cr
\noalign{\vskip-\arrayrulewidth}}
\newdimen\hdashlinewidth \hdashlinewidth4pt %
\newdimen\hdashlinegap \hdashlinegap4pt %
\def\vdashline{\hskip\arraycolsep
\@tempdima\ht\@arstrutbox \advance\@tempdima\dp\@arstrutbox
\lower\dp\@arstrutbox\vbox to\@tempdima{
\hrule\@height.5\hdashlinewidth\@width\arrayrulewidth
\vskip.5\hdashlinegap
\xleaders\vbox{\vskip.5\hdashlinegap
\hrule\@height\hdashlinewidth\@width\arrayrulewidth
\vskip.5\hdashlinegap}\vfil
\vskip.5\hdashlinegap
\hrule\@height.5\hdashlinewidth\@width\arrayrulewidth}%
\hskip\arraycolsep}
\endinput
% sample
\documentstyle[hvdashln]{article}
\title{Usage of {\tt hvdashln.sty}}
\author{Nakashima}
\date{Nov. 16, 1992}
\hdashlinewidth=2pt \hdashlinegap=2pt
\begin{document}
\maketitle\thispagestyle{empty}
Definitions of horizontal and vertical dashed lines for
{\tt array} and {\tt tabular} environment.
Instead of partial horizontal dashed line by
the \verb+\cline{2-3}+ by Isozaki,
\verb+\hdashline+ fills the full width.
The proportion of the dashed line is defined by the two
parameters: \verb+\hdashlinewidth=2pt+ and
\verb+\hdashlinegap=2pt+, where the former defines the
width of the dash and the latter sets their gap.
The default values of these are {\tt 4pt} while
{\tt 2pt} is employed in the examples below.
\medskip
\[
\left[
\begin{array}{c @{\vdashline} cc}
A & B & C \\
\hdashline
D & E & F \\
G & H & I
\end{array}
\right]
\]
\bigskip
\begin{minipage}[t]{.48\textwidth}
\begin{center}
\begin{tabular}{|c|c|c|} \hline
a & b & c \\ \hline
a & b & c \\ \hline
a & b & c \\ \hline
\end{tabular}
\end{center}
\end{minipage}
\begin{minipage}[t]{.48\textwidth}
\begin{center}
\begin{tabular}{|c @{\vdashline} c|c|} \hdashline
a & b & c \\ \hdashline
a & b & c \\ \hline
a & b & c \\ \hdashline
\end{tabular}
\end{center}
\end{minipage}
\end{document}
% (Mitsuo Hirata)
% (hirata@nssun.te.chiba-u.ac.jp)
% ---- end of the style file ----
Technical Details
Message-ID:
<19627.2b5ea519@levels.unisa.edu.au>Path:
arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!yoyo.aarnet.edu.au!news.adelaide.edu.au!levels!etwzShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!yoyo.aarnet.edu.au!news.adelaide.edu.au!levels!etwz From: etwz@levels.unisa.edu.au Newsgroups: comp.text.tex Subject: hvdashln.sty file for dashed lines in array and tabular Message-ID: <19627.2b5ea519@levels.unisa.edu.au> Date: 21 Jan 93 13:28:57 +1030 Organization: University of South Australia Lines: 118