TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know that hardly any information is passed to the PDF when a .tex file is compiled.

But is there a tool that can convert a PDF document back to (La)TeX?

share|improve this question
The answer is going to be 'no', more or less, but it would be helpful to say a little more about the nature of your PDF files and desired LaTeX output. For example, converting simple text is a different issue to converting maths or graphics. – Joseph Wright Jan 8 '11 at 15:06
you can convert to doc (nitroreader.com) and then with word2tex (chikrii.com) to LaTeX. But the code maybe lousy ... – Herbert Jan 8 '11 at 15:20
Decide what information you're hoping to preserve. Google for information on conversion to intermediate formats such as text or html that might preserve that information. – Ben Crowell Feb 18 '13 at 4:35
up vote 31 down vote accepted

If you install AbiWord with the additional import and export plugins,* you can open a PDF file in the Word Processor, and then export to LaTeX. In fact, you can also convert from the commandline:

abiword --to=tex filename.pdf

Be warned that both its PDF import routine and its LaTeX export routine have serious limitations, and you should not expect anything that will useable without serious tweaking afterwards.

(* IIRC, the extra plugins are installed by selecting a custom install on Windows and checking all the import and explort options it gives you. For Linux, you typically need to install a separate package called "abiword-plugins" or "abiword-plugin-mathview" depending on distro. No clue for Mac.)

Inkscape can open PDFs and export to either PSTricks or TikZ codes; this might be useful if the PDF in question is just a diagram or vector image you want to edit.

There's a project listed on sourceforge called pdf2latex, but it doesn't look like any real work has been done on it. I'm not sure it's a real project. (The page looks fishy; almost as if someone was just posting an idea.)

share|improve this answer
Thanks! Unfortunately abiword outputs: AbiWord: could not open the file [filename]. – Martin Vseticka Jan 9 '11 at 14:50
Is the PDF import plugin installed? Can you open other PDFs? If so, and it still doesn't work for the one you want, it's probably too complex a PDF for it. – frabjous Jan 9 '11 at 15:09
from abisource.org/wiki/FaqCreatingPDFs Can I use the PDF plugin mentioned on the PluginMatrix page? No, this plugin hasnt been maintained in many years and doesnt ship with newer versions of AbiWord . Seems to be an export plugin, though. I cannot find an input plugin. Windows here. – n611x007 Jan 29 '13 at 11:16
A thread lists a possible candidate for "pdf import" plugin, based on poppler, by Jauco, but the site is offline, the web archive didn't take a good snapshot and it seems it didn't compile on windows: mobileread.com/forums/showthread.php?t=7509 – n611x007 Jan 29 '13 at 11:29
inkscape has cool features like convert to html or svg :) – Enrique San Martín Jul 5 at 21:27

Check out InftyReader.

Quoting the start page:

InftyReader is an Optical Character Recognition (OCR) application that recognizes and translates scientific documents (including math symbols) into LaTeX, MathML and XHTML!

share|improve this answer
Eunice, your answer was a bit … simple. Hope you don’t mind my adding of some more information. But nonetheless I don’t want to forget the following: Welcome to TeX.sx! – Speravir Sep 28 '12 at 2:14
note, the trial version only allows 1 page to be converted at a time. Also you can only use it 5 times per DAY! Still, an incredible solution that really, really works! – ecoe Dec 5 '13 at 6:50

I found no tool that can deal with formatting, but for extracting the text on Linux, there is a two step procedure that produces good results:

$ pdf2ps paper.pdf
$ ps2ascii paper.ps > paper.txt

From: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=recovertex

share|improve this answer
related: pdftotext – Sean Allred Jun 14 '15 at 15:38
Except the question was how to convert PDF to LaTeX, not pdf to ASCII – hd1 Jan 11 at 12:52

Import the file using LibreOffice. It will create a Draw file. You have to copy and edit it by pieces into Writer. Then you can use the plugin writer2latex to export the results to LaTeX. The final code is dirty, with plenty of stuff you don't need and some errors.

If your docs are large enough, this process might be easier than re-typing everything.

Another alternative, if you are dealing mostly with pure and simple text, is to save the file as a *.txt from the PDF reader. Then copy/paste the thing into your LaTeX editor.

share|improve this answer
Both of these approaches will break ligatures unfortunately - the only solution I've found is a lot of find&replace. – Chris H Jul 29 '13 at 10:21

Here is an approach that combines InftyReader and AbiWord.

Suppose we have a file


First process it with the free version of InftyReader. This will not give the TeX directly (except for the first page) but it will produce a file


Then you can run AbiWord on this file:

abiword --to=tex example.pdf2txt

The result is not great, but not too bad either.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.