How to delete metadata keys in a template?

I’m posting this inquiry under “Markdown & LaTeX” because the problem concerns unwanted metadata being inserted into a Multimarkdown file prior to using pandoc to post-process the .md file to pdf via Beamer. I’ve created a Scrivener template for making beamer slides, but it seems that I am not able to remove the author and title metadata keys from the template; that is to say, if I delete them from a project, and then make that project a new template, then when I create a new project from that template, the author and title metadata keys return. Because I want all the metadata for the beamer slides to be contained in the YAML header, I don’t want Scrivener overriding the YAML entries with its metadata, but that’s what’s happening.

Is it possible to have a template that will list no metadata items under “metadata keys” in the compile pane for new projects?

1 Like

My comments apply to Windows, not sure what OS you’re on, but -

I believe when you first create a new project, the values for title is taken from the project name and author info from the global settings (File > Options > Author Information).

Then when you compile, you can override these settings in the Compile Overview pane.

Perhaps that’s the best approach, is to override prior to compile?


Thanks, Jim. Sorry, I should have said I was on MacOS. Still, your advice is what I’m doing now—deleting those metadata keys each time using the menu in the compile pane that you’ve circled. It would be nice, however, for Scrivener to take my word for it when I delete those and then ask Scrivener to save the current project exactly as-is as a template for future use. Am still hoping this is possible, somehow…

To clarify, this is already what Scrivener is doing. The template is saved with author name and project title empty. It’s the project creation process that’s adding that info back in.

If you shared the template with me, for instance, when I create a project from it, the new project will be loaded with my project title and my name (if author name is populated in my global settings.)

You can “stop” this behavior for author name, by removing author info from the global settings (File > Options > Author Information), but that would remove it for all projects. I don’t think there’s anything you can do about project title except remove it from the compile settings after project creation, as you’re already doing.


1 Like

Don’t change the metadata, change the Compile format.

If you’re compiling to a Markdown format, there’s also a Metadata tab in the Compile Format editor. By default, it includes the Project Metadata, but you could just remove that key. See Section 24.11 in the Mac Scrivener manual.

1 Like

Thanks for the report. I’ve gone ahead and moved it to the Mac section and tagged it as a bug, because this isn’t working the way it should (it works fine on Windows).

For the sake of those providing help, this is about a very specific Markdown setting in the compiler that one should be able to clear completely, or replace entirely with their own data.

  1. Create a new blank project.
  2. Open the compiler, click on the Metadata tab on the right.
  3. Scroll if necessary down to the metadata table and select both Author and Title metadata keys, clicking - or hitting the delete key to remove them.

It is that condition which is meaningful, and should be retained when creating a project from a template saved in that state.

This is especially true for MultiMarkdown, where a lack of these metadata keys signals snippet mode, which is better for copying and pasting formatted text into boilerplates such as blogs, rather than generating whole pages or complete documents. In this case, no setting is very much a setting.

So yes, that is a bug, and clearing your Author Info (not that one should have to do that) or deleting the field data above the metadata table is not a solution (you can’t even really delete the Title field because it has a hard-coded fallback to the project filename on the disk). That would result in an even worse scenario of getting this in your Markdown file:

title: my_filename

# First heading

First paragraph...

The desired result is to not have any of the stuff above the example “first heading”, as there is a complete metadata block meant to be inserted in replacement (presumably after compiling, in a text editor).

1 Like

Thank you! (and here’s an extra THANK YOU) to make this post at least 20 characters :crazy_face:

@jpkell — thanks for finding this, it affects both my scrivomatic and quarto templates (that both depend on a customised metadata yaml block), and I never noticed it!

Technically pandoc can allow multiple YAML blocks, and IIRC uses the later values when necessary…

1 Like

For some reason it’s never been a problem when post-processing with Pandoc from md to standard pdf (and docx), but it kept being a pain when using Beamer via Pandoc to create pdf slides.

1 Like