Latex workflow/FAQ update

I have been looking at Scrivener for quite some time, and the other night I downloaded it to try it out. As a first impression: the corkboard seems really nice and the full screen mode is brilliant! Not sure what to do about my workflow I scanned through all the 47 pages that was the result when I entered “latex” in the forum search box, but I must admit I am still confused.

Could someone who is actually using Scrivener with LaTeX collect their wisdom in one or two answers in the FAQ?

There’s MultiMarkdown, which seems to only produce documents from a certain classfile. Since conferences and journals often have their own this seems quite inconvenient. There is also the problem of learning MultiMarkdown, which doesn’t seem much like LaTeX at all. There was a script floating around, that you connect to a folder action, and then … wha? I am still confused about handling figures and equations in general.

My current experiments are simply to type the latex and export it as plain text. I tried putting the chapter/section as a note on the folder and put the text in text notes, and then export that; but alas, there seems to be extra junk inserted by Scrivener whenever I export it as plain text. I am not too fond of post-processing things: the whole idea is that the software should make my workflow easier, not force me to write buggy scripts.

Perhaps an export raw format could be put in? No extra tags, no frills, just dump whatever text there is without any tags what so ever. I think this would make Scrivener get out of the way and help as much as possible for the writer that is working in latex. It would also be non-intrusive for other writers, they simply continue to export to the format they are currently using.

Scrivener shouldn’t add anything to the plain text export unless you ask it to. You may need to go through the Compile Draft settings to make sure nothing is getting changed or inserted there. So typing everything as LaTeX then exporting as plain text should be fine if that is what you want to do.

You aren’t limited to using one class file with MMD in Scrivener, either. The MMD tutorial in the Scrivener Help file should help you there, with how to use a different class file and so forth (there should be some information on it in the MultiMarkdown section of the forum, too).

Hopefully one of the users who use LaTeX will be able to give you a more informed answer on workflow, though.

All the best,

Right, make sure you are using the plain-text exporter in the top section of the list, not the LaTeX option is the MMD section of the list. Yes, that latter one will make a huge mess of your file if you try to pipe a raw LaTeX file through it. The only additional material that Scrivener adds to plain-text files are located in the matrix of checkboxes above the export format drop-down. Make sure only the Text row is checked off for all three types (assuming you want all three types to export content). The Titles option should be disengaged as that will insert Binder titles into the document. Presumably you’ve already typed in your section titles by hand using the appropriate title flags. In the second tab, make sure only newlines are being inserted between sections.

Keith is absolutely right. While the default configuration of MMD is set up to allow “one-shot” LaTeX files for people who needn’t know a shred of LaTeX beyond which applications to use to generate a PDF file, that by no means indicates that it is entirely without flexibility. In fact, it only produces LaTeX files via its flexibility, and could just as easily be instructed to write troff files, or wiki documents. Changing a class line or adding / subtracting preamble options is quite simple in comparison.

I’ve only been using Latex for the last six months or so, and probably wouldn’t have considered it without the MMD export built into Scrivener.

At bottom, MMD does all the grunt-work of working from Scrivener into Latex. I get all the manifold benefits of working in Scrivener, and can then export a Latex file which I can then tinker with in TexShop. As you have found, that export process can be automated with a script: personally I haven’t got that far yet.

The MMD export translates your Scrivener project structure straight into Latex: all the chapters, subheads, subsubheads, they all get carried across and compile properly. You don’t have to learn any MMD to get that to work. And, for day to day use, there isn’t that much to learn. Probably figures and tables are the most complex, but even then, the syntax for linking an image in your Scrivener project into your Latex output is a lot less to type than the Latex commands which MMD will then generate for you. MMD will also handle cross-references quite easily, although in my experience it gets thrown by more complex tables.

The default Latex class MMD works to is Memoir, but there scripts for other classes, including Article. Also, you can modify the standard scripts to match any project-specific Latex requirements, and decide within Scrivener which script you want to use.

Overall, the USP of the Scriv–> MMD --> Latex workflow is that you focus on the words in Scrivener, get them right, then export to get the final layout sorted in Latex. Which is, of course, the main Scrivener USP.

Mr Gruff

I think this explains my problem. I was trying to hijack the document notes for the folder/text to have my sections/subsections, and the output when I compile draft and include the document notes is:

Text on folder here


This is a text for Keith.[/code]

It was to get rid of the “Text” and “Notes”-tags I wished for an export raw. (For my current experiments I have chapters as folders and each section in them in text notes, and when working with the text I might have several text notes for quickly moving things around).

I am not trying to criticize your workflow, if it works for you that is very good. The problem I see is that you are essentially getting a staged workflow, where you write all your “text” first in the master source (Scrivener), and then tweak your equations separately afterwards. My workflow is rather the opposite, tweak equations first, then write the text that explains them.

Amber recently pointed out a way to combine straight Latex with the advantages of MMD and Scrivener’s binder and other tools. See the MMD thread “Trying to insert raw latex following FAQ”.

That way you can write your equations in Latex first, then split into sections etc. and use the rest of Scrivener’s tools + MMD’s conveniences to fill in, re-factor etc.

You can change much of the generated Latex, specially things like preambles before \begin{document}. I was nervous about doing this just 2 weeks ago, but it was not bad at all. Just put your MMD files under source control first :slight_smile:


How about using latex-snippet.xslt? You can put the preamble and the appendix into folders, which makes it easy to surpress the titles in the LaTeX output:

Bild 1.png

Bild 2.png