-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (50 loc) · 1.47 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
### -*- Makefile -*- definition file for Orgmk
SHELL = /bin/sh
OUT_DIR = out
VIEW_HTML ?= firefox
VIEW_PDF ?= okular
ifeq ($(ALLSUBDIRS),yes)
ORG_FILES=$(shell find . -name \*.org)
HTML_FILES=$(shell find . -name \*.html)
PDF_FILES=$(shell find . -name \*.pdf)
else
ORG_FILES=$(shell find . -maxdepth 1 -name \*.org)
HTML_FILES=$(shell find . -maxdepth 1 -name \*.html)
PDF_FILES=$(shell find . -maxdepth 1 -name \*.pdf)
endif
# turn command echo'ing back on with VERBOSE=1
ifndef VERBOSE
QUIET := @
endif
PRINTF=$(QUIET)printf
EGREP=$(QUIET)egrep
LS=$(QUIET)ls
# variables para mover los documentos generados
# a un directorio de salida
HTML_FILES_FROM_ORG = $(patsubst %.org,%.html,$(ORG_FILES))
PDF_FILES_FROM_ORG = $(patsubst %.org,%.pdf,$(ORG_FILES))
.PHONY: html
html: $(CUR_HTML_FILES) # Regenerate all HTML documents from Org
emacs --batch --find-file $(ORG_FILES) --funcall org-html-export-to-html
mv $(HTML_FILES_FROM_ORG) $(OUT_DIR)
# export de pdf
pdf :
pandoc $(ORG_FILES) \
-o "$(OUT_DIR)/document.pdf" \
-H src/options.sty \
-N \
--metadata-file=src/preamble.yaml \
--from org \
--template "src/eisvogel.tex" \
--filter=pandoc-latex-environment \
--filter=pandoc-citeproc \
--csl=src/apa.csl
# si llegase a tener referencias
# --biblio=meta/my-biblio.bib \
# --filter=pandoc-crossref \
# mv $(TARGET).pdf $(OUT_DIR)
.PHONY: all
all: pdf html
.PHONY: clean
clean:
rm out/*