<$hn> with custom layout and structure-based layout

Hello,

I’m sorry if this was asked before. I cannot find an answer.

My publisher requires me to submit my copy with heading tags, e.g., <H1>. I can do it manually, but I would much rather do it automatically based on the structure-based levels. It’s a technical document, so I have seven levels, and the document would require hundreds of tags.

I also use the tags in a C# script to edit the Word output after the Scrivener compilation.

I tried a few iterations, and my last attempt was:

  • Assign a custom layout, e.g., L1, using Section Type>Edit>Default Types by Structure>+. I assigned L1, L2, etc. to each of seven levels of folders, file groups, and files (see image).
  • I then entered Compile Overview > Non-Fiction Manuscript (mine)>Section Layouts>+ to add L2, L2, etc. (see image).
  • Then I edited the Title Options>Title Prefix ( of each of the L1, L2, etc. section layouts to include [[L<$hn>]] to try to creat tags like [[L1]], [[L2]], etc. (see image).

But the tags are not appearing in the compiled document.

Looking at the outline, the sections seem to be appropriately assigned by the Structure-Based algorithm (see image).

Do you know how I can use a structure-based layout to insert tags for levels that go 7-deep by the described method or another?

Figure 1, Outline & Compile Format Designer

Figure 2, Default Types by Structure

Thanks!

Are your documents and folders set to use Structure-Based section types then layouts? (In the project, in the inspector.)

image

You can test things out a bit by adding something that is NOT a placeholder in the title prefix, where you currently have your placeholder. (ex: xxxxxxxxx)
If it doesn’t show after compile, the issue is not the placeholder, but your section layouts assignation.
[EDIT] (I see you have a little more than just the placeholder already. Do these bits make it through compile?)

. . . . . .
Another possible cause would be that you didn’t do the assignation of section types to section layouts in the center of the main compile panel.
(In which case the extra you have on top of the placeholder, or “xxxxxxxxx” if you run the test I suggested, won’t show after compile. – Unless you’ve already put it everywhere (your placeholder), yet have everything going through the same layout. In which case I think that at least the placeholder should work. → You didn’t have to create sections types if it was just for that, btw. → <$hn> obeys the binder’s structure, not the section types.)

1 Like