When I compile to LaTeX I’m getting the above in my TeX file for my BibDesk references, instead of just \citep{Green:1989aa}.

What am I doing wrong, or what do I need to check / uncheck in the compile settings?



What does a typical snippet look like when you compile to plain MultiMarkdown? Could you paste a paragraph with a cite into a code block here, including the citation cross-reference line at the bottom of the file?

It looks good in plain MMD:


Compiling to LaTeX it looks like this:


The plot thickens.

Put the citation inside comment markers:

<!-- \citep{Green:1989aa} -->

The problem is that the translation to LaTeX is trying to preserve those characters. LaTeX gives special meanings to backslash and curly braces, so text that uses them as normal characters has to go through those gyrations. Putting the cite inside a comment tells the translator to keep the text as is.

Yup, that’s the problem then.

What some people like to do is use the compile option pane, Footnotes/Comments, and set inline annotations enclosing markers to “”. If you don’t use the feature for anything else, you can then use inline annotations to mark out all raw LaTeX and save yourself from typing them in.

But, if you’ve already written 300 pages with cites all carefully typed out, consider using the Replacements compile option pane to clean up the problem. Create a replacement with the following rules:

Replace: \citep{$@}

That will search for “\citep{”, and when it finds it, it’ll scan forward to the first instance of “}”, capturing everything in its wake. It then uses the replacement with pattern to stuff the saved string into the new enclosing text.

If you do use inline annotations for other things, then that technique should provide you with a good way of handling this in the future. If \citep{ just rolls off your fingers then maybe that recipe is good enough, but you might want to simply it further with “{{$@}}” or something, in the future.

Thanks Guys.

In the future I’ll redefine BibDesk’s cite command to something without backslashes and other LaTeX markers for my ‘drag and drop’ referencing and address the problem at the source.

For now I can do a find and replace, or replace during compile phase as you’ve suggested.

Your input is much appreciated,


Just FYI - here is the appr. section from the MMD User’s Guide - can be found at fletcher.github.com/peg-multimarkdown/:

To use BibTeX in a MultiMarkdown document, you need to use the BibTeX metadata to specify where your citations are stored.

Since natbib is enabled by default, you have a choice between using the \citep and \citet commands. The following shows how this relates to the MultiMarkdown syntax used.

[#citekey] => ~\citep{citekey}
[#citekey][] => ~\citep{citekey}

[foo][#citekey] => ~\citep[foo]{citekey}

[foo][bar][#citekey] => ~\citep[foo][bar]{citekey}

[#citekey;] => \citet{citekey}
[#citekey;][] => \citet{citekey}

[foo][#citekey;] => \citet[foo]{citekey}

[foo][bar][#citekey;] => \citet[foo][bar]{citekey}
Definition Lists