In an earlier post I wrote about my explorations of using MultiMarkdown to create a LaTeX document that included a bibliography. Since that post I’ve made some changes.
First, I’m now using the MultiMarkdown Composer application to author my document. I’ve only had it a few days, and so far like it very much.
Second, I’ve written a rudimentary bash script to automate the creation of the PDF document. In my current workflow I keep my source file separate from the output. Mainly because the creation of the PDF from the LaTeX file creates more than 10 additional files and I didn’t want these mixed up with my source files.
The script is as follows:
#!/bin/bash # script to help in making the document # set some options set -o nounset set -o errexit # get the current directory WORK_DIR=`pwd` MMD_UTILS_DIR=/path/to the/MultiMarkdown/Utilities # clean up the output directory rm -f "$WORK_DIR"/output/* # merge the source files together "$MMD_UTILS_DIR"/mmd_merge.pl "$WORK_DIR"/index.txt > "$WORK_DIR"/output/latest.md # convert to latex /usr/local/bin/multimarkdown "$WORK_DIR"/output/latest.md -t latex -o "$WORK_DIR"/output/latest.tex # change to the output directory cd "$WORK_DIR"/output # run pdflatex /usr/texbin/pdflatex -halt-on-error latest.tex &> stage-01.log # run pdflatex /usr/texbin/pdflatex -halt-on-error latest.tex &> stage-02.log # make the bibliography /usr/texbin/bibtex latest.aux &> stage-03.log # run pdflatex /usr/texbin/pdflatex -halt-on-error latest.tex &> stage-04.log # run pdflatex /usr/texbin/pdflatex -halt-on-error latest.tex &> stage-05.log
The script has been developed to work on my MacBook running the lastest version Mac OS X and that also has the latest MacTeX version installed as well as the MMD Support Files and the MMD LaTeX Support Files.
The “Type ornaments” photo was uploaded to Flickr by vlasta2 and used under the terms of a Creative Commons License.
