Skip to content

Commit 413c7d5

Browse files
authored
Merge pull request #144 from henrybear327/improvement/latexmk
Use latexmk instead of pdflatex for PDF generation
2 parents d78afd2 + 16fe2e9 commit 413c7d5

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ lkmpg.pdf
1818
*.toc
1919
*.bbl
2020
*.blg
21+
*.fdb_latexmk
22+
*.fls
2123

2224
# make4ht
2325
*.html

Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ PROJ = lkmpg
22
all: $(PROJ).pdf
33

44
$(PROJ).pdf: lkmpg.tex
5-
pdflatex -shell-escap $<
6-
bibtex $(PROJ) >/dev/null || echo
7-
pdflatex -shell-escape $< 2>/dev/null >/dev/null
5+
@if ! hash latexmk; then echo "No Latexmk found. See https://mg.readthedocs.io/latexmk.html for installation."; exit 1; fi
86
rm -rf _minted-$(PROJ)
7+
latexmk -shell-escape lkmpg.tex -pdf
98

109
html: lkmpg.tex html.cfg assets/Manrope_variable.ttf
1110
sed $ 's/\t/ /g' lkmpg.tex > lkmpg-for-ht.tex
@@ -19,7 +18,7 @@ indent:
1918
(cd examples; find . -name '*.[ch]' | xargs clang-format -i)
2019

2120
clean:
22-
rm -f *.dvi *.aux *.log *.ps *.pdf *.out lkmpg.bbl lkmpg.blg lkmpg.lof lkmpg.toc
21+
rm -f *.dvi *.aux *.log *.ps *.pdf *.out lkmpg.bbl lkmpg.blg lkmpg.lof lkmpg.toc lkmpg.fdb_latexmk lkmpg.fls
2322
rm -rf html
2423

2524
.PHONY: html

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ $ brew install --cask mactex
4040
$ sudo tlmgr update --self
4141
```
4242

43+
Note that `latexmk` is required to generated PDF, and it probably has been installed on your OS already. If not, please follow the [installation guide](https://mg.readthedocs.io/latexmk.html#installation).
44+
4345
Alternatively, using [Docker](https://docs.docker.com/) is recommended, as it guarantees the same dependencies with our GitHub Actions workflow.
4446
After install [docker engine](https://docs.docker.com/engine/install/) on your machine, pull the docker image [twtug/lkmpg](https://hub.docker.com/r/twtug/lkmpg) and run in isolated containers.
4547

0 commit comments

Comments
 (0)