Compound-able image placeholder tag?

I’ve searched for this and experimented with it, but if what I’m about to describe is currently possible, I haven’t been able to figure it out.

Say I have a novel with thirty chapters in it, and I want each chapter heading to include a different image (e.g., a graphic of a chapter number/title rather than the text itself, or an icon that corresponds to the POV character featured in that chapter–as is done in Robert Jordan’s Wheel of Time series.)

It’d therefore be handy if the image placeholder tag could be compound-able, like so:


Such that if it were included in Title Prefix or Suffix, then for chapter one Scrivener would compile into the heading an image named “1”, for chapter two the tag would compile into the heading an image named “2”, etc.

Maybe a better way to do this would be with a user-named numbering stream, though, or a custom meta-data field (for that POV character example). Anyway, what do you think?

Auto-numbering won’t work for this because <$img…> tags get replaced before the auto-numbering tags (there is always going to have to be an order to the replacements that will make some combinations impossible).

However, it is already possible to do this using custom meta-data:

  1. Set up a custom meta-data field named e.g. “Image”.

  2. For each document or folder that needs an image in its title, add the name of that image to the custom meta-data field.

  3. In the title or title prefix in Compile, enter:


This works because document-specific replacements are performed before image replacements.

(To highlight the problem of order: if auto-numbering could be used in <$img:> tags, then custom meta-data couldn’t be, because that would require waiting until the entire document had been put together, then going through and auto-numbering, then replacing image tags. But to embed custom meta-data in image tags requires those to be replaced document-by-document, before the entire document has been compiled…)

Hope that helps.

All the best,

Interestingly, it’s possible to use placeholder tags in custom meta-data fields.

If I:

  1. create a custom meta-data field entitled CustomTag

  2. fill it in Chapter One with <$img:MyImage>

  3. and then use the tag <$custom:CustomTag> in the text of Chapter One

Scrivener will replace the custom tag with MyImage wherever it appears.

That’s just a proof-of-concept – not a terribly useful one, perhaps.

Again, this is because of the order in which the replacements occur during Compile. This is pretty much the same as the example I gave you above, except that you are typing the <$img:…> part in the custom tag instead of in the text/prefix.

All the best,