2

I have a PDF file (example), which was generated from TeX. Is it possible to convert into a tex file, or obtain the .tex source?

Thanks

5
  • 3
    (1) welcome, (2) no, PDF is an end format, and the process is irreversible. (3) For that particular PDF, the sources are available at arxiv.org/format/1803.09123
    – daleif
    Commented Sep 24, 2018 at 10:39
  • @daleif That would be a great answer! Maybe add a sentence how you found the source!
    – Keks Dose
    Commented Sep 24, 2018 at 11:21
  • I have edited and vote to reopen this question, so that it can serve as a reference question for how to get the TeX source from arxiv.org. (At least I can't find any answers on this site mentioning both "other formats" and arxiv.org.) Commented Sep 24, 2018 at 20:17
  • (BTW the answer, in case it doesn't get reopened, is that from a URL like arxiv.org/pdf/1803.09123.pdf you can go to the “main” page by replacing the first “pdf” with “abs” and removing the trailing .pdf, like so: arxiv.org/abs/1803.09123. Then you can click “other formats” under “Downloads” in the right-hand-side sidebar. That will take you to a URL like arxiv.org/format/1803.09123, from which you can download the source. (In this case, it happens to be a TAR archive (as revealed by file on Unix), and the 8 files in it can be extracted with tar xvf 1803.09123.) Commented Sep 24, 2018 at 20:21
  • @ShreevatsaR and daleif, indeed true there are latex files, but in some cases there aren't .tex files are available. In this case I am restricted to work only or arxiv papers only. Commented Sep 25, 2018 at 4:30

2 Answers 2

3

You are lucky, because arXiv accepts LaTeX submissions and also provides the source code submitted by the authors.

To check whether the source of an article is available, click the “Other formats” link (if this is not there, no sources).

enter image description here

The next step is to click “Download source”

enter image description here

You will receive the source in a compressed format. There is no file extension, which might confuse most file browsers. The file type is a gzipped tar archive, so simply add a .tar.gz file extension. Then open it in your favourite archive program (e.g. 7-Zip).

5
  • indeed true there are latex files available, but in some cases there aren't .tex files are available. In this case I am restricted to work only or arxiv pdfs only. Commented Sep 25, 2018 at 4:49
  • @AmanDalmia If you don't have the source, you can try using OCR software. There is even software which can recognize LaTeX formulas: tex.stackexchange.com/a/445079 Commented Sep 25, 2018 at 5:04
  • Thanks Henri. Well its not an open source and I can't be able to send out the data (API.) Commented Sep 25, 2018 at 5:09
  • @AmanDalmia Huh? If the paper is on arXiv (which it according to your question is), then the data cannot be confidential. Commented Sep 25, 2018 at 5:22
  • ,Indeed true; In order to give an example of a pdf I had use the arXiv link, not as my data sources. Commented Sep 25, 2018 at 5:39
2

Sorry, but not possible.

Of course you can copy and paste the text into your own *.tex file, but it is not possible to distill the original file from the pdf.

Not the answer you're looking for? Browse other questions tagged .