Placeholder code compile anomaly

When I use this placeholder coding :
{???check Appendix numbers and delete this line <$n:section> <$n:section> <$n:section> <$n:section> <$n:section>}
I get this:
{???check Appendix numbers and delete this line 1 1 1 1 2}
So, in one position in this padding sequence the code is incrementing correctly. This correctness seems somewhat random (last position in this case - at other times it occurs elsewhere).
I have reordered the text to take account of invisibles or different ASCII codes being displayed similarly.
This placeholder approach works fine elsewhere and has worked fine here (but not repeatably - it was working fine until I went to restructure some other aspects, which I have now returned to default since the anomaly resurfaced).
I also note that once I get the counter to increment correctly, then it seems to work in later cases without needing this extra padding of placeholders.
I vaguely recall reading something about a bug in this area. However, the randomness is what gets me (I have spent a couple of days trying to isolate the anomaly triggers in this latest iteration).
Thoughts, please?

Hmm, I think to reproduce this I’m going to need more than just the text that was pasted. I get “1 2 3 4 5” every time I compile, but you’ve obviously got quite a bit more going on in your project than that one line.

If the project is something you can share with support that would be idea. But otherwise if you can reduce the complexity in gradual steps (like compile without your appendix numbering layouts if relevent, etc.), on a copy of the project, to find where it starts working again, that should help us create a test case on our end.

I removed most of the project (it is a PhD thesis nearing fullsize) and the incrementing stopped completely (meaning no w “line 1 1 1 1”). I will share that version via support, as it is much smaller.
I am also getting a random insertion that I remove (from recently and repeatedly) from the Prefix screen on compile - this could be related because it started when I tried to move some of the coding to the layouts (and then removed them because they did not increment). The compiled version of that random insertion is: <$Scr_Ps::0>Attributes<!$Scr_Ps::0>. However, that random insertion did not appear when I had a similar non incrementing issue earlier in the year.
Thank you for looking at this.

The code that got inserted from the Prefix is a known issue. The Prefix and Suffix tabs are supposed to allow for styled text, but they don’t, and if you end up with styled text in them, they will print the raw style markers themselves, which are ordinarily hidden in Scrivener.

All right, I’ve looked up the ticket you started and will give the sample project a test following the weekend, as it’s getting late out here. If it’s a simple compile to trigger the bug, then it should be an easy fix. I’ll try to find a workaround for you as well.

1 Like

Thanks, Amber
You have alreday provided useful insights.

All right, I’ve had a look at the problem and it did indeed require some very specific circumstances in order to trigger the bug. The main issue is that if you use the <$rst_STREAMNAME> command then it basically seems to “buffer” these resets up incrementally, rather than just deleting the current number and starting over at one. In other words, if you use the reset command 15 times, then you’ll need to use the auto-number placeder 16 times in order to see it get past “1”.

It does mean you’ll need to actually use the sectional numbering placeholders before they will start working correctly. If you have those same 15 section headers with the resets, but each appendix section has at least one of each, a figure, table and subsections, then all will be okay and work as expected. The moment you stop having that stuff in a few sequential sections, they’ll start stacking up "1"s internally.

Thus for now, a silly workaround may be to employ a trick like you are doing with the white-on-white text, to ensure there is always at least one of each of these placeholders in use for each section.

1 Like

Thank you, Amber. In that case, if I only use the <$rst_section><$rst_subsect><$rst_figure><$rst_table> options in the corresponding chapters or appendices where sections, sub sections, tables or figures specifically appear (rather than generically), then the problem will not occur.
This explains why the problem worsened when I made the cut down project version to share with you - no chapter contents.
This also explains (I think) the problem that I had earlier in the year with chapters, when I first tried to standardise the layouts.
I don"t mind the issue at all, now that I can see the logic.

Oh yeah, that would make a lot of sense! Cleaning it out for an example would mean removing all of the stuff that was making it kind of work. :slight_smile:

But yeah, either way you want to take it, only using the resets when you definitely need them, or just putting in junk numbers to delete later somehow, should work fine until this is fixed.

…additionally, I used the [Compile] [Edit Format] [Replacements] option to remove the Prefix style marker text, mentioned earlier.

Thanks for the advice on that point, as well.