Export to LaTeX directly (including structure)


To date it is actually relatively easy to use MMD to produce LaTeX with Scrivener. However MMD is just not suited for hardcore LaTeX coding. Since this is what I do and I love to work with Scrivener, I think that writing directly in LaTeX and then compiling draft to a single tex file would be very nice. I know that I could just export to text files, but the structure of the document (folders/subfolders/etc. as sections/subsections/etc.) would then be lost.

Since Scrivener already provides the structure of the document to the MMD parser, I think this shouldn’t be too difficult to do : the only thing would be to convert the hierarchical level to a \section{title}, \subsection{title} or \subsubsection{title} command.

Anyway, I’d like to know what you think of it, and if you just don’t have time to program it, could you please just explain me how Scrivener sends the content to MMD so that I can write myself such a parser ? (I would then be glad to give it away).

Thank you very much


Hi Felix,

Actually, I’m thinking that this should be relatively straightforward in Scrivener 2.0 when it comes out. If I understand correctly (and please say if I don’t), all you would need is a plain text export which allowed you to place markers around the title telling it what subsection it is etc. In Scrivener 2.0, you can add a title prefix and suffix depending on structural level, so you could set it up something like this:

Doc         \section{          }
- Doc       \subsection{       }
 - Doc      \subsubsection{    }
  - Doc     \subsubsubsection{ }

Up to however many levels you required (you could also specify different prefixes or suffixes for folders or text containers, or have them the same).

So with 2.0 you should be able to set up your own Compile settings that will do exactly as you wish.

The problem, however, would be footnotes and annotations - but if you used LaTeX syntax for them anyway rather than use the Scrivener bubble-mark-up, everything would work fine.

All the best,

Hello Keith

This is exactly what I need. I’m now eager to see that new version ! :smiley:

Best regards


I would just like to second this feature request, and add: it would be great if this was paired with a feature to import tex files as well. Again, only parsing through the chapter/section/subsection-type tags to create the structure and leaving everything else as plain text. This would be fantastic for document collaboration.

Now, if there was a way to write a LaTeX syntax highlighting plugin… (Probably too much to ask, I know. Somebody make Keith’s next writing assignment a math textbook or something :mrgreen: )