3

I download the code file (tex) of articles on https://arxiv.org/. But I can not open it by texmaker. Do you know how to do this? For example,

  1. Go to this link
  2. See on the right corner
  3. Choose Download: other formats
  4. Choose Download source

Then how can I open the file I have downloaded?

moewe
  • 175,683
  • 1
    I just tried something that worked for decades, and which worked here, too. Provided you also name the file 1502.03811, use mv 1502.03811 1502.03811.tar.gz and then tar -xzvf 1502.03811.tar.gz. (I am assuming you have either MacOS or Linux.) This yielded x AnosovProper.tex x chambers.eps x CLI.eps x domain.eps x vectors2.eps. I am, however, not sure how this question relates to TeX and friends other than the main extracted file can be compiled with LaTeX. –  Feb 15 '20 at 01:40
  • 1
    Often these files are actually .tar.gz files, but you can't always tell from the outset. See https://tex.stackexchange.com/q/504640/35864 – moewe Feb 15 '20 at 06:54
  • 1
    If you're on mac or Linux you can use the file command on the command line to ask the OS what it thinks this is. It is likely to be either a tar file (might be gzipped first but not always), which is used if the source is several files. It might be a tex file if just a single source file. I agree that it would have been so much easier for everyone if they include extensions on the files. But then again not everyone knows that docx files are actually zip files. – daleif Feb 15 '20 at 08:53

1 Answers1

3

The file downloaded from the link you posted has extension .03811. Change the extension to .tex, after that I'm able to open it. Note that, in order to compile without errors, you have to delete all the text before \documentclass{...}

erik
  • 12,673
Luis Turcio
  • 2,757
  • Beware: one downloads a compressed directory which contains a TeX file (>3000 lines, ansinew-encoded) and 4 .eps files. – Bernard Feb 15 '20 at 00:37
  • In my computer it only downloads one file. In fact, many other source articles doesn't work for me because there are not enough files, sometimes images, sometimes bibliographies, etc. – Luis Turcio Feb 15 '20 at 00:42
  • I also download only one file, but this is a compressed series of 5 files. I uncompressed it with 7zip. – Bernard Feb 15 '20 at 00:44
  • Intersting! How different from what it does in my computer, maybe something that I don't understand with the OS? But then my answer is not good enough :( – Luis Turcio Feb 15 '20 at 00:47
  • It does not work. There is too much code that was modified and texmaker can not understand. Hence it can not read even I delete all the text before \documentclass{...} and some part after \end{document}. – Dracule Mihawk Feb 15 '20 at 00:48
  • Not even with the file downloaded from the link in your question? – Luis Turcio Feb 15 '20 at 00:50
  • yes, in general, for any file I download from arxiv. they always appear the sentence like this: It seems that this file can not be correctly encoded with the default encoding setting UTF-8. Then they have several choices of encoding, but I do not know what encoding I should choose. Then I choose UTF-8, it makes to much wrong codes. – Dracule Mihawk Feb 15 '20 at 01:05
  • I’m not sure what’s happening. The original encoding is latin1, I don’t know if texmaker can change the encoding – Luis Turcio Feb 15 '20 at 01:09
  • there is no latin1 to choose from. I hope that I can send you an image to explain what happens. You really can read the file from your computer? Could you send me the code by email: khanh.mathematic@gmail.com – Dracule Mihawk Feb 15 '20 at 01:14
  • 3
    Indeed my editor (TeXworks) manages to open the file if I just rename it to 1502.03811.tex, but it then contains additional garbage before the \documentclass and after \end{document} (the latter of which is ignored), that is because the file is actually a full .tar.gz archive that contains not only a .tex file but also .eps image files. It is much better to rename the thing to 1502.03811.tar.gz and extract the files before use. – moewe Feb 15 '20 at 07:00
  • thank you @moewe, it works! – Dracule Mihawk Feb 15 '20 at 09:11