Recover PDF to LaTeX

Mawnster picture Mawnster · Oct 25, 2009 · Viewed 80.7k times · Source

I know how make a PDF from LaTeX. Is there a way to extract the LaTeX-code from a PDF I created earlier? How about if someone sends me a PDF and I like the formatting. Can I extract the LaTeX from it?

Answer

Billy ONeal picture Billy ONeal · Oct 25, 2009

LaTeX does not have a one-to-one conversion to PDF. With regards to your first question, I believe such a conversion may be technically possible, but I do not believe an application to do so yet exists. Similar to the way assembler can be decompiled back into high level language, there is probably a way to do it. However -- a pdf is allowed to contain all matter of kinds of data -- AutoCAD drawings, JPEG graphics, font files, forms, digital signatures, etc. LaTeX has no idea what these things are. So in answer to the second question is no -- there's not a way to extract equivalent LaTeX from any PDF document.