Scrivener - MMD 3 - Latex: A beginner's guide

At the moment I feel like a man who can barely tie his own shoe-laces getting ready to address the World Cobbling Convention.

Why so nervous? Because I have been presumptuous enough to write a beginner’s guide to the Scrivener - MMD - Latex workflow. It’s the sort of guide I would have wanted when I was starting out.

Feedback welcomed. In particular, if any one wanted to contribute a section on bibliographies that would plug a big gap.
ScMLGuide.pdf (301 KB)

Thank you. I started fooling around with this a few days ago and thought, wouldn’t it be nice to have an easy to understand guide for someone who does not have that much technical background. Then there it was…

This is a wonderful guide. I haven’t quite succeeded in generating a finished document yet, but I’m getting close.

One weird thing I’ve noticed: I set up the metadata as you describe in Figure 4.2 and compile (and save my compile settings), and when I re-open the compile menu to compile again, the metadata fields are all out of order. I’ve gathered that the order of the metadata settings is important. What’s up with this? Is there some way to freeze the metadata order?

– Wait – Apparently you’re supposed to put all the metadata in the first document of the project and title it ‘Meta-Data’. McGruff, maybe you should update your guide to for that instead of explaining how to put metadata in the compile options where it may get screwed up.

Anyway – I just succeeded in making a beautiful PDF! Thanks!

I read the guide last night – it’s very helpful (and amusingly written…) so thanks very much for taking the time to write it…

@Siegfried:
The strange re-ordering of the compile metadata certainly used to happen with Scrivener 2. I found I had to drag the author and title metadata to the right place each time, otherwise Tex found that mytitle and myauthor were being used before they were defined and the whole thing fell over.

However, with version 2.2 of Scrivener they seem to be staying where I put them, and that’s working without any problem.

I’ve never tried using the separate metadata document, so I didn’t write about it - I will put it on the list for v2. I’m hopeful we may see tighter integration between Scrivener and MMD3: it would be wonderful to be abe to include our MMD-header etc tex files in the Scrivener research folder and have them included as part of the compile, so they are ready in the right folder for typesetting.

@brookter:
Thank you.

Hmm. I left the support files (all the mmd .tex files) in the location they’re supposed to go in (~/Library/texmf/tex/latex/mmd), and multimarkdown had no problem finding them. I modified them in place there and that worked fine.

I’ve got Scrivener 2.2, so I don’t know what the deal is with the metadata reordering.

Also, I left a note to the other thread: as much as I appreciate your document, which I can unequivocally credit with finally getting me out of the morass of random, ineffectual tweaking, I do think someone (sorry I’m not volunteering) might want to put together a quick start guide that boils your document down to the specific required steps to get software installed and one project, with fairly common settings, successfully typeset.

Thanks again!
Sigfried

Many thanks for doing this…

Robert

How about this: rather than having a guide as a PDF, how about a Scrivener project which is ready to compile, just add MMD and Tex. The initial setup instructions would be in the first few documents, which would not be selected for compile.

The user can then get the document compiled and see exactly what’s gone into it.It can then also be used as a basis for experimentation.

(Now I need to go away and see why I can’t get the wretched MMD files to work when I put them where whey are supposed to be.

EDIT: Well, that’s what comes of over-thinking. When I actually do as I am told and put them in ~/Library … for my user rather than going to the system library, it works as it should. Another change for the second edition of the guide.)

That sounds perfect.

And if it works, then it should be the biggest, loudest thing that anyone sees when they are searching for help working with Scrivener->MMD->LaTex.

I applaud you in advance.

It’s 8:23 on Monday night in Oakland. I have been wasting hour after hour trying to get the perfect toolchain together for our technical documentation. Markdown, LaTeX, AsciiDoc, Pandoc, DocBook, XSLT, etc. etc.

I would like to say “screw all this” and use Scrivener, check the MMD into Github so my engineers are happy, and create awesome looking PDF’s via LaTeX. If your guide helps me, I’ll send you a pizza.

Stumbled here by accident. Here goes nuthin’ - I’ll report back to you in a bit. Thanks for writing it :slight_smile:

I like this idea. In fact, that’s exactly what I was looking for when I ended up here!

I am not sure this is the right place for my question, but given I am a MMD 3 - Latex beginner it sounds right. I have been trying to get automatic numbering of equations compiled using the \begin{equation} and \end{equation} commands. I used to be able to do this on the earlier MMD. Is there a way to have some equations automatically numbered and others not?

