[texhax] Decimal alignment along with superscript

Uwe Ziegenhagen ziegenhagen at gmail.com
Sun Aug 7 07:00:42 CEST 2011

2011/8/7 Peeyush Mehta <pmehta at iitk.ac.in>

>  I have a table column that has numbers with decimals and some numbers end
> with an asterisk as the superscript. I am not able to align the column
> entries. If the superscript is not there, I am able to solve the problem
> using "dcolumn" package. But to have a superscript, I have to use \$ command
> in the maths mode. Then "dcolumn" is not working. Any suggestions would be
> of great help as I have spent lot of effort on it.
> For instance, my column entries are
> -.28***
> 1.40
> -2.08*
> and so on.
>
> Thanks a lot,
>
> Peeyush
>
>
>
>
You can avoid the mathmode by using \textsuperscript{}:

\documentclass{article}
\usepackage[]{dcolumn}
\newcolumntype{d}[1]{D{.}{,}{#1}}

\begin{document}
\begin{tabular}{|c|d{4}|c|} \hline
da & 1.4242\textsuperscript{*} & sdfs \\ \hline
da & 1.33& sdfs \\ \hline
\end{tabular}

\end{document}

Best,

Uwe

--
Uwe Ziegenhagen
<http://www.uweziegenhagen.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texhax/attachments/20110807/506c04d1/attachment.html>