Lists and MMD > LaTeX

When I use Scrivener’s Lists to make, umm, lists [e.g. a), b), c)], and then export, I don’t get any of the LaTeX list markers. When I simply type in “1. 2. 3.” I do.

Does the MMD exporter not support those lists which are non-numerical, or those lists which are made using Scrivener’s lists menu?

I believe you’re right–MMD will only handle lists you type manually. And I think it only supports bulleted (*) and numeric lists, but you’d have to check the MMD docs.

MMD supports the same lists that the original Markdown does. Specifically numbered lists and unordered lists. For details of the syntax, see:


The problem with RTF lists (which is what you are using) is that the standard RTF to text converter inserts a tab before the list item prefix. So it actually looks like This is a list: 1. Line one 2. Line two 3. ...

MMD (and Markdown) require the list item prefix to have nothing before it. I know, this is a pain because it would be nice if we could use OS X’s ruler lists rather than having to type the numbers in. The only solution is to either adjust MMD’s parser, or export to plain MMD first from Scrivener, and remove the tabs with a text editor before using the MMD file.

I won’t be changing the list parser, because that would interfere with code blocks.

Keep in mind that MMD doesn’t require the numbers to be correct, so the following is a valid list and will turn out ok:

  1. Do something
  2. Do something else
  3. And yet something else
  4. Don’t forget to do something

Right, I wasn’t suggesting MMD change to fit OS X, rather this one individual user could fiddle (at their own risk) to make the parser work with OS X.

One other thing to original poster: If you use TextMate, consider using the MMD bundle and the “Edit in TextMate” feature which lets you select a document in Scrivener and work in TM for a while. Saved changes will go straight into Scrivener. It makes list handling a lot easier! Among other things.

Gotcha… It wouldn’t be hard to do, but there would likely be unintended consequences that might be tricky, depending on how complicated your documents are.

I have no problem with hand-typing things in, or not using the RTF list maker; rather, how to (easily) get things like a) b) c). If there is no way than hand-coding the latex in, so be it.

I’ve been waiting for the new TextMate before deciding to take that leap.

Yes, it is either numbers or bullets., and currently there is no way to automate that short of customising MMD yourself and the XSLTs. That is, unless all of your lists are identical. Then you could handle them by duplicating the XSLT which turns XHTML lists into LaTeX lists. You could modify the LaTeX code that gets inserted, using whatever list format you preferred.

OK, so I’m trying to customize the file, so that I can type up my LaTeX code straight into Scrivener.

Like I mentioned above, I need to make a list that includes: (a), (b), etc. From my limited understanding of LaTeX, it seems I need to use the following command:
\item[(a)] blah
\item[(b)] blah blah

I’m having a hard time getting the .pl file to preserve my \item[x] commands. Simply modifying what’s already in the file of other examples, I’m getting the following result in my output:
$\backslash$item[(a)] blah

Anyone know how I should modify the following code to get the result I need above?

$data =~ s{ \$\\backslash\$(item.*?) \\\{(.*?)\\\} }{ "\\" . $1 . "{$2}"; }egmx;

Thanks in advance.

I’m not sure why you’re messing with for this. As mentioned in the header, this utility only affects citations (e.g. in academic papers).

You need to change the clean-text.xslt file. But in fact, I have already done this. The clean-text-allow-latex.xslt should allow LaTeX commands to pass through unharmed (though I have not tested this overly extensively).

Change any reference to clean-text.xslt in the XSLT stylesheets you use to reference the allow-latex version instead, and see if that works for you.


Thank you!

The messing with was how I allowed for custom LaTeX commands six months ago when writing my thesis. It seems things have changed since I last used Scriv+MMD+LaTeX extensively.

Thanks again, Fletcher!

Let me know how it works out - like I said, I haven’t tested this too extensively…

It’s working well, so far. :slight_smile:

How does one get the Edit in TextMate working in Leopard?

[Edit: Figured it out. Sorry.]

It works fine for me with Tiger, but I have not yet upgraded to Leopard. And I installed this feature so long ago, I don’t recall any specific tricks.

My own (brief) info on this is here: