-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
77 lines (51 loc) · 2.59 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
cnw.ipynb: cnw.md
jupytext --to notebook cnw.md
## Put this Makefile in your project directory---i.e., the directory
## containing the paper you are writing. Assuming you are using the
## rest of the toolchain here, you can use it to create .html, .tex,
## and .pdf output files (complete with bibliography, if present) from
## your markdown file.
## - Change the paths at the top of the file as needed.
## - Using `make` without arguments will generate html, tex, and pdf
## output files from all of the files with the designated markdown
## extension. The default is `.md` but you can change this.
## - You can specify an output format with `make tex`, `make pdf` or
## - `make html`.
## - Doing `make clean` will remove all the .tex, .html, and .pdf files
## in your working directory. Make sure you do not have files in these
## formats that you want to keep!
## Markdown extension (e.g. md, markdown, mdown).
MEXT = md
## All markdown files in the working directory
SRC = $(wildcard *.$(MEXT))
## Location of Pandoc support files.
PREFIX = $(HOME)/txt/t/pandoc-templates
## Location of your working bibliography file
BIB = ./workshop.bib
## CSL stylesheet (located in the csl folder of the PREFIX directory).
CSL = the-journal-of-neuroscience
PDFS=$(SRC:.md=.pdf)
HTML=$(SRC:.md=.html)
TEX=$(SRC:.md=.tex)
all: $(PDFS) $(HTML) $(TEX)
pdf: clean $(PDFS)
html: clean $(HTML)
tex: clean $(TEX)
%.html: %.md
pandoc -r markdown+simple_tables+table_captions+yaml_metadata_block -w html -S --template=$(PREFIX)/templates/html.template --css=$(PREFIX)/marked/kultiad-serif.css --filter pandoc-citeproc --csl=$(PREFIX)/csl/$(CSL).csl --bibliography=$(BIB) --mathjax --toc -o $@ $<
%.tex: %.md
pandoc -r markdown+simple_tables+table_captions+yaml_metadata_block -w latex -s -S --latex-engine=pdflatex --template=$(PREFIX)/templates/latex.template --filter pandoc-citeproc --csl=$(PREFIX)/csl/ajps.csl --bibliography=$(BIB) -o $@ $<
%.pdf: %.md
pandoc -r markdown+simple_tables+table_captions+yaml_metadata_block -s -S --latex-engine=pdflatex --template=$(PREFIX)/templates/latex.template --filter pandoc-citeproc --csl=$(PREFIX)/csl/$(CSL).csl --bibliography=$(BIB) -o $@ $<
clean:
rm -f *.html *.pdf *.tex *~
## index.html: index.md Makefile
## pandoc --standalone --mathjax --toc -o index.html index.md
.PHONY: /tmp/cnw-2016.zip clean open-nb
/tmp/cnw-2016.zip:
rm -f /tmp/cnw-2016.zip
cd ..; zip -r /tmp/cnw-2016.zip cnw-2014 -x cnw-2014/.git\* cnw-2014/euler2.m cnw-2014/feedback.txt cnw-2014/notes.txt
chmod o+r /tmp/cnw-2016.zip
scp /tmp/cnw-2016.zip sje30@rgc:web/
open-nb:
jupyter notebook cnw.ipynb