Scrivener 3 on Windows: Producing unwished metadata in .tex output.

I love to produce my documents on scrivener and to post-process them with LaTeX into excellent PDFs. My workflow on Scrivener 1.9 requieres absolute plain texts where the .tex file only contains such. For this I simply comment out the whole text on Scrivener in a block, [code]


Additionally I can choose to not generate IDs attributes in the header in the meta-data settings in the compiling settings. The result is perfectly clean text which also contains my necessary markups for my particular LaTeX packages later. Full functionallity, easy workflow, happy user.

Scrivener 3, unfortunately, won’t allow me to save a plain text. There is no way,yet, to remove the \def\mytitle{} , the \def\myauthor{} , and the final \end{document} tags. No offense, but these tags are polluting my .tex file.

Will there please be a way again to simply generate plain text without any tags, saved in a .tex file? That would be great, otherwise I would find the development of Scrivener somehow degrading.

The only place where Scrivener generates LaTeX code is with its “General Non-Fiction (LaTeX)” project template, which isn’t in the beta yet. But in that case you have complete control over how the compile format works; there are no special features in Scrivener that are aware of LaTeX as a syntax or system. To see what Scrivener itself produces from your project, use the plain “MultiMarkdown” option and examine the text file. Do you see the codes you refer to anywhere in here? That’s a good general rule of thumb for figuring out which set of documentation to look at.

What you are looking at here is MultiMarkdown output, the same sort you would get if you typed in your document into a .txt file and use mmd2tex on the command-line (or however that works on Windows). If you would like to customise how MMD works, you might have better luck on the MultiMarkdown discussion board.

Sorry I don’t quite follow what you mean here. To my mind, a plain-text file is what a .tex file is, just like an RTF or HTML files are plain-text, and I don’t know what a .tex file without code in it means. But hopefully you just meant what I was referring to above as a troubleshooting step: just use plain MMD from Scrivener if you don’t want LaTeX syntax in your file at all.

Ah! one thing you might be battling against: you may have been using an old version of MultiMarkdown before. We don’t mark raw LaTeX code with HTML comments anymore, comments are just comments now. A while ago I described how I make call-out boxes with LaTeX and MMD. There are some practical examples given a few posts down.

Thank You, AmberV!

Well, that’s sad. Look, what I wanted to say is that my Scrivener 1.9 is able to generate me

  1. a single file in .tex format. No other mmd-xyz.tex files are created.

  2. a file where I can write all in a commented-out-mode. This allows me to use my own markups. This is crucial because I cannot let mmd create my markups, like when I insert \italic{} it gives me \textbackslash{}italic{}. (The commenting out still works at least, although you say otherwise.) Anyway, I do want LaTeX-syntax, but not the mmd-generated. Scrivener 1.9 delivers that by commenting it out.

  3. a file which does not contain auto-generated classes and info. I don’t want the author info, the title etc. Because I handle everything about the LaTeX-structure in TeXstudio. The Scrivener output is only my text, with the necessary markups (which I only get by the commenting-out-trick).

Since Scrivener 3 will not support me this way anymore, it is out of question to make an upgrade for me. I am very happy this works with v1.9. Never change a running system! Never ever. v3 won’t work for me the way it compiles .tex files.

I understand that you are inviting me to a participation in the MMD movement. But I don’t think I will have the time for politics. Another saying in software design is Don’t make me think! According to that, I cannot think too much about my broken workflow in Scrivener 3, but I can happily use Scrivener 1.9.

v1.9 is a splendid piece of software which might become my sort of vintage application. A program which I will still be using in 10 years or longer because it works. And because I like it the way it is. I am no sentimental, and would give v3 a try. But definitely not under the circumstances of loosing one of its greatest advantages in text producing. Because everything concerning typesetting and typography, I handle with LaTeX and MiKTeX. Scrivener is only about content. Its connectivity to LaTeX the way I use it is precious to me.

And don’t forget my little trick of commenting out the text to be safe from the MMD-handling, and its auto-formatting. :smiley: It’s about getting one .tex file without anything else than my text and my markup.


Nothing has changed between 1.x and 3.x in this regard. The settings are in roughly the same place in version 3. Edit the compile format, and in the LaTeX Options format pane, set the document class to “None”. If you select a pre-built class here then yes you will get as many .tex files as it takes to build something easy to typeset in a vanilla looking fashion.

Important: at the moment that isn’t fully implemented yet in the beta, from what I can see. You still get a bunch of boilerplate in the output folder. That’s not intentional of course; it should be working the way it did in 1.x, but maybe that is what you are seeing if you have already done the above.

I’m not familiar with what you describe doing, but that aside I’d approach this particular problem with Section Layouts. Create a layout called “Raw LaTeX” or something, and add the MMD codes for passing through raw syntax to the Prefix and Suffix tabs. Then it is a simple matter of flagging items as code in the binder, using Types.

You want something like this as an end product, so the stuff before the binder item would go into the prefix, and the stuff after into the suffix:


