1 # Extensionless name of Markdown file
2 #! MARKDOWN_FILE = PUT THE NAME HERE
5 #! PREFIX = /Users/andrew/.pandoc
6 #! BIB_FILE = /Users/andrew/Dropbox/Readings/Papers.bib
7 #! CSL = american-political-science-association
8 #! CROSSREF = --filter pandoc-crossref -M figPrefix:"Figure" -M eqnPrefix:"Equation" -M tblPrefix:"Table"
11 # * chicago-fullnote-bibliography
12 # * chicago-syllabus-no-bib
16 # To add version control footer support in PDFs:
17 # 1. Run vcinit in the directory
18 # 2. Place `./vc` at the front of the formula
19 # 3. Add `-V vc` to the pandoc command
20 # 4. Change pagestyle to athgit instead of ath
23 help: convert Markdown file to different formats
30 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
35 help: convert to nice looking Word file through LibreOffice
39 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;
40 /Applications/LibreOffice.app/Contents/MacOS/soffice --invisible --convert-to docx $MARKDOWN_FILE.odt;
46 help: convert to a Word file formatted as a manuscript through LibreOffice
50 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;
51 /Applications/LibreOffice.app/Contents/MacOS/soffice --invisible --convert-to docx $MARKDOWN_FILE-manuscript.odt;
52 rm $MARKDOWN_FILE-manuscript.odt
54 - $MARKDOWN_FILE-manuscript.docx
61 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
66 help: extract citations into a separate BibTeX file
70 bib_extract --bibtex_file $BIB_FILE $MARKDOWN_FILE.md $MARKDOWN_FILE.bib