Guide To MultiMarkdown and Scrivener

The first version of a tutorial/guide/whatever to using MutliMarkdown with Scrivener is on my web site.

I welcome suggestions on how to improve this guide. It’s definitely a work in progress.

Of note, a pdf is included that shows what the LaTeX -> PDF output looks like in the memoir class.

Also, the MMD documentation on my site needs some updating for version 2.0. The version included in Scrivener is newer than what is available elsewhere, and things haven’t been updated yet.


Hey, it is looking good. I like how it can be exported straight into a PDF. Here are a few things I noticed:

  • In the section on organisation, you might wish to mention that this requires setting up the export pane to include titles for groups and documents. The way it is phrased right now, it sounds like an automatic feature, when in actuality, the Scrivener default is to display titles for groups, but not documents. Likewise, when using manual headers, this feature should be turned off in export.
  • Nowhere is it mentioned that Scrivener has the ability to convert its own internal footnotes and annotations into useful MMD compliant format. Perhaps include a few examples in different colours to demonstrate what the result will look like, in the PDF.
  • Also among Scrivener’s built-in features, it will format meta-data, notes, and synopsis into a pleasing arrangement if the user wishes these to be exported.
  • In the section on exporting to a raw MMD file: It might be good to caution the user that Scrivener is using the latest version of MMD, and that all of the features (such as XHTML Header), may not be available in other distributions, particular those embedded in software like TextMate, and webblog applications.
  • Add a short caution in the TextMate external editing section that doing this will “flatten” Scrivener style footnotes and annotations, if they are in use (actually, I haven’t tested this myself because I do not have TM set up that way, but I am pretty sure it is just taking the visible text and doing an internal copy&paste, and if it does that, annotations will get placed in brackets, and footnotes will become un-MMD compliant end-notes).
  • In the introduction, mention is made of “one exception” to the MMD does not honour RTF formatting – but this is never followed up on – at least not that I saw.
  • While it dips a bit into MMD syntax, it is a difference big enough to probably warrent mention somewhere: Paragraphs need a full space between them. People accustomed to WYSIWYG style editing use formatting paragraph spacing or indenting to set apart paragraphs, not a full double-carriage return.
  • Lastly, you left some stuff in the trash that you might wish to delete. :slight_smile:

That is all for now!


Maybe also some tips & tricks to using the default memoir.xslt. I don’t mean anything intense like LaTeX tweaking, but while I was digging around in the XSLT, I noticed that it has some smart features like formatting epigraphs a certain way. That one in particular looked like something designed to “just happen.” If you have a block quote immediately following a header, it catches it – but most people wouldn’t know it does that.

Another quick note on b3’s use of memoir.xslt: On my Mac’s 10.4.7 fink installation of pdflatex, I get an error with the usepackage for ifpdf. Commenting it out causes things to build fine.


Thank you for the feedback. Will be working on “version 2”.


To avoid repetition of work, this goes in the MMD documentation, and in fact is already there:

If you do that, then you lose some of the pdf features, I believe.

This needs more testing. I am not sure that ifpdf is required, but it is certainly beneficial to allow the latex source to be used to create a pdf, or to create other output types. I’m not sure, however, how often anyone uses it for something other than pdf.

MacTex does include ifpdf.sty by default, and it (ifpdf) is easily downloaded from CTAN.

I’ve been trimming down the package requirements, and I believe it will compile on a default MacTeX install, without installing additional package. I’ll see how strongly I feel about requiring ifpdf.

Here’s what I’m getting, after installing MacTeX 20061015 (this error is identical to what I was seeing before from Fink’s tetex installation):

This is pdfeTeX, Version 3.141592-1.30.4-2.2 (Web2C 7.5.5)
entering extended mode                                                                                                           
LaTeX2e <2005/12/01>
Babel <v3.8d> and hyphenation patterns for american, french, german, ngerman, b
ahasa, basque, bulgarian, catalan, croatian, czech, danish, dutch, esperanto, e
stonian, finnish, greek, icelandic, irish, italian, latin, magyar, norsk, polis
h, portuges, romanian, russian, serbian, slovak, slovene, spanish, swedish, tur
kish, ukrainian, nohyphenation, loaded.
Document Class: memoir 2002/11/22 v1.3a configurable document class
mempatch.sty 2003/10/06 v1.8a Patches for memoir class v1.3a
)) (/usr/local/teTeX/share/texmf.tetex/tex/latex/layouts/layouts.sty)

