Create a Latex table from a CSV files

TL, DR

If you ever tried to write a big table in Latex from scratch, you know how much it can be tedious. I wrote a small application leveraging Python Pandas and PySimpleGUI to create a Latex tables from any CSV file.

Making tables in Latex from CSV files

create latex table from csv file screenshot
From CSV to Latex seamlessly!

In a previous post I already discussed the importance of Latex for academic writing and how painful it can be to create tables from scratch there. If you missed it, here’s the link.

As presented in the other post, you can easily leverage Python Pandas to create a Latex table from a Pandas DataFrame. However, in many cases you will also receive CSV files from other people with results from their elaborations in who-knows-what software. If this happens frequently (and it may well be the case), you don want to always pull up a Jupyter Notebook, import the file, and export again in Latex.

Therefore, I spent a couple of hours creating a small GUI application that let you create Latex tables from CSV files. You can find the source code in my GitHub repository link.

How does it work?

The application is really simple. You can select a CSV file, and then decide how you want to see your Latex table. You can display it in a popup, and then copy it. Or you can get the table directly copied into your clipboard.

It works on Linux, MacOS, and Windows, and it has very limited dependencies. On Linux you may need to install xsel or xclip in order to use it.

I used PySimpleGUI for the graphics, as I find it the easiest and fastest framework to create GUI applications in Python. Right now the application is very rough. I plan to update it in the future and add further functionalities. Stay tuned for updates!

I left some note in the GitHub repository about future planned updates. However, you are welcome to open issues regarding any specific feature you deem valuable. I am looking forward to hear from you!

Related links

  • GitHub repository link

Do you like our content? Check more of our posts in our blog!