Placeholder numbering

Hello,

I am not sure if I need to create a new topic or continue here. I need help with placeholder tags that are not compiling properly in a complex document (they were until few days ago).

I am working on a history book and I am using placeholder tags to number automatically chapters, sections and subsections.Then, I use them to refer to a specific text (crossreferences). I am working in two languages, within each, I have 3 parts and within each part, three types of information (each needs its own numbering).

For example, I use something like:

<$n:chaptername> (level 1)

<$n#chaptername>. <$n:chaptername:section> (level 2)

<$n#chaptername>. <$n#chaptername:section>.<$n:chapternamesection:subsection> (level 3)

I have also tags for the other information types, in the same kind of structure (but with different names and a character in front to distinguish each type).

Then when I cite, or refer to a specific section, I use for the crossreference, for example, <$n#chaptername>. <$n#chaptername:section>.<$n#chapternamesection:subsection>.

I never managed to use the sub-numbering tag <$sn:> so I came up with the system above, which is horrible to look at, but it was working when compiling. It was actually very useful, because being at the drafting stage, I can move text around and the numbering and citation gets adjusted accordingly.

The problem is that lately, when I compile, some of the numbering gets messed up, no matter which format I chose as an output. Suddenly, here and there, level 1, 2 or 3 restart the counting (but the following title continues with the numbering as before the problem). I have reviewed my tags, again and again, and nothing seems to be wrong. Actually, this happens in PDF, DOC or ODT, and strangely, the problem happens at different places in different formats.

I have already several hundreds of pages, I wonder if I am confusing the system with all the naming I am using or what is happening.

BTW, I also tried using prefixes in sections when compiling, but it doesn’t seem to work. When I compile, I use in sections text as it is.

Can any one help me to try to figure out the problem or, suggest a method to achieve the title numbering and cross-referencing for my setup?

Thanks a lot!

Mac version 3.5.2

PS: I hope I can find the problem, because I had to substitute all my Zotero references and citations manually (because the bridging programme stopped working for the new Zotero version). I don’t really want to be chasing citations of the different sections and subsections.

(Post moved to new thread, since the old one was both 15 years old and the wrong platform.)

If this is a new problem, the first place I would check is anything that changed. New sections with the wrong Section Layout assigned? A typo in one of the placeholders?

Rather than sub-numbering, have you tried the hierarchical numbering tag, <$hn>?

1 Like

Hi. I have checked for typos and all the section layouts are assigned (and each document has its type of section). The issue is they appear different in different output formats (none of them is right, though).

PS: I tried, but it doesn’t work for me because of the structure of my folders and docs (part, language, chapter, content1…), it means that my first title starts at 1.1.1.1, and I need it to be at 1.

Also, when I crossreference I need a unique marker for each doc as well as the possibility of shortening the title, e.g. “see D.1.1” or “go to D10” (instead of having the entire title). Thanks!

Please open a support ticket, here:

Please include a copy of the project and some examples of specific locations that have the issue. You can email a project by using the File → Backup → Backup To command, and checking the box to create a ZIP backup.

2 Likes

I think you need some resets in here. [Edited to correct placement of LABEL term.]

For (level 1):
<$n:chapter:LABEL><$rst_section>

For (level 2):
<$n#chapter>. <$n:section:LABEL><$rst_subsection>

For (level 3)
<$n#chapter>. <$n#section>.<$n:subsection:LABEL>

Where ‘LABEL’ is replaced by your nicknames (for cross reference purposes) for particular chapters, sections and subsections.

You can also reduce clutter by using Compile’s Replacement pane to introduce shorthands for some of this coding. Imagine just being able to type:

[=intro=] for a chapter number with label ‘intro’
[-plan-] for a section number with label ‘plan’
[.remark.] for a subsection number with label ‘remark’

Not to mention being able to type things like:
See Chapter /=intro=/ or See §/-plan-/.

Hi Gr

Thanks!

Sorry for the delay, I was testing different things.

I tried your method. It works as long as I have something like:

1, 1.1, 1.1.1 or even 1.1.1.1

But the minute I want to have something like:

1, 1.1, 1.1.1, 1.2, 1.2.1, 1.3

It doesn’t. I think because the reset of numbering implied.

I think I found the problem: I was using different tags for each language and part. In some places, I had (by design), documents in language A, language B, then again language A and B. So, the first time that the programme encountered the change in language (change in tag root), it numbered that title wrongly (with the number depending on the number of different items before).

I realised that I can use in compile (Title/prefix) the following:

For the chapter title: <$n:chapter>.<$rst_section>

For the section: <$n#chapter>.<$n:section><$rst_subsection1>

For the subsection <$n#chapter>.<$n#section>.<$n:subsection1><$rst_subsection2>

For the subsubsection <$n#chapter>.<$n#section>.<$n#subsection1>.<$n:subsection2>

This seems to work.

Now I am trying to figure out how to cross-reference, because I would not have individual markers as before, and I want in the text where I insert the cross reference 1, or 1.1, etc., instead of the full title.

Is that why you would use the square brackets in the replacement section? To recall a number? (I haven’t get to test this yet).

Thanks again!

  1. I misplaced the LABEL term in the schematic placeholders I set out for you! I have edited my previous post to fix this! That might explain why it did not work for you.

  2. If you put your placeholders in the Title/Prefix of Compile, you will not be able to do the cross-referencing you want.

  3. To do the cross-referencing you want, you need to be able to specify an individualized labeling term for each unit you want to be able to refer back/forward to. That is what the LABEL term is for in the placeholders I sketched for you. If you have a chapter headed by this placeholder:

  • <$n:chapter:complications><$rst_section>

  • Any subsequent occurrence of <$n:chapter:complications> would produce the very same chapter number as the first instance did. Cross-reference! If you need a forward-looking cross-reference to that chapter, you would use <$n#chapter:complications>.

  1. All this placeholder stuff is written up in Scrivener > Help > List of Placeholders.

My suggestion of shorthand replacements was for convenience and elegance. You could set up a replace-on-compile like this:

Replace ‘[=’ with ‘<$n:chapter:’
Replace ‘=]’ with ‘><$rst_section>’

This would enable you to merely write [=complications=] at the head of a certain chapter, and this would get replaced by the chapter number placeholder code we just discussed which would in turn be replaced by the chapter number on compile!

1 Like

Thanks a lot, this is helpful!

I will try again.

I was hoping the “[“ would recall numbers! But I see what you mean.