1

I tried to write a makefile to compile the tex file, but an error made me crazy. I have simplified my makefile like below

all: main.tex
    xelatex -interaction=nonstopmode  ./main.tex

but the error still exists as follows.

make: *** [all] Error 1

I also tried to directly run the command in terminal:

xelatex -interaction=nonstopmode  ./main.tex

I have a successful compilation. Similar errors have been found in make: *** [ ] Error 1 error and make: *** [ ] Error 1 error, but the solution does not work for me. Is there anyone could help me? Thanks.

Community
  • 1
  • 1
Jingwei
  • 43
  • 5
  • Is there a simpler `xelatex` command you can test? Does the Make command compile the tex file? Do you know the return value of the `xelatex` command? – Beta Jul 22 '14 at 23:35
  • I cannot use a simple xelatex for the latex file (because it would give me error). If add the nonstop mode, anyway, the pdf would successfully generate and no error appears. I have run the command "xelatex -interaction=nonstopmode ./main.tex" in terminal (not in the makefile), it works. I have also tried to use this makefile for other tex files, it also works. But this makefile does not work for the special tex files. – Jingwei Jul 23 '14 at 14:03

1 Answers1

0

A very dirty and useful trick is to force true in order to avoid the error and to let make continue:

$(FICTEX).pdf: $(FICTEX).aux $(BBL)
    $(PDFLATEX) $(FICTEX)||true
    $(PDFLATEX) $(FICTEX)||true
revher
  • 191
  • 3
  • This can also be achieved by putting a minus sign before each row in which errors should be ignored, see [this answer](https://stackoverflow.com/a/2670143/2207840). Alternatively, one can also pass the `-i` flag to make to ignore all errors. – Eike P. Jul 02 '20 at 16:34