\usepackage{dcolumn}
\newcolumntype{d}[1]{D{.}{.}{#1}}
\begin{longtable}[c]{d{2} d{1} d{1} d{2}}
How can I make the column contents \scriptsize? (Without dcolumn and
with centering it would be ">{\scriptsize}c". I found some previous
posts related to this but can't get anything to work.
Thanks,
Scott Waichler
scott.w...@pnl.gov
here's hack someone once gave me to colorize dcolumns
\makeatletter
\newcolumntype{Q}[1]{>{\scriptsize\DC@{.}{.}{#1}}c<{\DC@end}}
\makeatother
don't ask why it works, it just does. ;-)
--
/daleif (remove RTFSIGNATURE for email)
Strangely you assume the authors of the longtable, array and dcolumn
packages cooperate enough to make the things work together...
the D column type is defined on the last line of dcolumn.sty
by
\newcolumntype{D}[3]{>{\DC@{#1}{#2}{#3}}c<{\DC@end}}
since you are using lt the c column starts off in text mode rather than
math
so \scriptsize is legal in the cell entry so you can just do
\newcolumntype{S}[3]{>{\scriptsize\DC@{#1}{#2}{#3}}c<{\DC@end}}
If you were doing this for an array you'd want to drop \scriptsyle into
the math mode but the various parts of the number are all set in
different boxes so they can be measured so they are all separate math
expressions, something like
\newcolumntype{S}[3]{>{\everymath{\scriptstyle}\DC@{#1}{#2}{#3}}c<{\DC@end}}
probably works. (defined somewhere where @ is a letter.
actually the above is what you need to do if you just want to make one
column small, but your example shows the whole table uses d
columns. Making each cell \scriptsize individually isn't optimal in that
case, even without dcolumn complications, as you still get line spacing
from the current font size. Can't you just stick \scriptsize before the
start of the table?
David
\newcommand{\decreaserowspacing}{-5pt}
with row entries like this:
396.76 & 545536.1 & 145388.7 & 1.068 \\ [\decreaserowspacing]
Scott
> Thanks, this does work. The "c" for column centering seems odd in a
> dcolumn thing,
dcolumn more or less takes over the whole cell so doesn't really use the
centering aspect of c but to get get its stuff into the cell at all
it's (much) easier to use >{..}c<{...} than to open up the array package
internals to get acces to a "raw" table cell.
> but I won't try to understand why it works.
it's all beautifully documented in dcolumn.dtx, don't you know:-)
David