$include in Text format’s “Document prefix” doesn’t work

Goal

I’m trying to compile to a LaTeX file using novel class. I want to make the format generic, but of the two novel sets I have at the moment, the Chapter Headings need to be different. I was hoping I could have a a LaTeX Definitions file in the Front Matter folder that creates a \newcommand for the chapter layout. That way, I could redefine the command per project while having my LaTeX Novel Format generic to all projects.

Attempt

In the TXT format’s Document Prefix, I have the line <$include:LaTeX Definitions>. That is absolutely the name of the file — I copied and pasted it.

Problem

When I generate the LaTeX file, the string <$include:LaTeX Definitions> is included unchanged. Other placeholders do work in the Document Prefix, specifically:

  • <$projectName>
  • <$fullName>
  • <$compilegroup>

all are replaced fine.

Questions

Is $include not supported in this context? That would be sad :cry:

Is there another way to achieve what I want?

The <$include> placeholder should be supported.

What version of Scrivener, please? And on what platform?

2 Likes

3.5 (17311) on macOS Tahoe arm64. Direct purchase.

It looks like maybe the Mac version isn’t working, specifically. This technique works fine on Windows, but when I loaded the test project I made, on a Mac instead (after checking your profile settings), I see the placeholder does nothing.

By the way, another approach to this is to do things a bit more like the LaTeX non-fiction template does, which you’ll find in the Non-Fiction template section when creating a new project. The design approach I went for was to have all general matters relating to the document class itself be defined by the compile Format, but all matters specific to a particular work, such as which packages it needs to include, or commands to define, would be established in its Front Matter folder in a modular fashion. Each “card” is providing a group of functions, such as bibliography support, or proofing tools and page layout (wide margin for notes).

3 Likes

Thanks @AmberV, I’ll check that out.

Hi @AmberV,

The method you used in the LaTeX non-fiction template should work for me. So you may adjust the severity of the bug as necessary.

1 Like