I have two collections. I one Metadata file is part of one collection, the other is part of the other collection.
I am compiling to a MultiMarkdown that is later converted to LaTeX by pandoc.
When I compile I want to be able to select a particular Metadata file, such as Metadata Questions, for the appropriate collection.
I can select it from the Front matter selection, make sure it is included, etc. If the Metadata file in Front Matter is named Metadata, then it is included at the top of the compiled markdown document, inside --- bars. If the Front Matter Metadata file is named anything else, then a metadata section is added to the head of the compiled document and the content of my selected Metadata file is included after the closing ---.
A. (Metadata file named Metadata.)
---
date: July 13, 2022
revision: 3
user-firstname: FirstName
user-lastname: LastName
author: FirstName LastName
project-title: Test Project
---
B. (Named other than Metadata)
---
title: Test Project
author: FirstName LastName
---
date: July 13, 2022
revision: 3
user-firstname: FirstName
user-lastname: LastName
author: FirstName LastName
project-title: Test Project
I see now in the latest documentation in section 21.6 MMD & Pandoc Metadata the following.
Compile group specific: if you place a document called “Metadata” at the very top of the selected documents you will be compiling, Scrivener will append the text in that file to the metadata block. In this way you can provide information specific to the compile group—for example if you are publishing multiple articles out of a single project, the “Title” metadata field would make a good candidate for this method. It is up to you to format the metadata rows properly as text. This file can be named “Metadata” or “Meta data” as well.
It seems that for a MMD / Pandoc compile the metadata binder item must be named Metadata or Meta data. My idea of using different binder items for the metadata appears to be a dead end.
Can’t you use two Metadata files (same name) and check their compile flags at compile time to activate the one you need and deactivate the other? Or include one of them in Collection A and the other in Collection B (and everything else in both)? I doubt using the same name for both is an issue, if you’re compiling only one.
I use two different front matter folders, each with their own “Metadata” file in it at the top, and have it set up so that when I switch compile formats it selects the right front matter folder automatically. So the layout in the binder is like this:
Front matter/
Windows Front Matter/
Metadata
macOS Front Matter/
Metadata
Now in the compiler, this is what one of the compile formats is set to:
The key thing is that lock button on the right. When locked, it causes this setting to be locked to the Format (which in this case is a Windows-specific output). I have the same setup for the Mac-specific output, but with the other folder selected.
As I understood the lock feature, it depended on the export file type – ebook vs. everything else – but what you’re describing has to depend on something else. How does that work? Is it locking each Format to a Front Matter choice? If so, why didn’t the same thing happen in the workflow I’m familiar with? Wait … is it locking in both ways at once?
Quite right, Formats remember their own front matter automatically, it’s file types that use the lock. It’s been +27° indoors for a good 3/4 of the day for the past five days at this point. My brain is soup.
That aside, using the lock one way or another won’t make any difference if you’re just switching between two different Formats and don’t switch file types.