Installation guide for Mac OSX
One day, I thought, “Wouldn’t it be nice to have a Markdown to LaTeX converter.” Theoretically, one could combine these two tools to quickly create beautiful documents. That’s how I found Multimarkdown which is basically a souped up version of regular markdown. The documentation made it sound like this would be a breeze, but it actually took me way to long to get this to work on my machine. So I made a stepbystep guide.
For the uninitiated, Markdown is a simplified way of writing html markup. If you don’t know about it please check it out. It is in fact how this very webpage was created.
Then today I had to install it all over again on a different computer. To save my future self and you a lot of trouble, this time I noted what I did to get it to work (Mac OSX only).
Install a lot of software
First you must install homebrew the lifesaving Mac package manager.
1


Then you should install multimarkdown et al. by running
1


I’m not sure every one of those is necessary, but I don’t have another computer to test which ones can be left out. Probably at least the first one is necessary.
Now go to the Mac App Store and buy MultiMarkdown Composer for $12. Or don’t, it isn’t actually necessary, but I like that it liverenders LaTeX equations and has a hotkey for exporting markdown to different formats. You can export using the commandline too and that’s also quite simple (and free) (see below for script).
Install TeXworks. This is a gui for running LaTeX commands, and it’s free, but again you can use the terminal for anything you can do in here if that’s your thing.
Get the base latex installation and multimarkdown template files
Download the multimarkdown latex support files from github. And put them
in a (likely new) directory called ~/Library/texmf/tex/latex/mmd
.
Personally, I put the files in …/texmf/text/latex/… and that cost me a
halfhour of my life so do yourself a favor and just copy and paste the
following command
1 2 

Install mactex2013. For whatever amazing reasons, you can’t use homebrew for this. You have to go to that website, download a 4+ GB file and run the installer.
Create your first latexready markdown document
Now create a file Yayaya.md in Multimarkdown Composer (or Vim or whatever) and paste the following header at the top, verbatim:
latex input: mmdarticleheader
Title: Hello Dr. Fourier
Author: My Name
Base Header Level: 1
latex mode: memoir
Keywords: Math, DSP, Digital Signal Processing, Fourier Transform
CSS: http://fletcherpenney.net/css/document.css
xhtml header: <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeXAMSMML_HTMLorMML"></script>
copyright: 2014 My Name
latex input: mmdnatbibplain
latex input: mmdarticlebegindoc
latex footer: mmdmemoirfooter
That was just telling Multimarkdown how to format the LaTeX output. After that paste the actual contents of the document, e.g.
# Simpler LaTeXing #
## The Fourier Transform ##
**Sometimes** *this* formula comes in quite handy.
### The Formulation ###
What follows is the formula for the Fourier transform.
\\[FT\{f(x)\}:=\frac{1}{\sqrt{2\pi}}\int_{\infty}^{\infty}\!f(x)e^{iwx}dx\\]
Then go to file>export> "Export as: asdf" , "Format: LaTeX"
(or use the script below).
This should have produced the following raw latex file:
\input{mmdarticleheader}
\def\mytitle{Hello Dr. Fourier}
\def\myauthor{My Name}
\def\latexmode{memoir}
\def\keywords{Math, DSP, Digital Signal Processing, Fourier Transform}
\def\mycopyright{2014 My Name}
\input{mmdnatbibplain}
\input{mmdarticlebegindoc}
\part{Simpler LaTeXing}
\label{simplerlatexing}
\chapter{The Fourier Transform}
\label{thefouriertransform}
\textbf{Sometimes} \emph{this} formula comes in quite handy.
\section{The Formulation}
\label{theformulation}
What follows is the formula for the Fourier transform.
\[FT\{f(x)\}:=\frac{1}{\sqrt{2\pi}}\int_{\infty}^{\infty}\!f(x)e^{iwx}dx\]
\input{mmdmemoirfooter}
\end{document}
Open asdf.tex
in TeXworks (if you used the script verbatim, it will be in
~/Desktop/Latex
), hit the green “play” button in the topleft corner. A
bunch of garbage will pile up in the Console Output area, but then your
beautiful PDF will have been generated. This is just stellar, I’m telling you.
Now you can open the asdf.pdf
file in your favorite pdf viewer.
Bask in its glory
How about that. Hmm, indeed.
Comprehensive troubleshooting guide
If in the console of TeXworks, you get something like mmdarticleheader.tex:
not found
, it means you put the multimarkdownlatexsupport files in the
wrong place or you forgot to download them or something. Because I kept
getting that error message I was convinced there was some command I needed
to run to tell mactex that this new directory exists on my machine and
contains latex templates. Believe: there is no such command, mactex just looks
in this directory of its own accord.
Much simpler, use my script
1 2 3 4 5 6 7 8 9 10 

This assumes you have a directory on your Desktop
called Latex
. For now, I’m
comfortable just having that there polluting that desktop. If you’re not, you
can change LATEX_DIR
, or add something like the following to the script.
1 2 3 

You run the script like
1


and next thing you know, a Preview window opens with your beautiful document.
Then after you’ve made changes to the document, run the command again, and the new version will show up in the same window.