My thesis workflow - Academic writing with a Markdown/LaTeX/Bibtex combination on OSX

Thesis workflow graphical display

Prequisites

Preliminary remarks

This description is still a work in progress. I´ll have to write the full text and create a new version of the graphical workflow to include bibtex for citation management. Stay tuned…

Updated 2016-08-03: Small changes in compile.sh and a short workflow description

Needed software:

Short description of the workflow:

The basic workflow is easily described in a few words: I write my paper in the form of several markdown files that live together in one folder with a simple shell script called “compile.sh” and some LaTeX files that include footer, header and some configuration settings. As an example you can take a look at the file “executive.md” containing the executive summary of the paper (actually right now it´s a dummy file):

\section*{Executive Summary}
\addcontentsline{toc}{section}{Executive Summary}

*Ziel* - Beeindrucken

*Vorgehen* - Spannend

*Ergebnisse* - Grandios

*Limitationen* - Keine

*Praktische Implikationen* - Alles graue Theorie

*Mehrwert* - Keiner, aber war schön

You might notice the two LaTeX macros in the first two lines. As this procedure is still work in progress I did not change those into markdown. I´ll have to check out how to create sections in markdown that will be taken into the table of contents when the typesetting is taking place.

config.tex:

The configuration is done in the “config.tex” file:

\newcommand{\Arbeitstitel}
{
    Titel der Arbeit
}
\newcommand{\Autor}
{
    Lars Bartschat
}

\newcommand{\MatrikelNr}
{
    123123123
}

\newcommand{\EmailAdresse}
{
    meinname@meinserver.de
}
\newcommand{\Arbeitsart}
{
    Projektarbeit
}
\newcommand{\Studiengang}
{
    Marketing Executive Program 
}
\newcommand{\Hochschule}
{
    Westfälischen Wilhelms-Universität Münster
}
\newcommand{\Lehrstuhl}
{
    Lehrstuhl für Mustermänner, Münster
}   
\newcommand{\Themensteller}
{
    Prof. Dr. Mustermann
}       
\newcommand{\Betreuer}
{
    Dipl.-Kfm. Mustermann
}       
\newcommand{\Ausgabedatum}
{
    1.1.2016
}       
\newcommand{\Abgabedatum}
{
    31.12.2016
}
\newcommand{\Ort}
{
    Münster
}

Basically this file is just defining a lot of LaTeX macros that will be used in the markdown files so that the structure can be reused in a comfortable way for the next paper.

compile.sh shell script:

#!/bin/zsh

# "translate" the markdown files into latex files

pandoc -f markdown -t latex ./Executive.md -o Executive.tex
pandoc -f markdown -t latex ./Abkürzungen.md -o Abkürzungen.tex
pandoc -f markdown -t latex ./Hauptteil.md -o Hauptteil.tex
pandoc -f markdown -t latex ./Eidesstatt.md -o Eidesstatt.tex

# concatenate all latex files into one

cat ./header.tex > output.tex
cat ./Executive.tex >> output.tex
cat ./Abbildungen.tex >> output.tex
cat ./Abkürzungen.tex >> output.tex
cat ./Inhaltsverzeichnis.tex >> output.tex
cat ./Hauptteil.tex >> output.tex
cat ./Literatur.tex >> output.tex
cat ./Eidesstatt.tex >> output.tex
cat ./footer.tex >> output.tex

# typeset the latex file and create a pdf file

latexmk -gg -pdf ./output

# rudimentary command line argument interpretation

if [ $# -eq 2 ]
    then
        if [ "$1" == "push" ]
            then
                # push all files into git repository with commit message
                /usr/local/bin/git add *
                /usr/local/bin/git commit  -m "$2"
                /usr/local/bin/git push
            else
                echo "Huh?"
                exit 1
            fi
    else
        echo "Not pushed to git repo!"
    fi

What does compile.sh do?

The compile script just takes all the markdown files and uses pandoc to translate them into LaTex documents. In the next step all LaTeX documents will be concatenated into one “big” LaTeX file in the given order. Finally the LaTeX file is typesetted and a pdf file is written as output.

In the case that the user supplies two command line arguments, with the first being “push” and the second being the commit message, the whole project is commited and pushed into a git repository for version control and backup purposes.