# [texhax] Decimal alignment along with superscript

Peeyush Mehta pmehta at iitk.ac.in
Sun Aug 7 08:59:58 CEST 2011

As mentioned earlier, I am able to do the correct alignment. However, I am stuck with another issue related to this. The column heading where I want to align the decimal entries is \beta_{a1},. i.e., it uses 'symbol' and 'subscript' commands. Hence the column heading is getting aligned with the integral part of the number (example it is getting aligned with 48 in 48.26**). This is looking odd. I used multicolumn{1}{c}{\beta_a1} but \beta and subscript function does not work with multicolumn. Any pointers on this. Thanks in advance.
Peeyush

From: Uwe Ziegenhagen [ziegenhagen at gmail.com]
Sent: Sunday, August 07, 2011 10:30 AM
To: Peeyush Mehta; texhax at tug.org
Subject: Re: [texhax] Decimal alignment along with superscript

2011/8/7 Peeyush Mehta <pmehta at iitk.ac.in<mailto: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/81a5451d/attachment.html>


More information about the texhax mailing list