Bug uncentered latex table 1929 rebased

rebased version of #1929

note the test file has significant trailing whitespace

check TravisCI before merge