Skip to content

Commit f94cb38

Browse files
committed
refactor makefile and updates readmes
1 parent 220280a commit f94cb38

4 files changed

Lines changed: 76 additions & 42 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ Alternatively, you can simply view the PNG pages: [page-0](docs/cv-page-0.png) a
1717
Open a terminal to build cv locally
1818
```bash
1919
cd $HOME/repositories/mxochicale/cv/tex
20-
bash localbuilt.sh TwoPages
20+
make two
21+
make view
2122
make clean #clean project
2223
```
2324
For further details see [here](tex)

tex/Makefile

Lines changed: 72 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,72 @@
1-
fileinfo := LaTeX Makefile
2-
author := Miguel Xochicale
3-
## Usage
4-
# run "make" in the terminal to build local pdf
5-
# run "make view" to see pdf file
6-
# run "make clean" when you finished your local changes
7-
8-
## References
9-
# https://gist.github.com/dogukancagatay/2eb82b0233829067aca6
10-
# https://www.latex4technics.com/?note=5fu0y6
11-
# https://www.drewsilcock.co.uk/using-make-and-latexmk
12-
13-
## Tools
14-
LATEXMK = latexmk
15-
RM = rm -f
16-
EVINCE = evince
17-
18-
##Project name
19-
PROJNAMENP=cv-n-pages
20-
PROJNAMETP=cv-two-pages
21-
22-
## Rules
23-
TwoPages: $(PROJNAMETP).tex
24-
$(LATEXMK) -pdf -pdflatex="pdflatex -synctex=1 -file-line-error %O %S" $<
25-
$(EVINCE) $(PROJNAMETP).pdf
26-
27-
NPages: $(PROJNAMENP).tex
28-
$(LATEXMK) -pdf -pdflatex="pdflatex -synctex=1 -file-line-error %O %S" $<
29-
$(EVINCE) $(PROJNAMENP).pdf
30-
31-
#view:
32-
33-
mostlyclean:
34-
$(LATEXMK) -silent -C
35-
36-
clean: mostlyclean
37-
$(LATEXMK) -silent -c
38-
$(RM) main.pdf *.bbl *.run.xml -rf _minted-main *.pyg example.out
1+
# ============================================================================
2+
# LaTeX Makefile (tab-safe version using .RECIPEPREFIX)
3+
# Author: Miguel Xochicale
4+
# ============================================================================
5+
6+
.RECIPEPREFIX := >
7+
8+
# ----------------------------------------------------------------------------
9+
# Tools
10+
# ----------------------------------------------------------------------------
11+
LATEXMK := latexmk
12+
PDFLATEX := pdflatex
13+
VIEWER := evince
14+
RM := rm -rf
15+
16+
# ----------------------------------------------------------------------------
17+
# Project names
18+
# ----------------------------------------------------------------------------
19+
TWO_PAGE := cv-two-pages
20+
N_PAGE := cv-n-pages
21+
22+
# Default target
23+
.DEFAULT_GOAL := two
24+
25+
# ----------------------------------------------------------------------------
26+
# Build flags
27+
# ----------------------------------------------------------------------------
28+
LATEX_FLAGS := -pdf \
29+
-interaction=nonstopmode \
30+
-synctex=1 \
31+
-file-line-error \
32+
-pdflatex="$(PDFLATEX) %O %S"
33+
34+
# ----------------------------------------------------------------------------
35+
# Targets
36+
# ----------------------------------------------------------------------------
37+
38+
.PHONY: all two npages view clean distclean help
39+
40+
all: two
41+
42+
# Build two-page CV
43+
two: $(TWO_PAGE).tex
44+
> $(LATEXMK) $(LATEX_FLAGS) $<
45+
46+
# Build n-page CV
47+
npages: $(N_PAGE).tex
48+
> $(LATEXMK) $(LATEX_FLAGS) $<
49+
50+
# View PDF
51+
view:
52+
> $(VIEWER) $(TWO_PAGE).pdf >/dev/null 2>&1 &
53+
54+
# Clean auxiliary files
55+
clean:
56+
> $(LATEXMK) -c
57+
> $(RM) *.bbl *.run.xml *.bcf *.pyg *.out
58+
59+
# Full cleanup (including PDFs)
60+
distclean: clean
61+
> $(LATEXMK) -C
62+
> $(RM) *.pdf _minted-*
63+
64+
# Help menu
65+
help:
66+
> @echo "Available targets:"
67+
> @echo " make Build default two-page CV"
68+
> @echo " make two Build two-page CV"
69+
> @echo " make npages Build n-page CV"
70+
> @echo " make view Open PDF"
71+
> @echo " make clean Remove aux files"
72+
> @echo " make distclean Remove all generated files"

tex/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
Open terminal and run:
55
```bash
66
cd $HOME/repositories/mxochicale/cv/tex
7-
bash localbuilt.sh TwoPages
8-
bash localbuilt.sh NPages
7+
make two
8+
make view
99
```
1010
to clean project, then type:
1111
```bash

tex/localbuilt.sh

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)