Home

Awesome

Pandoc Markdown-Latex Boilerplate

Use this to write a paper in Markdown and render it using the Pandoc engine.

QUICKSTART for windows users: double-click on winmake.bat

NOTE: The windows batch file hasn't been fully tested, but is based on the previously working version published by David Caplan. Testing and pull requests are welcome.


Requirements

Follow instruction on installing pandoc in this link http://pandoc.org/installing.html . For PDF output, you’ll also need to install LaTeX. We recommend MiKTeX.

You also need to install the content of https://github.com/citation-style-language/styles into the csl if you want to fully ultilize csl. You can update them as follows:

$ git submodule update

Building

Configuring the build system

Edit the configuration file _CONFIG.txt, which contains the following defaults:

BUILDNAME=dissertation
OUTPUT_FOLDER=output
REFS=references.bib
TEMPLATE=cuny
DOCX_TEMPLATE=
ODT_TEMPLATE=
CSL=chicago-author-date
PANDOC_OPTIONS=--dpi=600 --latex-engine=xelatex --filter pandoc-tablenos --filter pandoc-fignos --filter pandoc-citeproc

You can customize the configuration variables as follows:

Notes:

SECTIONS_FILEPATH

Edit the source file _SECTIONS.txt, which contains a list of all of the files to include:

    metadata.yml
    chapter1.md
    chapter2.md
    appendix_a.md
    references.md

Where each file to be included is entered on a single line or separated by a single space.

The first item should be your Pandoc metadata file (e.g., metadata.yml), which contains the information to be included in the front and back matter, such as Title, Author, committee members, abstract, etc., as well as formatting options.

The last item should be the references (or bibliography, works cited) document (e.g., references.md). This is a special file with formatting instructions written in LaTex. You can customize the formatting using your own LaTex styles for things like hanging indents, but the contents of the bibliography are generated automatically from your text and references file (references.bib). See the Pandoc documentation for more information.

Metadata

Be sure to edit the metadata.yml file in the source directory. See the Pandoc documentation for more information, and refer to the cuny.tex template to see what some of the options do.

CSL: Citation Style Language

The CSL files are located in the csl submodule.

Linux/OS X

make [targets]

Optional targets

Example

make pdf viewpdf

Will generate a PDF and then automatically open it.

Default target: make with no arguments will generate a PDF.


Windows

Just double click on winmake.bat and type pdf or pdf-safemode if pdf doesn't work. Else choose html.


winmake clean

Removes the build folder


winmake pdf

Builds a pdf file to ./build/ folder. Requires LaTeX.


winmake pdf-safemode

Builds a pdf file to ./build/ folder. Requires LaTeX. Ignores template and CSL settings.


winmake epub

Builds a epub file to ./build/ folder


winmake html

Builds a html file to ./build/ folder


winmake

Opens up a prompt.



Tips and Tricks

Using makefile in windows

You are not restricted to using winmake.bat in windows. If you install git for windows from http://www.git-scm.com/ in addition to the make program in http://gnuwin32.sourceforge.net/packages/make.htm (Also add the program to path). This is since a copy of git will include a Git Bash Shell, which will support unix commands like cat etc... .

For your convenience, a copy of make.exe (As of 25 November 2006) is included. Being GPLed its source code is also in the website..

Opening Window commandline in the right directory quickly

SHIFT+RIGHT_CLICK on your folder in windows will display an extra entry in the dropdown saying "Open Command Window Here". This will save you lots of time. Or you can make a batch file like buildpdf.bat that contains winmake pdf.


COPYRIGHT

Copyright 2016, 2017 Keith Miyake keith.miyake@gmail.com

Copyright 2011-2016 David Caplan

LICENSE

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.