From 2ee060a2a5a9d88b554e8192fcbc2a9a29730f9e Mon Sep 17 00:00:00 2001 From: Georgiy Belyanin Date: Sat, 4 Jan 2025 13:15:47 +0300 Subject: [PATCH] fix: re-build pdf on updating non-main TeX files (#30) 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... ``` --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 0d2b59c..320cf4a 100644 --- a/Makefile +++ b/Makefile @@ -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