-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (28 loc) · 1.17 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
NAME ?= vkr
ENGINE ?= xelatex # Only `xelatex` or `lualatex` are allowed here
.PHONY: $(NAME).pdf clean dist-clean format depext depext-deb
all: $(NAME).pdf
$(NAME).pdf:
latexmk -$(ENGINE) -synctex=1 -interaction=nonstopmode -file-line-error -shell-escape $(NAME).tex
clean:
latexmk -c $(NAME).tex
dist-clean:
latexmk -C $(NAME).tex
# https://stackoverflow.com/a/12959694
# Make does not offer a recursive wildcard function, so here's one:
rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
FILES_TO_FORMAT := $(call rwildcard,./,*.tex) \
$(call rwildcard,./,*.cls) \
$(call rwildcard,./,*.bib)
#$(info $(FILES_TO_FORMAT))
format:
$(foreach file, $(FILES_TO_FORMAT), latexindent -l -s -o=$(file) -m $(file);)
aspell:
aspell --mode=tex -l ru --home-dir=. --personal=personal_dict.txt -c $(FILE)
depext: depext-deb
# Not a full list of external dependencies. To be extended...
depext-deb:
sudo apt install fonts-cmu texlive-lang-cyrillic texlive-xetex texlive-bibtex-extra texlive-science texlive-plain-generic latexmk python3-pygments --yes
# for pzdr font
sudo apt install texlive-fonts-recommended --yes
sudo apt install hunspell-ru --yes