Note the fence quotes need to be on their own line, so be sure to arrange for that in the prefix and suffix tabs. And for cases where you don’t need the entire file to be raw code but just a bit of text within it, Styles also have a prefix and suffix compile setup. I linked to several examples of how to comment out LaTeX code, and combine that capability with compile features, in my previous response.
a file which does not contain auto-generated classes and info. I don’t want the author info, the title etc.
I don’t think much as changed here with MMD in recent years. It’s entirely up to you whether you want that stuff in there, and nothing fundamental has changed in Scrivener, with regards to how it passes your settings through. It inputs any metadata you provide for the project, and MMD will then take those fields and turn them into LaTeX variables so you can use them elsewhere in the document. If you don’t want metadata then don’t use it. Version 3 has a metadata setup panel in the main project overview screen for project-specific stuff. It also has one in the saved format, which can be used to set up meta specific to the look & feel of the document. (We tend to keep these empty though, unless there is a strong reason to supply something, like shifting the base header level to 2 in the article format, where Parts are irrelevant.)

Also MMD has a built-in convention whereby if you exclude all document-level type metadata then it will simply process the provided content in a form designed to be pasted into a complete .tex file, or included from one. By document-level metadata I mean things like giving your file a [i]Title[/i], as opposed to metadata used for settings, like [i]Base Header Level[/i]. This is the so-called “snippet” mode.
I understand that you are inviting me to a participation in the MMD movement. But I don’t think I will have the time for politics.
I meant more along the lines of: if there is a way to disable this behaviour they might know better how to do so. I’ve never looked into it myself and have no idea how to, because like I said above: if I don’t want a particular piece of metadata in my file I don’t put it in—whether I’m typing it in by hand into a text editor or using the GUI in Scrivener, it’s all the same. And if I want no metadata I get a snippet file with no fluff.
Another saying in software design is Don’t make me think!
I’m maybe taking this too literally, but software that doesn’t make me think gets tossed and flushed from my system. The software that makes me think (like LaTeX) gets used for decades.
But definitely not under the circumstances of loosing one of its greatest advantages in text producing. Because everything concerning typesetting and typography, I handle with LaTeX and MiKTeX. Scrivener is only about content. Its connectivity to LaTeX the way I use it is precious to me.
I’m much of the same inclination myself. I use LaTeX for most things that need to look nice, and I have extensive bridging built between it and Scrivener, using MMD for the heavy lifting. To be quite honest I couldn’t imagine going back to the 1.x / 2.x way of doing things at this point. It’s just like you say, Scrivener is for getting the content together and glued up with whatever syntax it needs that MMD doesn’t do, and there so many better ways of doing that with the Section Type + Style system than there were in the past.

But nobody can convince you of that—if the old version works fine, then enjoy using it, it’s no skin off our back if you like one version of Scrivener or another. :slight_smile: I think it is a little premature to be ascertaining how well it works with Markdown though, as they don’t have all of that wired back up yet from what I can see, so maybe give it another try when it is out.

Thank you so much for your reflections again. Inspired by your encouraging notes, I have given it another try.

It works almost. But at any compiling initiation Metadata is added automatically. I couldn’t save it in my saved format. The two keys Title and Author reappear like ghosts.

Would it be possible for you to channel that to the team, that it could just be saved with My Format to have no Metadata Key at all? Are you in touch with the developers? Is there still some Beta processing wehre this could be issued?

Thank you again. We have come one step forward.

Yeah I think overall the rule of thumb is that the beta is good enough for daily work now, but compiling is still under construction, so you can’t expect that to be working right yet.

At the moment it looks like I can remove the Title and Author default fields from my project, but they pop right back up after I compile, so I have to remove them every time. However so long as I do remove them, I get a “snippet” style .tex file with no other support files in the compile folder (oddly enough, as I was getting a different result yesterday, I’ll have to look into that one a little closer).

And in case it wasn’t clear from my earlier description, the Format is not where this kind of metadata is typically specified, and certainly not by default. Any metadata going into a Format ought to be the sort that would be applicable to a dozen different projects. It’s an export template, if you will, not this project’s settings. So that is all the last place you would want to put something so very specific as a working title.

Yes, I write the user manuals and will be working to get this whole area up to spec during the beta. But as for what you can do, there is a beta forum that the is actively monitored and maintained. Don’t worry about the issues I’m bringing to light here in this discussion, I’ll investigate & report them.

Speaking of the user manual, you might want to grab a copy of the user manual project itself. It’s not going to help you much on the compile side of things, but you might be interested to see how a PDF like the ones you can download from the page for the Mac, is put together on the Scrivener side of things. The most important thing I see missing at the moment is the Section Layout prefix and suffix tabs, where some of what I do to compile this project will be missing.

Lastly, I wanted to return to your original post:

Do you mean to say that up until now you’ve been basically compiling using the MultiMarkdown engine, but then wrapping your entire text in an HTML comment so that MMD does nothing? That you are basically writing your own LaTeX syntax directly into the editor in all cases?

If so, why even use MultiMarkdown? :slight_smile: The only thing that’s giving you is conversion from Markdown syntax to LaTeX syntax, which you aren’t using from the sound of it.

Well you might like our LaTeX template once we get that finished. It was designed specifically for people that do not want to learn Markdown or deal with any conversion engines, and want to simply compose in LaTeX, using Scrivener like a fancy tex editor basically. The compiler isn’t ready for this template, so there is no sense in trying it, but I figured that might be something you would want to keep in mind for the future.