0

I have a folder which contains one latex file, few images(in .png as well as .pdf format). I want to convert this whole folder into a pdf file similar to what overleaf does. I want to use a terminal command as I have to do this for thousands of file. I want to run these commands in python. I used "pdflatex arxiv.tex" after going into that folder(from terminal) and it works fine. But when I run the command "pdflatex ~/path/to/folder/arxiv.tex" then it shows that the error that other files(.png, .bbl) are not present?

  • First thing you have to put into your mind: Do never use spaces in file names and paths. – Johannes_B Jun 17 '19 at 05:25
  • I didn't use it in my local system. Just added here by mistake – MRIDUL SHARMA Jun 17 '19 at 05:26
  • 1
    AFAIK LaTeX usually resolves (local) file inclusions from the current working directory. So if you are in ~/path/to/folder and call pdflatex arxiv.tex everything is fine, but if you are in, say ~ and call pdflatex ~/path/to/folder/arxiv.tex the files are not found. You can work around this by setting TEXINPUTS (https://tex.stackexchange.com/q/93712/35864) or the like. If you have to run additional tools (BibTeX, makeindex, ...) you may have to do a similar thing with those as well. That's why I would just try to run all tools from within the right folder and be done with it. ... – moewe Jun 17 '19 at 05:37
  • 1
    ... Is there any reason why you want to say pdflatex ~/path/to/folder/arxiv.tex and not cd ~/path/to/folder/ and pdflatex arxiv.tex? Note that it may or may not be enough to run pdflatex just once (especially if things changed in the file since the last run), in cases like this automatic tools like latexmk can be useful. – moewe Jun 17 '19 at 05:38

0 Answers0