# Why does 65* become 65∗ when using dcolumn package to align digits?

I am using dcolumn package to align some numbers after the decimal point. However, some of this numbers have "*** signs" in order to relate them to additional information at the end of the table. However, as soon as I compile the 0.098* becomes 0.098∗. This happens only when I define the column center as . instead of c or l . For instance begin{tabular}{l . c}.

Preamble:

\usepackage[dvips,letterpaper,margin=1in]{geometry}
\usepackage{booktabs}
\usepackage{tabularx}
\setlength{\abovecaptionskip}{6pt}
\setlength{\belowcaptionskip}{6pt}
\usepackage[large, bf, justification=centering]{caption}
\usepackage{rotating}
\usepackage{dcolumn}
\newcolumntype{.}{D{.}{.}{5,6}}


Here's the rest of the code:

Code: Select all

\begin{table}
\footnotesize
\caption*{Table 5: Ordered logit results for men and women living in Denmark}
\centering
\begin{tabular}{l . .}
\toprule
\toprule
%
\multicolumn{1}{l}{taste for redistribution} & \multicolumn{1}{c}{\bf Men} & \multicolumn{1}{c}{\bf Women} \\

\multicolumn{1}{l}{in Denemark} & \multicolumn{1}{c}{\bf b/se} & \multicolumn{1}{c}{\bf b/se} \\

\midrule
&          \\
%
%
age       & 0.018*  &       0.020* \\

\midrule
* p<0.05, ** p<0.01, *** p<0.001 \\
\bottomrule
%
\scriptsize{\emph{Source: }stayers survey}
\end{tabular}
\end{table}


Anyone having a hint?

-

One way to get the desired output would be to use ^{\ast} instead of *. Also, the footnotes should be in math mode in this case:

\documentclass{article}
\usepackage[dvips,letterpaper,margin=1in]{geometry}
\usepackage{booktabs}
\usepackage{tabularx}
\setlength{\abovecaptionskip}{6pt}
\setlength{\belowcaptionskip}{6pt}
\usepackage[large, bf, justification=centering]{caption}
\usepackage{rotating}
\usepackage{dcolumn}
\newcolumntype{.}{D{.}{.}{5,6}}

\begin{document}
\begin{table}
\footnotesize
\caption*{Table 5: Ordered logit results for men and women living in Denmark}
\centering
\begin{tabular}{l . .}
\toprule
\toprule
%
\multicolumn{1}{l}{taste for redistribution} & \multicolumn{1}{c}{\bf Men} & \multicolumn{1}{c}{\bf Women} \\

\multicolumn{1}{l}{in Denemark} & \multicolumn{1}{c}{\bf b/se} & \multicolumn{1}{c}{\bf b/se} \\

\midrule
&          \\
%
%
age       & 0.018^{\ast}  &       0.020^{\ast} \\

\midrule
${}^\ast p<0.05$, ${}^{\ast\ast} p<0.01$, ${}^{\ast\ast\ast} p<0.001$ \\
\bottomrule
%
\scriptsize{\emph{Source: }stayers survey}
\end{tabular}
\end{table}

\end{document}

-

The short answer to your question is: Material in a dcolumn-formatted column is set in math mode rather than in text mode.

A slightly longer answer: When TeX is in math mode, it renders the * symbol as a multiplication operator symbol, whereas when TeX is in text mode it treats the symbol as a "raised asterisk" (for want of a better term). To get the text-mode behavior in a dcolumn setting, it's probably best to create the following three macros in the preamble

\newcommand\istar{\text{*}}
\newcommand\iistar{\text{**}}
\newcommand\iiistar{\text{***}}


and then use these macros, as in 0.018\istar, in the tabular environment. Note: The \text command is provided by the amsmath package (which means that this package has to be loaded as well -- however, you probably already do so, right?).

The following image is based on your code, but with modifications and simplifications meant to highlight the asterisk-related issues. E.g., I've omitted all fontsize-changing commands and shortened the caption considerably.

\documentclass[letterpaper]{article}
\usepackage{booktabs,amsmath,caption,dcolumn}
\newcolumntype{.}{D{.}{.}{2,5}}
\newcommand\istar{\text{*}}
\newcommand\iistar{\text{**}}
\newcommand\iiistar{\text{***}}
\begin{document}
\begin{table}
\caption*{Table 5: Ordered logit results}
\centering
\begin{tabular}{l . .}
\toprule
Taste for redistribution &
\multicolumn{1}{c}{\bfseries Men} &
\multicolumn{1}{c}{\bfseries Women} \\
in Denmark &
\multicolumn{1}{c}{\bfseries b/se} &
\multicolumn{1}{c}{\bfseries b/se} \\
\midrule
Age       & 0.018\istar  &       0.020\iiistar \\
\midrule
\multicolumn{3}{l}{* $p<0.05$, ** $p<0.01$, *** $p<0.001$} \\
\midrule[\heavyrulewidth]
\emph{Source:} Stayers survey\\
\end{tabular}
\end{table}
\end{document}

-
Thank you a lot. I had the intuition that the problem was the math mode but I had no clue about how to change that! –  Valentino Feb 22 '12 at 19:05