summaryrefslogtreecommitdiff
path: root/macros/latex209/contrib/misc/hackarray.sty
blob: 9dad5304661d12504f3cb957743894ac08f3694f (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
%From: bjnw@castle.ed.ac.uk (Brian Wylie)
%Subject: \bbegin{eqnarray}{rllccl}
%Keywords: equation+array != eqnarray
 
%I've been looking for a successor to the LaTeX eqnarray environment
%which allowed more control over the format and number of "columns", as
%one might naturally expect to be specified by
 
%     \begin{eqnarray}{rlc|cl}
%       right & left & centre & vline & centre & left \label{eqn2a} \\
%       right & left & centre & vline & centre & left \label{eqn2b}
%     \end{eqnarray}
 
%Having scoured Clarkson, etc, and failing to come find anything hopeful
%I've finally plucked up the courage to have a go at it and see what I
%could come up with (I don't really know any TeX but it tends to frighten
%me when I look through latex.tex :-).
 
%I've been pfaffing with it for a bit and haven't really managed to get
%it completely together.  I've included a copy of my attempts for your
%perusal, and hope that you don't die laughing at the horrible nastiness
%of this total abortion. 
 
%=========================>8 hackarray.sty 8<============================
% hackarray.sty 
%
% Bastard offspring of the eqnarray and tabular environments
%
% (Only tested with fleqn.sty, probably won't work with anything else)
 
\newlength{\tmp}
\setlength{\tmp}{\textwidth}
\addtolength{\tmp}{-\mathindent}
 
\newcommand{\num}{\stepcounter{equation}\makeatletter
\let\@currentlabel=\theequation{\rm (\theequation)}}
 
\newenvironment{hackarray}[1]{\begin{displaymath}%
\begin{tabular*}{\tmp}{#1@{\extracolsep{\fill}}l@{\protect\num}}}%
{\end{tabular*}\end{displaymath}}
 
% Use like a tabular environment BUT include an extra column of &'s at end
% (which aren't specified in the column format) or put a label there.
% Also remember that all text is formatted in text mode NOT math mode !
%   e.g.
%     \begin{hackarray}{rlc|cl}
%       right & left & centre & vline & centre & left & \label{} \\
%       right & left & centre & vline & centre & left &
%     \end{hackarray}
\endinput 
=========================>8 hackarray.sty 8<============================
 
I realise that as a "eqnarray" substitute it's a bit lame to have each
array element formatted in text mode (rather than math mode), however,
for my immediate needs this wasn't a serious problem (most of it wasn't
maths anyway) while there were other more worrying problems (like the
need for the trailing null column). 
 
As you see, it has a few problems.  These may be fixable, but I think
I've done as much as I can.  Any suggestions greatly appreciated,
including any pointers to code which does things properly.
 
  Slainte,                  "Since parallel programming tools exist,
    Brian.                   MIMD machines are easy to use". -- Meiko 04/90