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.
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:
It’s that simple:
use DBI;
my $conn = DBI->connect
("DBI:mysql:db","owner","ownerpass") or die("Cannot connect: $DBI::errstr");
$sql=qq(select field from table where id=$id);
@array=@{$conn->selectcol_arrayref($sql)};
There are more than two ways to do it. I just put down two quick ways.
Method 1:
In program:
processarray(\@array);
In sub processarray:
my $arrayref=shift;
my @array=@$arrayref;
Method 2:
In program:
processarray(@array);
In sub processarray:
my @array=@_;
The difference between a smart person and a wise person is that a wise person knows how not to get into situations that a smart person knows how to get out of.

Copyright Xiaoquan (Michael) Zhang, 2004-2010. All rights reserved.
All trademarks property of their owners.