Thanks!

Edit: I found how to get automatic numbering of display equations (by adding Latex input: mmd-equations-mode in metadata) but this still doesn’t allow me to decide when to number certain equations. I figure I just need to do some more reading on use of these metadata documents but any help for a noob would still be appreciated.

I’m not sure that you can suppress numbering of individual equations at the MMD end of things: the rubric to the mmd-equations-mode file is clear it’s either on or off.

In Latex you could suppress numbering with an asterisk:

\begin{equation*}

so if you were putting your equations in as Latex blocks (hidden in HTML comments: ) then you could set that to suppress the numbering of an individual equation. Otherwise I think it’s back to tinkering with the tex file before typesetting.

I found your guide really helpful. It filled a gap between the manuals for Scrivener and Multimarkdown, and the reality of my situation.

I have been dithering between Scrivener and Latex half-heartedly for a year or more. Formatting a long document in Scrivener was just too much effort. Restructuring a complicated latex document was also nightmarish.

A week ago, having read in the Scrivener manual that I could do it all in Scrivener, I started trying to bring the two together. I couldn’t get it to work until I read your document. So thanks!

Using my version of Scrivener (2.3.1) it’s actually a bit simpler than you explain - for example I didn’t have to install multimarkdown, and compiling straight to pdf works, but until I read your guide I had nothing. Now I have a working Beamer presentation and I have managed to write a usable letter template. Thanks again

Andrew Derrington

Hello,

there is a way to get a bibliogrpahy using Scrivener together with BibDesk and MMD Markers like [p.][#Label]. BibdDesk Template will come in handy for a some what cite-as-you-write-expierence.

I have found several blogs who describe the process. For example have a look
here:

http://timbrandes.com/blog/2012/02/28/howto-write-your-thesis-in-latex-using-scrivener-2-multimarkdown-3-and-bibdesk/

or here:

http://neilernst.net/2011/07/27/writing-complex-latex-documents-with-scrivener-2-1-and-multimarkdown-3/

Thanks, I’ll check those out: I am working (slowly) on a second edition.

Hello,

you have written a really nice guide!

Maybe it is worth to add to the “Extras” section an alternative to the “MultiMarkDown Composer” there is a open source program called nvAlt which also has got a MMD live preview - although it is not as powerful as the Composer it might come in handy for beginner needs - and it is free of charge.

See: http://www.macupdate.com/app/mac/36277/nvalt

Edit: Another idea for section 3.5 Footnotes: Instead of using the MMD footnote tags you can use Scriveners “Add a footnote…” button - it will be recognized and transformed in a Latex \footnote{} command via MMD export.

Ok - this is not a project but it is my format for “Compile” from MMD to Latex. Be aware that I do not use the MMD-Meta data. Instead of this I use the Latex document class called “Custom”. There you find all my Latex presets (not all by me - some are copied from somewehre in the Internet.) Maybe this is a start for you to play around with Latex and MMD and Scrivener. For my workflow this “Compile Format” is quite good.

Please be aware to use this with caution - I will not offer any guarantee or reliable support. :wink:
But feel free to ask if there are any problems - I am still learning, too.
MMD to Latex (export).plist.zip (5.76 KB)

Hello,

I would like to use Scrivener to export into Latex via MMD ! But i can’t find ~/Library/texmf/tex/latex/mmd

I can find ~/Library/tex but no MMD ?

I’m on a mac… I used MacTeX to install TeX… I am really lost. I wan’t to precise that i did follow the guide and had installed MMD-Mac-installer and MMD-Support-Mac

thank you

It took me a while to figure this out, but, basically, you have to create the folders yourself.

So, in your user Library folder* create a new folder texmf (if it doesn’t exist – I can’t remember from whether you’ll find that one or not). Then in texmf create a new folder tex. Then in tex create a new folder latex. Finally in latex create a new folder mmd.

Then copy the latex support files into that mmd folder.

This is something I have made clearer in the draft of the second edition of my beginner’s guide.

Also, the texmf folder is where you would create the bibtex/bib folders if you are using Bibtex for references.

*And if you can’t see your library folder to start with: in Finder hold down Alt and select the Go menu. You can then see the Library and drag it to your favourites in the Finder window.