-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
40 lines (30 loc) · 1.17 KB
/
justfile
File metadata and controls
40 lines (30 loc) · 1.17 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
31
32
33
34
35
36
37
38
39
40
# Use a texmf folder to contain shared configuration.
export TEXMFHOME := justfile_directory() / 'texmf' + ',' + `kpsewhich -var-value=TEXMFHOME`
# Directory containing TeX sources.
src := 'src'
# Name of the main file.
main := 'main.tex'
# LaTeX engine.
latex := 'xelatex'
# Build the final PDF and open it.
build-open file=main: (build-final file) (open file)
# Build the final PDF.
build-final file=main: (build-index file)
cd {{quote(src / parent_directory(file))}} && {{latex}} {{quote(file_name(file))}}
# Build the index.
build-index file=main: (draft-pass file)
cd {{quote(src / parent_directory(file))}} && makeindex {{quote(file_name(file))}}
# Build the project without generating a PDF.
draft-pass file=main:
cd {{quote(src / parent_directory(file))}} && {{latex}} --no-pdf {{quote(file_name(file))}}
# Open the rendered PDF.
open file=main:
open {{quote(src / without_extension(file))}}.pdf
alias o := open
# Get the path to the rendered PDF.
output-path file=main:
@echo {{quote(src / without_extension(file))}}.pdf
# Clean up build artifacts.
clean:
fd -I '.*\.(aux|glo|ist|log|pdf|sta|synctex.gz|xdv)' {{quote(src)}} -x rm {}
alias c := clean