Document 478

The LaTeX dcolumn package

Version: 3.x, 4.x, 5.x - Scientific WorkPlace & Scientific Word

The dcolumn package provides decimal point alignment for columns of entries in a tabular or array. You can define the separator on which the columns align; usually the separator is a period or comma. Also, you can define a separator for the DVI output file and the maximum number of decimal places allowed in the column.

You must enter the dcolumn command, along with the commands for the entire tabular environment, in an encapsulated TeX field. The basic syntax of the column separator command is

D{separator for the tex file}{separator for LaTeX}{decimal places}

where separator for the tex file is the punctuation you use the document to indicate the decimal point, separator for LaTeX is the punctuation you want LaTeX to use when you typeset, and decimal places is the maximum number of decimal places in the column. A negative number in the decimal places argument indicates that any number of decimal places is acceptable.

How to align column entries on a decimal point

  1. Add the dcolumn package to your document.

  2. Place the insertion point where you want the table to appear.

  3. Enter an encapsulated TeX field.

  4. In the entry area, type \newcolumntype{d}[0]{D{separator for the tex file}{separator for LaTeX}{decimal places}}, completing the command as defined above.

  5. Enter the complete tabular environment, beginning with a \begin{tabular}{d....d} command and ending with an \end{tabular} command.

  6. Choose OK.

No package options are available. The package is installed in the TCITeX/TeX/LaTeX/required/tools directory and is part of the Standard LaTeX Tools Bundle.

Last revised 01/20/06

This document was created with Scientific WorkPlace.