Neutral <$include:...> from inside a project

I want to “synchronize” the dedication text for the different formats of a (v3) project. (That’s a hacked-up template that once started as the Novel template.) Sure, I says: I’ll just <$include:Dedication Text> from all of them. Works fine, except that the style of the Dedication Text document overrides the style of the individual dedication pages, whose formatting is (obviously) quite distinct.

Is there a way to <$include> “pure text” that adopts the formatting at the including site? Reading the manual, that works with including .TXT files, but those can’t be inside the project, can they? The manual seems to say that when including a project document, the source’s character formatting always overrides…

What am I missing here? I searched the forums for “<$include” but didn’t see any obvious answer.

– perry

So basically the main thing that matters, in most cases, is the Section Type of the item that is doing the including. Since Section Types (or more accurately, the Layouts you assign to them in Compile) can override just about everything about how the text looks, you can thus override how the source text looks from different dedication page treatments, by having them assigned to an appropriate layout in compile.

For example, the original dedication page might be centre-aligned as 14pt Palatino, but if you include that text into a “Front Matter” typed document which uses a layout that changes its font to 12pt Times New Roman then you should see that change. And if you wanted to change the alignment for some reason, you would be able to do that as well from the layout.

I want to believe in the theory. The dedication page (from the Novel template) is section type “Front Matter”, which the PDF/Paperback compile style maps to “New Page”.

What I get upon actual compile is this:

… which shows that the included text is left-justified and bigger, while the rest is indeed centered.

Surrounding the <$include…> stanza with single spaces fixes the alignment problem, but not the font disparity. Checking the “Override text and notes formatting” checkbox on the “New Page” layout (it’s unchecked by default) fixes the font disparity but not the alignment one. So combining the two sort of makes the example come out right (though the spaces throw off the formatting just a wee bit). In all cases, it looks like whatever alignment is in the source comes right through the compilation process unchanged, ignoring the alignment I try to set there - which isn’t at all what you told me. So I clearly don’t understand something.

What am I not getting here?


Test project: (376.4 KB)

Scrivener 3.2.2, MacOS 11.3.1, big iMac, compiling to the PDF/Paperback (5.06"…) format. Straight built-in Novel template with no modifications whatsoever (other than adding a “Dedication Text” document under Notes and including it).

– perry

1 Like

Creating a section type and layout (both called “dedication” in the sample project attached) and styling the layout as desired appears to work.

Okay on your iMac? Suits your needs?

Ioa might have a better solution.

Merx (108.3 KB)


Interesting. Your project worked, but when I tried to recreate it from scratch, it (still) didn’t. I finally tracked it down to the “Preserve uncommon alignment” checkbox in the formatting override options of the Dedication (compile) style. Yours isn’t checked, but mine was. For some strange reason, in your project, when I create a new compile style, it has this checkbox off; in my (freshly made) project, it’s (invisibly) on. Is there some global default or calculation affecting this?

Anyway, I can now make it work for myself, and when I inevitably have this problem again in two years, I can look up the answer in the forums. :slight_smile:

Thank you so much for your help.

– perry

Sounds like you got it all figured out!

Yeah so basically the “New Page” Section Layout that the stock template has bound to Front Matter items is intentionally permissive with its formatting settings—precisely because it is meant to be used for stuff that is going to be wildly different from anything else, like dedication pages, title page, copyright page and so on. So it simply passes through editor formatting without touching anything.

This is an unusual case because we definitely want the dedication page formatting to override since elements of it are coming from outside of the document, and have their own unpredictable formatting.

So the optimal design here would be to create a “Dedication Page” section type in the project, and then duplicate the “New Page” Layout in the compile format designer, so you have something like “New Page / Centre-Aligned” available, which overrides text formatting and alignment, and so forth.

That way you aren’t changing the core “New Page” that stuff like the Title page wants to use.

Apologies. I was in a rush and forgot to mention about the “Preserve uncommon alignment” toggle.

Seems you have got a working solution now, and Ioa’s post above must also make things clearer.

Good luck with your writing.