summaryrefslogtreecommitdiff
path: root/usergrps/uktug/baskervi/4_4/siep.tex
blob: e129727c2fb2f66a17f32a05368436ee20067c93 (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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
\newcommand{\px}[1]{{\parbox[t]{1.1in}{\raggedright #1}}}
\newcommand{\py}[1]{{\parbox[t]{1.7in}{\raggedright #1}}}
\newcommand{\dbr}{\discretionary{}{}{}}
\newcommand{\mydefaults}{%
  \renewcommand{\baselinestretch}{1.1}%
  \sf
  \scriptsize}


\title{Table design}
\author[Siep Kroonenberg]{Siep Kroonenberg\\
\texttt{N.S.Kroonenberg@eco.rug.nl}}
\begin{Article}

\begin{figure*}

{\sf\bf Example: before and after}

\vspace{9pt}

\footnotesize
\noindent
\begin{minipage}[t]{3.2in}
{\bf Economic forecasts for 1992}

\begin{tabular}{|l|r@{}l|r@{}l|}
\hline
           & \multicolumn{4}{c|}{forecast}\\
\cline{2-5}
variable  & \multicolumn{2}{c|}{Grecon} &
  \multicolumn{2}{c|}{CPB}   \\
           &              &               &
  \multicolumn{2}{c|}{(MEV '92)}\\
\hline
           &\multicolumn{4}{l|}{\% mutations}\\
           &\multicolumn{4}{l|}{w.r.t. 1991}\\
\cline{2-5}
real consumption ($c$)        & 1&.1   &1&.25\\
price index consumption ($p_c$)         & 2&.6   &3&.25\\
real investments ($i_m$)         &1&.4    &-2&.5\\
export price index ($p_b$)            & 3&.5   &3&.25\\
real import of goods ($m$)   & 4&.1   &3&\\
real output of goods ($v'$)   &2&.5 &2&.1\footnote{%
  The quantities $v'$ and $bpr$ aren't given as such by the CPB. The 
  CPB data presented here are computed using their GRECON definitional 
  equations. For details, see appendix D.} \\
real domestic production ($bpr$) &1&.4 &1&.6\\
private employment ($a$) &0&.32 &0&\\
wage rate ($l$) &4&.0 &4&\\
government income (\%) &-0&.1 & \multicolumn{2}{c|}{--\footnote{%
Not available.}
}\\
\ \ from output of goods ($iso'$) &&&&\\
\cline{2-5}
& \multicolumn{4}{l|}{absolute quantities}\\
\cline{2-5}
unemployment ($\times$1000 persons) &510&\footnote{%
  Not a model outcome: see text in par.\ 3.1 and 3.2.} & 525&\\
balance of payments ($10^9$ Hfl) &24&.4&25&.0 \\
\hline
\end{tabular}
\end{minipage}\hfill%
%
\begin{minipage}[t]{3.1in}
\mydefaults
\mpfoot
{\bf\small Economic forecasts for 1992}

\vspace{-3pt}

\noindent\rule{\linewidth}{1pt}

\vspace*{3pt}
\begin{tabular*}{\linewidth}{@{}l@{~~~~}r@{}lr@{}l@{}}
  & \multicolumn{4}{l@{}}{\bf\sf Grecon~~~~~CPB\footnote{MEV '92}}
    \\[3pt]
\hline \\[-6pt]
\em mutations w.r.t. 1991 \\
real consumption        ($c$)        & 1&.1   &1&.25 \\
price index consumption ($p_c$)         & 2&.6   &3&.25 \\
real investments ($i_m$)   &1&.4    &$-$2&.5 \\
export price index ($p_b$)            & 3&.5   &3&.25 \\
real import of goods ($m$)   & 4&.1   &3 \\
real output of goods ($v'$)   &2&.5 &2&.1\footnote{%
  The quantities $v'$ and $bpr$ aren't given as such by the CPB. The 
  CPB data presented here are computed using their GRECON definitional 
  equations. For details, see appendix D.} \\
real domestic production ($bpr$)
                                &1&.4 &1&.6 \\
private employment ($a$)
                                &0&.32 &0 \\
wage rate ($l$)                  &4&.0 &4 \\
government income (\%) \\
\ \ from output of goods ($iso'$)  &$-$0&.1 &--&{}\footnote{%
   Not available}\\[6pt]
\em absolute quantities \\
unemployment ($\times$1000)        & 510 &\footnote{%
  Not a model outcome: see text in par.\ 3.1 and 3.2.} & 525 \\
balance of payments (10$^9$ Hfl) &24&.4 & 25&.0
\end{tabular*}
\vspace*{-6pt}
\end{minipage}

\vspace{9pt}

\end{figure*}

\begin{quote}
{\em [Editor's note: I am grateful to
Siep Kroonenberg and Gerard van Nes (editor) for permission to reprint this
article from MAPS,  the journal of the Nederlandstalige \TeX\
Gebruikersgroep.]}
\end{quote}

\noindent
\LaTeX\ users generally seem unaware of current ideas on table design. 
The following table is a typical \LaTeX\ production: 

\vspace{6pt}

{\footnotesize
\begin{tabular}{|l|rr|}
\hline
\multicolumn{3}{|c|}{\bf \LaTeX\ table design}\\
\hline
                                 & 1991 & 1992 \\
\hline
Unemployment ($\times$1000)      &  500 &  600 \\
Balance of Payments (10$^9$ Hfl) & 24 &   25 \\
\hline
\end{tabular}}

\vspace{6pt}

In a professionally-designed publication, the above table would 
probably look more like this:

\vspace{6pt}

{\mydefaults
\begin{tabular}{@{}lrr@{}}
\multicolumn{3}{@{}l@{}}{\small\bf Common sense table design} \\[3pt]
\hline \\[-6pt]
                               & \bf 1991 & \bf 1992 \\ [3pt]
\cline{2-3} \\[-6pt]
Unemployment ($\times$1000)      &  500 &  600 \\
Balance of Payments (10$^9$ Hfl) & 24 &   25 \\
\end{tabular}}

\vspace{6pt}

If you read a book on typography, \eg \cite{treebus} or \cite{mclean}: 
you'll find that they use rules and boxes with far more restraint, and 
rely more on white space and variation in typefaces for organization.

The table examples in \cite{lamport} were (I hope) merely intended to 
demonstrate techniques. However, their style was almost unanimously 
adopted by \LaTeX\ users.

So I think that some design education is in order. I am not a 
design professional. However, many people never even think about 
table design; so if I set them thinking and they start reading books on 
typography by real professionals then this paper has served its purpose.

{\bf Note.} This is not meant to be a technical exposition. 
\cite{bernard} and \cite{lamport} tell you most of the technical things 
you need to know. All the same, I have indicated here and there with 
what codes or constructs you might accomplish certain effects.

\section{Basics of table design}

A table should present its information as clearly as possible. 
Typographic means to organize this information includes rules, white 
space, choice of typefaces and appropriate headings and captions. But 
if a feature doesn't help to make a table clearer, it had better be 
left out.

\vspace{6pt}

{\mydefaults
\noindent\begin{tabular*}{\linewidth}{@{}lll@{}}
\multicolumn{3}{@{}l@{}}{\small\bf Macroeconomic memoranda} \\[3pt]
\hline \\[-9pt]
1. & \px{Karl L\"ausche, Maria Vader, Theo Zernike} &
  \py{Money illusion and savings illusion; an illusionistic look 
  on neo-\dbr Hegel\-ian monetary theory} \\ \\[-6pt]
\hline \\[-9pt]
2. & \px{Hendrik Kooy\-ker, Johan Zonder\-link} &
  \py{BIGTHUMB, a software package for handling missing and politically 
  incorrect data} \\ \\[-6pt]
\hline \\[-9pt]
3. & Anneke~Draaijer &
  \py{Consumer behavior, expectation formation and the long-term 
  economic effects of risk-aversion} \\ \\[-6pt]
\hline
\end{tabular*}}

\vspace{6pt}

\subsection*{Rules and boxes}
Rules have their uses. They can emphasize headings. They can also 
separate different items and unite the several data for one item, as in 
the table above. Vertical rules, as in the table below, would have the 
opposite effect and would be no help at all in making the table easier 
to read.

\vspace{6pt}

{\mydefaults
\noindent\begin{tabular*}{\linewidth}{@{}l|l|l@{}}
\multicolumn{3}{@{}l@{}}{\small\bf Macroeconomic memoranda} \\[3pt]
\hline && \\
1. & \px{Karl L\"ausche, Maria Vader, Theo Zernike} &
  \py{Money illusion and savings illusion; an illusionistic look 
  on neo-\dbr Hegel\-ian monetary theory} \\ && \\
2. & \px{Hendrik Kooy\-ker, Johan Zonder\-link} &
  \py{BIGTHUMB, a software package for handling missing and politically 
  incorrect data} \\ && \\
3. & Anneke~Draaijer &
  \py{Consumer behavior, expectation formation and the long-term 
  economic effects of risk-aversion} \\ && \\
\hline
\end{tabular*}}

\vspace{6pt}

But even in the earlier example one might wonder whether white space 
wouldn't have been more effective than rules.

A table may also be boxed to set it off from the surrounding text. But 
\LaTeX\ users normally don't go through the trouble of wrapping text 
around tables and figures; therefore, there is little reason to box in 
a table.

In all cases, there should be enough space between rules and text. A 
rule too close to text interferes with readability and makes the text 
look cramped.

An alternative to rules or boxes is a shaded background, preferably in 
a second colour. This is not supported by \LaTeX\ as far as I know, 
although with PostScript some tricks are possible (see \eg 
\cite{bernard} section 11.6). This formatting device requires high 
output quality in order to look good.

\subsection*{Alignment and justification}

A column of text labels can be left- or right-aligned, or centered. If 
the table has any length at all, a centered column can easily look 
sloppy. With left- or right-alignment there is at least one straight 
edge to give the column structure. Think twice before centering a 
column in a longer table.

A column of figures is usually decimally aligned (see below
for some technical issues). If the figures are unrelated, 
you may consider right- or left-alignment instead.

Don't justify text inside a narrow column or you'll end up with large 
distracting holes between words. This is easier said than done, but 
see further below.

\subsection*{Headings}
Headings may get added emphasis by setting them bold, italic, at a 
larger point size or in a different typeface. Don't go overboard, 
though. The heading of a centered or decimally-aligned column may need 
some manual adjustment.

\section{An example}
We illustrate some of these points with the `before-and-after' example.
It is sufficiently complex to illustrate a number of points; I 
am not implying that it is any worse than other \LaTeX\ tables I have 
seen. The `before' table is a \LaTeX\ remake of a table from 
\cite{grecon}. At an earlier occasion, it has been used as a 
demonstration of \LaTeX's table-making capabilities.

The example table contains footnotes; therefore it is enclosed in a 
minipage environment.

\subsection*{Rules}
The most conspicuous shortcoming of the `before' example is the tight 
spacing between horizontal lines and text. I am not aware of a 
parameter which controls this distance; however, the `\verb+\\+' 
command takes an optional length parameter, also in a \verb+tabular+ 
environment.

In this case, as in most cases, the vertical rules are better left out. 
It is advisable to begin and end the column specification with 
\verb+@{}+:

\begin{verbatim}
\begin{tabular}{@{}l@{}r@{}lr@{}l@{}}
\end{verbatim}

Without vertical rules, no white space needs to be reserved 
at the left- and righthand sides.

Actually, I used a \verb+tabular*+ environment, which allowed me to 
set the width to \verb+\linewidth+: exactly the width of the 
minipage.

Another unfortunate detail is the footnote rule next to the bottom 
rule. I solved this by dropping the bottom rule. Also, I redefined in a 
separate style file several aspects of minipage footnotes: among 
others, the footnote rule now stretches across the width of the 
minipage.

The rule under the title is not part of the 
\verb+tabular+ environment, but is constructed 
as a `\verb+\rule+'-rule. This made it easy to give it a custom 
thickness. Again, the length was set to \verb+\linewidth+.

\subsection*{Headings}
As to the various headings: the word {\em forecast} repeated 
information from the table header and was dropped. The word {\em 
variable} could also safely be omitted.

Aligning the Grecon- and CPB headings at the bottom instead of the top 
would have been an improvement, but moving the text `{\em MEV '92}' to 
a footnote was even better. Their horizontal positioning was adjusted 
by hand, adding `\verb+~+' here and there.

The `{\em \% mutations...}' and `{\em absolute quantities}' headings 
looked rather jarring in the figures columns, and were moved to the 
left column.

\subsection*{Fonts}
Sans serif faces are especially appropriate for tabular material. At 
small sizes serifed faces easily look fussy, especially if the output 
quality is not top notch. Sans serif faces suffer much less from 
scaling down. A sans serif face also helps to set off the table from 
the surrouding text.

Several sizes and weights are used (typographers talk about an italic 
{\em weight}; the \TeX\ community should realize that they entertain 
rather off-beat ideas about font families). And hyphens are replaced by 
proper minus-signs.

\section{Technical issues}\label{tech}
Some things in \LaTeX\ are harder than they should be. Two notorious 
examples are table-related: aligning a column of figures on the decimal 
point, and setting text in a table cell ragged right.

\subsection*{Decimal alignment}
There are at least three ways in \LaTeX\ to accomplish decimal 
alignment:
\begin{itemize}
\item If all numbers have the same number of digits after the decimal 
point, decimal alignment coincides with right alignment, since in most 
fonts all digits have the same width.
\item Split the numbers right before the decimal point, i.e. put an 
ampersand `\verb+&+' before the decimal point (or after the number, if 
it has none). The column formatting for the resulting two columns 
should be \verb+r@{}l+: right-align the part before the decimal point, 
left-align the remainder, and put no white space in between.
\item Use the {\tt dcolumn} package by David Carlisle. This is 
documented in \cite{bernard} section 5.5.1.
\end{itemize}

\subsection*{Ragged right justification}
You may have noticed that \verb+\raggedright+ simply doesn't work in a 
tabular environment. Again, let me suggest a couple of brute-force 
workarounds.
\begin{itemize}
\item Divide the text manually between rows. Of course, this is 
practical only in very simple cases.
\item Put a parbox around the text, \eg \\
\verb+\parbox{1in}{\raggedright+\ {\em text...}\verb+}+ \\
This is simple enough, but not very elegant since it involves 
specifying column widths outside the \verb+\begin{tabular}+ command.
\end{itemize}

Goossens \emph{et al.} give a more sophisticated solution in section 5.3.1, 
`{\em Typesetting Narrow Columns.}' As in the last of the above two 
workarounds, it adds code to make \verb+\raggedright+ operational again.

\section{The trouble with \LaTeX}
It took me a lot of time to prepare the examples in this paper. Even 
the standard \LaTeX\ \verb+tabular+ environment has plenty of quirks, 
and extension packages such as {\tt array} or {\tt tabularx} only add 
to them. Too often, it was a matter of trial and error what would work 
and what wouldn't, and that might depend on the package used. In the 
end I didn't use any of the table extension packages for this paper.

In \LaTeX, some aspects of layout and typography can be controlled by 
changing a few parameters or by replacing some simple code out of a 
style file. But there are quite a few rough spots: sometimes the code 
is too cryptic for easy modification and sometimes the code is not in 
the style file at all. When typesetting tables one tends to run into 
such rough spots.

Besides \LaTeX, I use high-end wordprocessors and low-end desktop 
publishing software. I am exceedingly frustrated that simple things 
that you just do in a commercial program, require hours or days of 
study and experimentation in \LaTeX.

Still, \LaTeX\ can't be beaten (yet) for long documents or for 
automation. It remains robust and efficient whatever the size and 
complexity of the job. So I keep using it for certain types of work.

I hope that \AllTeX\ developers are seriously addressing \LaTeX's 
shortcomings. What is really needed is a more accessible basic \LaTeX\ 
system, which doesn't require wizardry to tailor to one's own 
preferences, and which can put an end to the current proliferation of 
style files to patch up its defects.

Finally I want to mention that \cite{bernard} was a great help in 
preparing this paper, even though the solutions proposed there didn't 
always work out.

\begin{thebibliography}{[GMS94]}

\bibitem[Treebus 1982]{treebus} Treebus, K. F. {\em Tekstwijzer.} SDU 1982.

\bibitem[McLean 1980]{mclean} McLean, Ruari. {\em Typography.} Thames and 
Hudson 1980.

\bibitem[Lamport 1986]{lamport} Lamport, Leslie. {\em \LaTeX, A Document 
Preparation System.} Addison-Wesley 1986.

\bibitem[Goossens \emph{et~al.}~1994]{bernard} 
Goossens, Michel, Frank Mittelbach, Alexander 
Samarin. {\em The \LaTeX\ Companion.} Addison-Wesley 1994.

\bibitem[DV91]{grecon} Dietzenbacher, H.W.A., W. Voorhoeve. {\em Het 
model GRECON 91-D. Septembervoorspellingen voor 1992}. 
Onderzoeksmemorandum no. 450. Economics Department, Groningen 
University 1991.

\end{thebibliography}
\end{Article}