DEV Community

Cover image for How to convert a PDF table to LaTeX (booktabs) without retyping
Chintu Gurbani
Chintu Gurbani

Posted on Originally published at catchtex.com

How to convert a PDF table to LaTeX (booktabs) without retyping

You need a results table from a paper in your own LaTeX document. Retyping twelve columns of numbers takes half an hour and invites typos. Here is how to get a clean booktabs table in a few seconds, and how the usual alternatives compare.

Snipping a table from a PDF into LaTeX

The quick way: snip the table

  1. Open the PDF in CatchTeX (Ctrl+O). The built-in viewer matters: CatchTeX reads the characters stored in the PDF instead of guessing them from pixels, so every number is exact.
  2. Drag a box around the table, including its header rows. Auto mode recognises it as a table.
  3. Check the preview. The result is compiled with a built-in pdfLaTeX and shown next to the code. Cells it is unsure about are highlighted, so you only check those.
  4. Copy the LaTeX (Ctrl+Shift+C) and paste it into Overleaf or your editor. Add \usepackage{booktabs} to your preamble once.

Is the table in a slide, web page or scanned page instead? Press Ctrl+Alt+T and snip it from the screen. CatchTeX then uses offline OCR, so proofread the numbers as you would with any OCR.

What comes out

  • booktabs rules (\toprule, \midrule, \bottomrule) instead of a grid of \hlines
  • Merged header cells as \multicolumn
  • Maths inside cells (Greek letters, ±, sub- and superscripts) as real LaTeX maths, not Unicode
  • Bold and italic values kept, so the best result stays marked

Other ways, compared honestly

Method Exact numbers Result Paper stays on your PC
Retype by hand If you are careful Whatever you write Yes
Copy-paste from the PDF reader Yes, but columns fall apart A line of text to rebuild Yes
Tabula / Excel → Tables Generator Yes for simple tables Merged headers and maths need fixing Partly
AI chatbot Not guaranteed: numbers can change silently LaTeX, not compiled or checked No
Mathpix Snip Good OCR LaTeX table No, cloud
CatchTeX Yes, read from the PDF itself booktabs, compiled, doubtful cells marked Yes, offline

Tips for a clean result

  • Include the header rows in your selection; leave out the caption if you will write your own.
  • Very wide table? Zoom out so the whole table fits on screen before you snip.
  • Table split across two pages? Snip each part and join the rows.
  • Want siunitx decimal alignment? Change the column spec to S columns after pasting; the numbers are already plain.

FAQ

Does it work with scanned PDFs? Yes, through offline OCR. Accuracy then depends on scan quality, so check the numbers.

Do I need LaTeX installed? No. CatchTeX ships its own pdfLaTeX for the preview. The output works in Overleaf, TeX Live and MiKTeX.

Is it free? The free edition has every mode with 10 snips a day. Pro removes the limit with a one-time payment.


CatchTeX runs offline on Windows, Mac and Linux, and also converts equations, block diagrams (TikZ), plots (pgfplots) and references (BibTeX). Download it free at catchtex.com.

Originally published at catchtex.com/guides/pdf-table-to-latex.

Top comments (0)