12.07.2015 Views

The memoir class - The UK TeX Archive

The memoir class - The UK TeX Archive

The memoir class - The UK TeX Archive

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

11. ROWS AND COLUMNS\newcolumntype{.}{D{.}{.}{-1}}<strong>The</strong> result of this is that ‘.’ specifies a column of entries to be centered on the ‘.’.\newcolumntype{,}{D{,}{,}{2}}And the result of this is that ‘,’ specifies a column of entries with at most two decimalplaces after a ‘,’.<strong>The</strong> following table is typeset from this code:\begin{center}\begin{tabular}{|d{-1}|d{2}|.|,|}1.2 & 1.2 &1.2 &1,2 \\1.23 & 1.23 &12.5 &300,2 \\1121.2& 1121.2&861.20 &674,29 \\184 & 184 &10 &69 \\.4 & .4 & &,4 \\& &.4 &\end{tabular}\end{center}1·2 1·2 1.2 1,21·23 1·23 12.5 300,21121·2 1121·2 861.20 674,29184 184 10 69·4 ·4 ,4.4Note that the first column, which had a negative 〈places〉 argument is wider than thesecond column, so that the decimal point appears in the middle of the column.<strong>The</strong> third 〈places〉 argument may specify both the number of digits to the left and tothe right of the decimal place. <strong>The</strong> third column in the next table below is set withD{.}{.}{5.1} and in the second table, D{.}{.}{1.1}, to specify ‘five places to the leftand one to the right’ and ‘one place to the left and one to the right’ respectively. (You mayuse ‘,’ or other characters, not necessarily ‘.’ in this argument.) <strong>The</strong> column of figures isthen positioned such that a number with the specified numbers of digits is centred in thecolumn.Be careful if you have table headings inserted, say, with\multicolumn{1}{c}{...}to over-ride the D column type, as the overall result may not look quite as good as youmight expect. In the next pair of tabulars the first column is set withD{.}{.}{-1}to produce a column centered on the ‘.’, and the second column is set withD{.}{.}{1}to produce a right aligned column.210

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!