LaTeX, .doc, Bibdesk integration and workflow

(This is a cross-post from the Mac Technical questions forum, but I thought folks in this forum might know also. Mods, if there’s one forum that would fit better, please feel free to delete from the other.)

Hi all,

I have a workflow question that I hope people can help me with.

I do most of my writing in LaTeX format, but I occasionally have need to wok with other collaborators, who (of course) use Word or some other such foolishness; this is one of the reasons that I want to do more work in Scrivener. SO my workflow in the past has been to write in TeXShop, do bibliographic stuff in BibDesk (which is a front-end for BibTeX) while using the natbib package (so I can get Chicago 15 style references), and output to PDF.

I’m trying figure out a way (and more importantly SETTINGS) to be able to do my documents in Scrivener, and to output a .doc (or whatever) when needed, but also to output a .tex file. So a few problems present themselves.

  1. How should I deal with bibliography stuff?
    I have been inserting natbib commands like “\citep{jones 2003a}” into my files as I write them. When I go to output to LaTeX, however, the Scrivener interpreter turns this into “$\backslash$citep{jones2003a}” (turning all the control/language command characters into literal characters to print). I’ve found the stuff to do inserts like “[jones2003a][]”, which I think would work with latex docs. (That is, I understand that MMD will see these and turn them into \citep{} commands. And it seems to work in rudimentary tests.)
    So, Should I keep using latex cite commands? Or should I move to the MMD citation format?
  • What should I do in the RTF/.DOC direction? With such files, I have no idea how to turn a reference like that into the proper citation and make a biblio entry. Is there perhaps an Applescript or something (or it someone proficient in these things?) that could be used here? That would turn this into a citation format that can be picked up in Pages, or Word, or TextEdit? (For example, there’s something (I think) kind of like that at

[*] The LaTeX output is in memoir class with all these resettings of defaults. (See below.)

I really don’t like memoir class, and I don’t want to re-do all the defaults typographical settings for sections and such. How can I just use something simple like article, with default output?[/*]

I think that’s it for now! =-) I’m sure I will have more questions later.

I have been using to get my citations from scrivener into latex. It works, most of the time.
When you have a text where you are putting loads (10 citations per paragraph), it kind of drops the text and only leaves the citations.

The output only has the citations without the text “around” them. This only happens when i compile the whole document, when i only compile this paragraph with the citations it works without a problem…

could anyone help me here?


Hi napaxton,

I’ve been using preset replacements in the compile settings. I just add create a preset (i.e. “to LaTex” or “to doc”) and then I add a replacement that will search for \cite{$@} (this will recognize anything in between the curly brackets and for a replace I type in and this seems to be working for me. You can then change \cite to \citep if you’d like.

I use this method because I drag my citations directly from a program called Papers and it then inserts these as bibtex citations (if you specify so in the preferences, of course).

I haven’t experienced the problem Blindy describes but then again I haven’t had a document with more than two or three citations per paragraph.

I hope this helps,


Regarding your bibliography, I have changed the XSLT file for MMD (in the folder you should have copied to Applications Support – check that you have a recent version of MMD, too). The files have changed since I did it (I think), but the lines are now located in the clean-text file.

Anyway, you need to correctly change these lines in the file

</xsl:with-param> <xsl:with-param name="substring"> <xsl:text>\</xsl:text> </xsl:with-param> <xsl:with-param name="replacement"> <!-- Do not correct backslash (orig. $\backslash$ ) --> <xsl:text>\</xsl:text> </xsl:with-param>

I modified the line before last, it goes without saying. Also note there is a file called clean-text-allow-latex, which might to just what you want, if you just select it in your main XSLT file.

That should prevent the replacement of backslashes by the LaTeX expression to generate a backslash character… at least it does for me. I do not currently export to Word (though the question will inevitably arise as some people do use this nonsense), but I think you should try to export your latex expressions and use a script to replace them with your citation (I think there is one in BibTeX).

As to the memoir class… well, there are a few other thesis classes (look for them in the TeXlive manager or on, but memoir is really nice and flexible… The documentation is quite well written too, so you should be able to find out what you want by looking up the right section. I do not recommend using an article (or memoir with the article option) class for a thesis, as you will need more subdivisions than they offer.

This is something I struggle with too (and I don’t have any solutions, yet).

I’m in exactly the same situation: most of my output is LaTeX, but along the way, various supervisors and reviewers will want a Word (.doc) version.

My current workflow is to write MMD in Scrivener, export as plain MMD, then convert to ODT, open in LibreOffice and save as .docx.

This works great for everything except references. I write natbib references using the MMD syntax (p. 26 of the manual). So [#citekey] for \citep and [#citekey;] for \citet. Most of the time, this isn’t too much of a problem – my supervisors can just learn to overlook the [#citekey] syntax (it’s certainly far less obtrusive that , which is what I was using before). However…

What the solution to this would look like…

Ideally, I’d like to find some bibliography software (e.g. Sente, Bookends, Endnote) for which the ‘RTF scan’ citation delimiters were the same as the MMD citation syntax. In Endnote, for example, the ‘temporary citation format’ is curly brackets, for example:

{Morehouse, 1993 #125}

Zotero supports a number of other styles ( If I could find a bibliography manager that used the MMD citation format as it’s temporary citation, my workflow would be:

In the meantime…

I haven’t yet found such a piece of software. The closest I’ve seen is ‘BibDesk to Word’ ( – a set of applescripts that format BibTeX citations in Microsoft Word and adds a sorted bibliography (if you’re using , this approach might work for you).

When I find the time I’ll have a closer look at the ‘Bibdesk to Word’ applescripts, to see how feasible adapting them to use the MMD syntax would be. Until then my supervisors can just get used to seeing [#citekey] everywhere :slight_smile:

The script Ewancarr is referring to must be the one I have seen. Then you just need to tweak your XSLT files to let you use LaTeX in Scrivener, and convert the cite keys to normal citations.

Another solution might be to output everything to LaTeX and then use the TeX4ht package, which can export to HTML, OpenOffice, etc., all of which can be converted to a .doc file. The main issue is that your footnotes will become endnotes (but maybe this is still the same when you export to Word from Scrivener ?). There are some things it does not support too, like issues in XeLaTeX, and I do not know how it handles equations unless you enter them as pictures (don’t see too many of them while writing about law). Other than that, you get everything as it was in LaTeX, except the paragraphs look as crappy as your average Word document, which was the whole point of the exporting process, I am sure :D.