Can't figure out why MMD or Scrivener is doing some things.

I am trying to output my scrivener file for a v. large research paper to LaTeX. I have a bunch of anomalous things going on, and I wonder if people can help.

  1. Rather randomly, I am getting typewriter/monospace text in the middle of lines, sentences, paragraphs. I haven’t indicated in the source that I want anything changed, but MMD changes it over (I checked by making a plain MMD doc). It seems to occur with double quotation marks. That is, the open double quote (") turns \texttt on and the next open quote mark turns it off. Are there solutions? This does not seem to happen consistently with every occurrence of an open quotation.
  2. With lists (enumerated and not), I’ve designated them as such in the editing window in Scriv, but they do not come out in latex (the lists seem properly formatted in MMD—a number followed by an item. In the generated latex, the list just gets surrounded by verbatim tags.
  3. Funnily enough, even though it’s not “supposed” to pick up \citep and all that, it seems to be doing so.

My meta-data settings:
Base header level: 2
Latex XSLT: article-natbib

Check for backticks (“`”), as these are used to indicate code spans in a paragraph. If you have whole paragraphs that are in a code block, then check for tabs or 4+ spaces in front of their lines as that will indicate code block mode. If you are using backticks like LaTeX quotes, there’s no need to do that as MMD will handle the conversion from regular straight-quotes to the correct LaTeX quoting'' methods. If the problem is wide-spread, you could use Project Replace to go through and change to " and then after that, single backticks to apostrophes.

The rich text list feature in Scrivener needs to be used with care. I never use it—I just type in the list syntax by hand, especially since numbers don’t matter. If you do use the list feature, make sure to not have full whitespace translation turned on in the Text Options compile pane, or if you need it for paragraph spacing, disable the indent parsing so it just handles paragraphs. Since lists are indented by the rich text engine, if this option is on Scrivener will convert the indent to tabs, thus turning the sequence into a code block by MMD. This might be in part a solution to the above, if you have random paragraphs popping into code mode. It won’t explain inline code spans though.

For bullet lists, you’ll also need to use Custom and set it to an asterisk instead of the bullet character, which MMD does not recognise by default.

Ah, the open quotes thing proved to be the problem. Once I changed `` from some old LaTeX docs to " the problems went away.

With lists, you’re right that the RTF formatting in Scrivener fouls things up for MMD. I also discovered that to get correctly formatted LaTeX, one needs to separate the list in the same way you’re separating paragraphs. So, for example, I separate my paragraphs by inserting a blank line between each one; the list needs to be separated from the rest of the text in the same way.

My overall solution is to have Scrivener output a latex-snippet (the XLST meta-data setting) and then call that in a contained document via an \include command.

That is correct. Lists are considered to be a “block level” element in MMD, and so thus require a clear space around them on the top and bottom. The only exception to that is list continuations. If the block following the list is more list lines, then it will all be combined into a single list. This is mostly useful when using multi-paragraph list lines, purely for your own sake of readability, because of the way you need to space out a second paragraph, like so:

*   Line one
*   Line two

    Paragraph two of second list line

*   Line three

This is all one list, with the second line featuring two paragraphs. To my eyes, bringing list line 3 up beneath the second paragraph looks awkward.

That’s a good direction to be moving in. The next version of MMD will act much more like snippet mode, and have a heavy reliance on \include commands.