Typesetting Latex Tables with Python 0 ▲ MixedMath - explorations in math and programing 121 days ago · Tech · hide · Fediverse post Typesetting tables in latex is annoying. In practice, I usually have the tabular data in some programming-friendly format and need to put it in latex. I forget how to do this nicely, but it's extremely simple using the tabulate package in python. import tabulate from itertools import batched # Data A = [ 1, 2, 3, 4, 5, 6, 7, 10, 11, 14, 15, 17, 19, 21, 23, 26, 31, 34, 35, 39, 41, 47, 51, 55, 59, 71, 79, 87, 95, 111, 119, 131, 143, 159, 167, 191, 215, 231, 239, 287, 311, 359, 479, 551, 671, 719 ] print(len(A)) # 46 # We have to choose the number of columns. I choose 12 here. data = list(batched(A, 12)) print(tabulate.tabulate(data, tablefmt="latex_booktabs")) This outputs {rrrrrrrrrrrr} \toprule 1 & 2 & 3 & 4 & 5 & 6 & 7 & 10 & 11 & 14 & 15 & 17 \\ 19 & 21 & 23 & 26 & 31 & 34 & 35 & 39 & 41 & 47 & 51 & 55 \\ 59 & 71 & 79 & 87 & 95 & 111 & 119 & 131 & 143 & 159 & 167 & 191 \\ 215 & 231 & 239 & 287 & 311 & 359 & 479 & 551 & 671 & 719 & & \\ \bottomrule The point is that this can be done… Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town