Selecting LaTeX typesetting and bibliography engines

Hi,

I’ve changed to using Texpad as my LaTeX editor and am very pleased with it, and use XeLaTeX and Biber for my documents.

However, now when I try and compile a Scrivener document using MMD -> LaTeX and open the resulting .tex document in Texpad, it defaults to the built-in Texpad typesetter and bibliography engines, and the document fails to compile.

Is there any way to set XeLaTex and Biber as the typesetting/bibliography engines via Metadata/LaTeX options in Scrivener? I can find very little help with regard to LaTeX setup in the Scrivener tutorials, and am usually on the verge of abandoning Scrivener and going back to LaTeX alone as everything always seems so difficult to get working, and breaks every time there’s a Scrivener upgrade :frowning:

Thanks,
Emma

If I understand you correctly, surely that is something you need to adjust in the software you use to edit .tex files—default settings or something? In TeXShop you have to tell it you want XeLaTeX for instance. In most cases .tex files cannot influence how a GUI works, unless the GUI has been specifically programmed to take certain cues from the preamble. I’d say MultiMarkdown’s .tex files are even more so that way, at least by default, as they have no preamble for an editor to even try and guess at what it needs. It’s been that way for many years, too, so I’m not sure why you would have only now noticed something—unless the problem has nothing to do with your .tex files.

I’m not sure what you’ve run into, in the past, sorry you haven’t found a convenient path. As for setting up LaTeX in Scrivener, I’m not 100% sure what you mean by that since it’s more about setting up MultiMarkdown in Scrivener. MMD is the thing that turns your Markdown into LaTeX, and the latter is what Scrivener knows how to make. That isn’t in the tutorial either, but that’s more because the author of it doesn’t use Markdown. The user manual has a whole chapter on it though; let me know if there are any facets that are unclear. There are also a number of built-in compile Formats for LaTeX, some demonstrating custom use, like the “Modern” example.

As for pure LaTeX—that is also an option with Scrivener. If part of what has bothered you in the past is fluctuations in Markdown syntax and how it generates .tex files, then you don’t have to use that conversion engine as a middleman in Scrivener. You can also be in more control over when MMD updates. We try to keep the version embedded in Scrivener up to date, but you can install your own version to the system and it will use that instead. This means you can go on using an older version you’ve tuned your work toward, rather than being stuck on the upgrade treadmill.

You can use another conversion engine entirely, like Pandoc (there is even a good automated workflow for that, search for “Scrivomatic” on this forum here). Or you can check out the “General Non-Fiction (LaTeX)” built-in template we provide, which is designed for those that prefer to require working in native LaTeX rather than using Markdown-based conversion. With that template, Scrivener can convert most of the things to LaTeX that it itself will convert to Markdown by default, and for the rest it demonstrates how you can create your own styles to add support for additional syntax.

The General Non-Fiction (LaTeX) built-in template seems wonderful! How would I go about using a journal’s LaTeX template in combination with this built-in Scrivener template? Or would that be ill-advised?

I’ve just written a long-winded post about my intentions for a new workflow using Scrivener/Papers/MMD and LaTeX: [url]beginner to MMD and LaTeX: looking for advice for incorporating into existing Scrivener 3/Papers 3 academic workflow]

I am trying to take advantage of existing LaTeX templates for my work (journals, dissertation) to try and produce a streamlined workflow … but without completing going LaTeX crazy (if possible).

Not at all! In fact it is designed to be more of a simple example of how you can create your own setup. What it ships with is dirt simple, and I doubt it would be of much use to anyone, verbatim.

The setup is basically split into two different parts:

  • Stuff specific to the project: these will be found in the Front Matter folder. Most of them are disabled from compiling by default, check the Corkboard for any annotations on how to set up these elements.
  • Stuff specific to the design of the document: the main document class, core packages and other such setup is a function of the compile Format. This way you can publish to multiple standards if need by, without having to change too much about the front matter folder setup.

This is all of course Scrivener’s design—the notion of separating form from content and making it so you can switch output layouts easily from the central compile interface. We’re just using that natural approach to slot LaTeX in where it also adheres to that principle.

So to get started with your own Format, right-click on the “LaTeX (Memoir Book)” compile format and duplicate & edit a copy of it. The Text Layout pane is a convenient place for the sort of boilerplate stuff you’d want to modify about the preamble. As you can see, the provided example is very simple. :slight_smile:

Now you mention in your other post that you’re brand new to LaTeX. I would say it will definitely be worth your while to start learning it as you go, even if you intend to use MMD/Pandoc to do the bulk conversion. The basics of LaTeX are quite simple and could be learned in a few hours—but by basics I’m referring to what the syntax looks likes, knowing where and how it can be used, and how to read error/warning logs during typesetting.

Where the Markdown-based approaches help a lot (outside of the simplicity and elegance of the writing/reading “interface”) is in getting all of the basics of your document built out correctly. With MultiMarkdown you don’t have to learn how to insert an image effectively, with a caption and cross-reference anchor point, and then how to refer to it elsewhere in the text. You just use MMD’s natural and simple facility for doing so. This stuff isn’t complicated, and most of it “reads well” in the sense that the LaTeX language is designed to be self-documenting—but if you go into it with no knowledge at all then you do still have to learn what to type in.

So all in all, I would say our pure LaTeX template is probably better for those that are already familiar with using it directly, or for those that would like to avoid Markdown conversion for whatever reason.

Whatever the case, I think Scrivener has ample alternatives for getting a final result out of the software, and tools for streamlining once you get to that point. The Scrivener user manual project is tuned to the point where I could set it up to generate a PDF by doing nothing more than clicking the Compile button. I won’t deny it took quite a lot of “streamlining” to get it to that point however, including writing my own post-processing scripts and such. The point is Scrivener can take all of that potential stuff and make it a system as automatic as you want or need.

Amber - thank you for the detailed reply. This is super helpful! I will play around with both routes and see how it goes. I am leaning towards the MMD/Pandoc route (but still writing in Scrivener) but having the Scrivener LaTeX template on hand has already been useful.