Managing my list of sections to compile

I am researching how to manage my project list of sections to be compiled in order to reduce my project compile time, now over 6 minutes.

My current thinking is to create a Scrivener ‘collection’ of sections that include all the LaTeX Preamble sections, that are needed to run the equivalent of a “Minimum Working Example” or MWE. The ‘Compile:’ pop-up list in the upper-right corner of the Compile … screen (apologies … I don’t know the exact screen name) allows me to select the ‘collection’ of Preamble sections I’ve created which then appears at the bottom of the ‘Compile:’ pop-up list,

To this list of Preamble sections, I could then select whatever additional section(s) I need to complete my test compilation, at a fraction of the current compile time .

If and whenever I needed to compile the entire project, I could simply select my default list of sections, in this case ‘Draft (Manuscript)’, on the same ‘Compile:’ pop-up list.

This feels like a bit of a kludge as a way to reduce my compile time, and I’d welcome any and all thoughts and suggestions.

Also, is there a Scrivener Placeholder available that I can include in each section of my code that will override the Compile checkmark/flag/switch on the Compile … screen? (I realize this may be inconsistent with how a compiler functions, but if possible, it would be helpful.)

Thank you,

Following my outline above, I created a ‘collection’ of Preamble sections by inserting the text ‘[b]%^^Preamble-sections^[1]’ at the beginning of each section that is part of my Preamble.

I then searched for the term [b]^^Preamble-sections^[2], and then saved the search as a ‘collection’. I then selected the ‘collection’ from the ‘Compile:’ pop-up list (in the upper-right corner of the Compile … screen) and compiled the ‘collection’ of Preamble sections.

The compile time was reduced from over 6 minutes to about a minute and a quarter. Nice!

Now whenever I need to test a new section, I just need to add the section to be tested to the saved ‘collection’ of Preamble sections*, then compile.


  • Documents > Add to Collection > (select appropriate saved ‘collection’ of Preamble sections)

  1. /b ↩︎

  2. /b ↩︎

Rather than include something in the text of the documents to mark the Preamble, wouldn’t it be simpler just to create a custom metadata item in Project > Project Settings > Custom metadata?

[attachment=1]Screenshot 2021-03-05 at 08.49.59.png[/attachment]

If you make it a checkbox, then you can simply tick it on or off for specific documents (using in the Outliner / Inspector / Binder etc).
[attachment=2]Screenshot 2021-03-05 at 08.52.13.png[/attachment]

The new metadata item will appear in the Project Search dropdown, so you can create a Collection as before (just tick Preamble in the dropdown box and then have ‘True’ in the search field.

[attachment=0]Screenshot 2021-03-05 at 08.57.14.png[/attachment]

If you save the search as Preamble, then it will become a dynamic collection, and you don’t have to worry about adding or removing text from documents, or adding them manually to the collection: all you need to do it tick or until the Preamble checkbox and the membership of the Preamble Collection will change automatically.

I mention this not because your solution doesn’t work, but because custom metadata is intended to be used in this sort of scenario (amongst many others…), so it’s a more general and flexible solution.


1 Like

@ brookter,

Your Custom Metadata suggestion for my ‘Preamble’ sections works beautifully!

For those also working with Scrivener+LaTeX, I outlined the steps I followed below to convert my text based ‘collection’ to custom metadata as per your suggestions:

  1. I created a ‘Preamble’ custom metadata label with a ‘Checkbox’ in Project > Project Settings > Custom Metadata.

  2. In View > Outliner Options > (list of columns in Outliner), I then checked off ‘Preamble’ to have the column for the ‘Preamble’ appear in the Outliner.

  3. In the Binder, I searched for the text ^^Preamble-sections^^ (that I had inserted earlier in the text of all Preamble sections) and saved the list of sections as a new ‘Preamble’ collection.

  4. Still in the Binder, I highlighted all the sections in the ‘Preamble’ collection I saved in the above step.

  5. I then opened the Outliner and proceeded to check the ‘Preamble’ checkbox for each of the sections in the ‘Preamble’ collection.

With the ‘Preamble’ custom metadata now defined, whenever I need to compile the equivalent of a Minimum Working Example (MWE), I can select the ‘Preamble’ sections by clicking on the ‘Compile:’ list popup on the Compile for: screen, then scrolling down the list of sections toward the bottom and selecting ‘Preamble’.

When I need to test section(s) of LaTeX code, the beauty of having the ‘Preamble’ custom metadata (as brookter points out) is the ability to select the relevant sections to be tested in the Outliner and check the corresponding checkbox to now include those section(s) in the list of ‘Preamble’ sections to be compiled. The text within each section remains unchanged regardless of compile status.

The ability to then simply tick the compile status on or off for specific documents (using in the Outliner / Inspector / Binder etc), rather than inserting or deleting ^^Preamble-sections^^ code within the text is a much more ‘Scrivener’ way of working.

Having created the ‘Preamble’ custom metadata tool as a way to quickly test individual section(s) of LaTeX code, greatly reduces the time to compile, in my case from over 6 minutes to just over a minute.

Thank you!

Excellent — I’m really pleased it helped!

1 Like