Decimal Point Alignment in Latex
By ET
UPDATE: A web-based version is available. You don’t need to upload the whole file to do the conversion now.
Check out the new version at: http://blog.mikezhang.com/dcolumn/processtable.cgi.
It has been a headache to do decimal point alignment in latex.
Fortunately, there is a package called dcolumn that helps with this problem.
This dcolumn package “defines a system for defining columns of entries in an array or tabular which are to be aligned on a decimal point.”
Unfortunately, it is very hard to make the modifications manually on the tables to align the decimal points of numbers. I searched online and could not find a solution. So I created a web service that does this:
Basically, just visit the webpage: http://blog.mikezhang.com/dcolumn/.
There is only one field for you to browse a latex file. Make sure it has extension .tex, otherwise, the system would not accept the file.
Click Submit, you will obtain the converted file with correctly aligned numbers in your tables.
See the screen shot of the finished page:
Now clicking “FILE” will bring you the new file, in txt format. You need to change the extension to .tex to try it out. This intended trouble helps you to avoid overwriting your original file.
Here is how it worked on a paper:
Before:
and After:



September 4th, 2009 at 2:38 am
This is a really cool tool and thanks for making it available, but whenever I use it, it makes the vertical bars in my header go away (I assume that’s from the use of \multicolumn). Is there a way to fix that?
September 4th, 2009 at 2:54 am
I actually noticed that the documentation had an example of what I wanted to do and so I looked at the source and noticed that I needed to add a “|” to the \multicolumn definition to make it still have the vertical separator.
Here’s an example:
\multicolumn{1}{c|}{Text}
September 21st, 2009 at 10:22 am
Dave,
Thanks for the comments. I’ll see if I can give a quick fix for that. The program is getting messy after a lot of patches and quick hacks. :-p
Michael
December 18th, 2011 at 7:53 pm
This is really cool. Many thanks for sharing this tool, you just improved my thesis productivity somewhat!
Best wishes.