[texhax] Decimal alignment along with superscript
Peeyush Mehta
pmehta at iitk.ac.in
Sun Aug 7 07:35:13 CEST 2011
Thanks a lot for your quick response. The problem is solved. I am able to align the entries.
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/6b14e4b3/attachment.html>
More information about the texhax
mailing list