xu-cheng / latex-action

:octocat: GitHub Action to compile LaTeX documents
https://github.com/xu-cheng/latex-action
MIT License
1.13k stars 136 forks source link

Emergency Stop #12

Closed arnavs closed 4 years ago

arnavs commented 4 years ago

I've been having a bit of trouble with this extension. Namely, in response to the error below (failing to include a tex snippet), I tried various flags (both the defaults, and the suggested -f), with no luck.

I'm posting on the assumption that the flags are not going through to the compiler. But please close if that's not the case.

2019-11-20T18:33:10.5627228Z ! LaTeX Error: File `../figures/summarystats_part2.tex' not found.
2019-11-20T18:33:10.5627310Z 
2019-11-20T18:33:10.5627394Z Type X to quit or <RETURN> to proceed,
2019-11-20T18:33:10.5627508Z or enter new name. (Default extension: tex)
2019-11-20T18:33:10.5627576Z 
2019-11-20T18:33:10.5627659Z Enter file name: 
2019-11-20T18:33:10.5627766Z ./paper_drafts/perla_pflueger_szkup.tex:1089: Emergency stop.
2019-11-20T18:33:10.5627874Z <read *> 
2019-11-20T18:33:10.5627972Z          
2019-11-20T18:33:10.5628056Z l.1089         \input{../figures/summarystats_part2.tex}
2019-11-20T18:33:10.5628169Z                                                   \label{tab:summarystats2}^^M
2019-11-20T18:33:10.5628294Z ./paper_drafts/perla_pflueger_szkup.tex:1089:  ==> Fatal error occurred, no out
2019-11-20T18:33:10.5628569Z put PDF file produced!
xu-cheng commented 4 years ago

Please make sure the missing files are present.

You probably want to change the working directory like this:

with:
  root_file: your_main.tex
  working_directory: paper_drafts

Also, I think you should try to build the LaTeX locally. Using cd < working_directory >; latexmk -pdf <your_main.tex>. If there are any problem, you should address it by yourself.

I tried various flags (both the defaults, and the suggested -f), with no luck.

I am not sure what these flags you are referring to? There is no -f suggested anywhere.

arnavs commented 4 years ago

The PDF builds locally without any issue. The missing file is a simple include (which also exists,) and shouldn’t be fatal.

The f flag is the one recommended by the error message.

xu-cheng commented 4 years ago

The most common reason is that you are in the wrong working directory. Have you tried my suggestion in the above? To reproduce the problem locally, please make sure that you are invoking the compile command in the same directory as that in the CI environment. Noted that in LaTeX, the relative path is not resolved based on the current tex file but based on the current working directory.

arnavs commented 4 years ago

Huh. This did the trick. I thought the hard paths coming out of the blahblahblah.tex would be enough.

Thanks for pointing out the key-value pair.