-
Notifications
You must be signed in to change notification settings - Fork 18
/
Sakefile.master
72 lines (63 loc) · 3.36 KB
/
Sakefile.master
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
# Extensionless name of Markdown file
#! MARKDOWN_FILE = PUT THE NAME HERE
# Variables
#! PREFIX = /Users/andrew/.pandoc
#! BIB_FILE = /Users/andrew/Dropbox/Readings/Papers.bib
#! CSL = american-political-science-association
#! CROSSREF = --filter pandoc-crossref -M figPrefix:"Figure" -M eqnPrefix:"Equation" -M tblPrefix:"Table"
# Other common CSLs:
# * chicago-fullnote-bibliography
# * chicago-syllabus-no-bib
# * apa
# * apsa-no-bib
# To add version control footer support in PDFs:
# 1. Run vcinit in the directory
# 2. Place `./vc` at the front of the formula
# 3. Add `-V vc` to the pandoc command
# 4. Change pagestyle to athgit instead of ath
generate output:
help: convert Markdown file to different formats
pdf:
help: convert to PDF
dependencies:
- $MARKDOWN_FILE.md
formula: >
replace_includes $MARKDOWN_FILE.md | pandoc -r markdown+simple_tables+table_captions+yaml_metadata_block $CROSSREF -w latex -s -S --default-image-extension=pdf --latex-engine=xelatex --template=$PREFIX/templates/xelatex.template --filter pandoc-citeproc --csl=$PREFIX/csl/$CSL.csl --bibliography=$BIB_FILE -V chapterstyle=hikma-article -V pagestyle=ath -o $MARKDOWN_FILE.pdf
output:
- $MARKDOWN_FILE.pdf
docx:
help: convert to nice looking Word file through LibreOffice
dependencies:
- $MARKDOWN_FILE.md
formula: >
replace_includes $MARKDOWN_FILE.md | replace_pdfs | pandoc -r markdown+simple_tables+table_captions+yaml_metadata_block $CROSSREF -w odt -S --default-image-extension=png --template=$PREFIX/templates/odt.template --reference-odt=$PREFIX/styles/reference.odt --filter pandoc-citeproc --csl=$PREFIX/csl/$CSL.csl --bibliography=$BIB_FILE -o $MARKDOWN_FILE.odt;
/Applications/LibreOffice.app/Contents/MacOS/soffice --invisible --convert-to docx $MARKDOWN_FILE.odt;
rm $MARKDOWN_FILE.odt
output:
- $MARKDOWN_FILE.docx
manuscript:
help: convert to a Word file formatted as a manuscript through LibreOffice
dependencies:
- $MARKDOWN_FILE.md
formula: >
replace_includes $MARKDOWN_FILE.md | replace_pdfs | pandoc -r markdown+simple_tables+table_captions+yaml_metadata_block $CROSSREF -w odt -S --default-image-extension=png --template=$PREFIX/templates/odt-manuscript.template --reference-odt=$PREFIX/styles/reference-manuscript.odt --filter pandoc-citeproc --csl=$PREFIX/csl/$CSL.csl --bibliography=$BIB_FILE -o $MARKDOWN_FILE-manuscript.odt;
/Applications/LibreOffice.app/Contents/MacOS/soffice --invisible --convert-to docx $MARKDOWN_FILE-manuscript.odt;
rm $MARKDOWN_FILE-manuscript.odt
output:
- $MARKDOWN_FILE-manuscript.docx
html:
help: convert to HTML
dependencies:
- $MARKDOWN_FILE.md
formula: >
replace_includes $MARKDOWN_FILE.md | replace_pdfs | pandoc -r markdown+simple_tables+table_captions+yaml_metadata_block $CROSSREF -w html -S --default-image-extension=png --template=$PREFIX/templates/html.template --css=$PREFIX/styles/marked/kultiad-serif.css --filter pandoc-citeproc --csl=$PREFIX/csl/$CSL.csl --bibliography=$BIB_FILE -o $MARKDOWN_FILE.html
output:
- $MARKDOWN_FILE.html
bibliography:
help: extract citations into a separate BibTeX file
dependencies:
- $MARKDOWN_FILE.md
formula: >
bib_extract --bibtex_file $BIB_FILE $MARKDOWN_FILE.md $MARKDOWN_FILE.bib
output:
- $MARKDOWN_FILE.bib