-
Notifications
You must be signed in to change notification settings - Fork 611
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (25 loc) · 1.39 KB
/
Makefile
File metadata and controls
30 lines (25 loc) · 1.39 KB
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
PROJ = lkmpg
all: $(PROJ).pdf
$(PROJ).pdf: lkmpg.tex
@if ! hash latexmk; then echo "No Latexmk found. See https://mg.readthedocs.io/latexmk.html for installation."; exit 1; fi
rm -rf _minted-$(PROJ)
latexmk -shell-escape lkmpg.tex -pdf
html: lkmpg.tex html.cfg assets/Manrope_variable.ttf $(wildcard examples/*.[ch] examples/other/*.[ch])
sed $ 's/\t/ /g' lkmpg.tex > lkmpg-for-ht.tex
make4ht --shell-escape --utf8 --format html5 --config html.cfg --output-dir html lkmpg-for-ht.tex "fn-in"
python3 -c "\
import re, sys; \
f=open('html/lkmpg-for-ht.html','r'); s=f.read(); f.close(); \
s=re.sub(r\"(<span class='ecrm-0500'>\d+)([ ]+)</span>\",lambda m:m.group(1)+'</span>'+' '*int(len(m.group(2))*4/7),s); \
s=re.sub(r\"(<span class='ecrm-0500'>\d+)\n</span>\",lambda m:m.group(1)+'</span>\n',s); \
f=open('html/lkmpg-for-ht.html','w'); f.write(s); f.close()"
ln -sf lkmpg-for-ht.html html/index.html
cp assets/Manrope_variable.ttf html/Manrope_variable.ttf
rm -f lkmpg-for-ht.tex lkmpg-for-ht.xref lkmpg-for-ht.tmp lkmpg-for-ht.html lkmpg-for-ht.css lkmpg-for-ht.4ct lkmpg-for-ht.4tc lkmpg-for-ht.dvi lkmpg-for-ht.lg lkmpg-for-ht.idv lkmpg*.svg lkmpg-for-ht.log lkmpg-for-ht.aux
rm -rf _minted-$(PROJ) _minted-lkmpg-for-ht
indent:
$(MAKE) -C examples indent
clean:
rm -f *.dvi *.aux *.log *.ps *.pdf *.out lkmpg.bbl lkmpg.blg lkmpg.lof lkmpg.toc lkmpg.fdb_latexmk lkmpg.fls
rm -rf html
.PHONY: html