Skip to content

Commit

Permalink
fix: re-build pdf on updating non-main TeX files (#30)
Browse files Browse the repository at this point in the history
This patch makes building command detect updates in non-main `.tex`
and corresponding `.bib` files and re-build the resulting pdf file.

This is achieved by adding `*.tex` and corresponding `.bib` files as
prerequisites for the output pdf file in the Makefile.

Previous behavior:
```
$ vi 010_intro.tex

...

$ make

make: Nothing to be done for 'all'.
```

New behavior:
```
$ vi 010_intro.tex

...

$ make

Start building...
```
  • Loading branch information
georgiy-belyanin authored Jan 4, 2025
1 parent f13516a commit 2ee060a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ ENGINE ?= xelatex # Only `xelatex` or `lualatex` are allowed here

all: $(VKR).pdf $(TALK).pdf

%.pdf: %.tex
latexmk -$(ENGINE) -synctex=1 -interaction=nonstopmode -file-line-error -shell-escape $^
%.pdf: %.tex %.bib *.tex
latexmk -$(ENGINE) -synctex=1 -interaction=nonstopmode -file-line-error -shell-escape $<

clean:
latexmk -c $(VKR).tex $(TALK).tex
Expand Down

0 comments on commit 2ee060a

Please sign in to comment.