I started with LaTeX quite some time ago, but now, for my Master's thesis, I wanted to go simpler. Plus, I would like to have a simple conversion in a .docx format to share the work with colleagues for revision, which is not that easy with plain TeX. Two tools came in my mind when I thought of this: markdown and pandoc.
I am already using markdown for this blog and for reports with rmarkdown in R. I am familiar with pandoc to export map widgets from rleaflet and for report conversion from markdown to pdf, docx, html and so on. Therefore, I started looking on the web for templates that I could use for this.
There are a few out there, in particular:
- Using markdown + pandoc to write my biology PhD thesis
- How to ditch Word
- Plain Text, Papers, Pandoc
- Using Markdown Like an Academic
... and of course, the best one:
Based on his framework and the inspiration of the others I mentioned before I created my own Markdown+Pandoc workflow to write my thesis and convert it in various formats. I thought I would put my workflow and example template out here, in case anyone is searching for how to write their own thesis in Markdown+Pandoc.
Why Pandoc and Markdown?
Pandoc is this haskell library that makes miracles of text happen.
Got a .docx and need .tex? Done.
Got a .md and need .epub? Sure that.
Got a .tex and need Reveal.js slides? No problem.
Pandoc is able to do all of these things—easy-peasy-lemon-squeezy.
"[...] is a great format to use because (1) it can be read by any computer or device; (2) it’s future proof, since computers will always be able to read it; (3) it can be synced to all your devices; (4) it can be converted to virtually any format."
Imma install all this…
... and assuming you are Debian/Ubuntu.
... for PDF export we also need LaTeX:
We choose a full installation and create the textfile /etc/profile.d/texlive.sh afterwards with the following content:
We need python for Tom Pollards framework:
At last, a good text editor is missing. I think Sublime 3 is a decent option for this. It offers many Markdown related packages, code completion, nice themes, [insert random awesomeness] and most important: Distraction free mode, essential for writing a thesis and not spending too much time on the interweb.
Changes to phdthesismarkdown
As I mentioned before, I built this template on the framework of Tom Pollard. Most changes I've made to it concern the layout of the PDF export. I've made minimal changes to the makefile to improve the PDF export (IMHO).
I will invest some time in the future to improve the docx export, when I find the time.
- Edit the files in the 'source' directory
- Use the Makefile (make, make pdf, make docx, make html, make tex) to update the output files
... done. Very convenient, isn't it?
If you consider to change the layout of the PDF export the following files are relevant for you:
- ... for basic settings, like we are used to from normal LaTeX projects.
- I would recommend that you only alter this file if you are an advanced TeX user. Otherwise, stick to the preamble.tex.
- ... which controls the citation style. Other styles can be obtained from http://citationstyles.org/.
It is a really enjoyable workflow to write a thesis this way. I am hoping that this will make future collaboration in writing a little bit easier, without switching to Word. The style is a wild mix of layouts I used in the past years for my term papers and could easily be adapted. If you have any suggestions on how to adapt it, let me know.