Stock height and width: 794.96999pt by 614.295pt
Top and edge trims: 0.0pt and 0.0pt
Page height and width: 794.96999pt by 614.295pt
Text height and width: 586.0pt by 397.0pt
Spine and edge margins: 108.405pt and 108.405pt
Upper and lower margins: 108.405pt and 100.56499pt
Headheight and headsep: 12.0pt and 24.0pt
Footskip: 24.0pt
Columnsep and columnseprule: 10.0pt and 0.0pt
Marginparsep and marginparwidth: 17.0pt and 51.0pt

Style option: `fancyvrb' v2.6, with DG/SPQR fixes <1998/07/17> (tvz)
No file fancyvrb.cfg.
) (/usr/local/teTeX/share/texmf.tetex/tex/latex/oberdiek/ifpdf.sty

! Package ifpdf Error: Name clash, \ifpdf is already defined.

See the ifpdf package documentation for explanation.
Type  H <return>  for immediate help.
l.132     }
? x
No pages of output.
Transcript written on Untitled.log.

Just a quick note: After rerunning texhash and updmap, all of my problems seem to have gone away.


This is just to say
I have gotten
the error message
that JWiegley
had posted

but which
I had myself
having installed MacTex

forgive me
! Package ifpdf Error:
Name clash,
\ifpdf is already defined.

If you like, you can email me your file and I can try it out. I have never had this error before, and you can tell from above that ifpdf.sty is installed. I would need to see the source and play around to figure this one out.

My email address is fletcher with the domain freeshell and org.

Good - let me know if there are other issues.

Cruxdestruct - let me know if this doesn’t fix your problem as well.


I get this problem too, unless I use the TextMate embedded command Typset & View. For some reason, that renders everything without gruff. Or maybe it does and TM just has things set up to auto-accept errors. In TeXShop, you can dismiss the error manually, and obviously on the command line, too – and it will still generate a PDF.

From a conversation in another thread. There is a condition that can create invalid XHTML in Scrivener, when using annotations. If you have carriage returns inside of an annotation, the end result will have

open and closing tags inside of the span element that defines the appearance of an annotation. In XHTML, and HTML for that matter, you cannot have block level elements starting and stopping inside of an inline element.

There is no easy programmatic work around that I can think of, so given the somewhat less “direct” approach in annotations (technically, it should be viewed as syntax like anything else, but because it looks pretty, it can be easily forgotten that it is syntax), a word of caution should be given to users so that they know annotations and carriage returns shouldn’t be mixed. If they really need to create a new line, double-spacing will be necessary.

I got the same ifpdf error as above, so I ran texhash and updmap as suggested, but I still get that error when running pdflatex on the .tex file generated by MMD/LaTeX export.

This is on a fresh (~10 minutes old) totally unmodified MacTeX install.

Yes, a quick update: Shortly after my problem went away, it came right back again. I have no idea what I did to resolve it, and have found no way to make it go away since.

Since my output target is pdf, I just manually remove the usepackage for ifpdf, and then I remove the \ifpdf so that its contents are always there.


I’m happy to take a look if you send me a sample file. But I have been using this ifpdf syntax in my tex files for over a year now without a single problem, and that is with pdflatex installed by Fink and with MacTex.

Without a test file, I don’t have much else to offer right now.


I might have figured this out.

MacTeX ships with an older version of memoir that seems to have trouble with reloading ifpdf.

If you delete the line:

\usepackage{ifpdf} % For pdf stuff…

Does it work for everybody? You should be able to leave the rest of the ifpdf stuff intact.

I updated my memoir class. The one that shipped with my distribution was hideously old! After updating, this error has gone away.