Placeholder compiles in one version of the document but not the other

Here’s the thing. I have a Scrivener project with placeholders for autonumbering in them.
SSSNNN D#<$n#dag> Where #dag refers back to <$n:dag> I’ve compiled this project succesfully.
The named autonumbering works and I get D#81 for example.
Then I saved a couple of new versions of this project - just building upon it - but the current version (that’s just a longer, updated version of the project that DID compile) no longer replaces the <$n#dag> placeholder anymore. It still does increment the <$n:dag > placeholder though.
So even though nothing’s changed (as far as I can tell) it still no longer works. Any idea what could be the cause of this?

Yes, that should be working (and does in a simple test for me). The only exception with this particular form you are using is that the simple <$n#stream> can only work backward, so if the very first instance of its usage has no <$n:stream> prior to it, it won’t print anything. After that point though, it should work. The form that works forward as well is <$n#stream:id>, where each instance of the counter has its own ID on the end, and that ID is used somewhere else.

I’d check your Replacements, in both the main project tab on the right, and in the Format itself, to make sure nothing is inadvertently modifying the counters. Otherwise, if you could maybe post a simple example project that would help. If you can’t reduce it down to a simple test, feel free to send a copy of the project that isn’t working to technical support.

1 Like

Hi Amber, thank you for your fast reply. On a sunday nonetheless.

It’s really weird though: I tried it myself on a new simple test as well and it worked there.
And when I replaced the placeholder I was using with ‘search and replace’ it also worked again.

And as I said, the exact same file was working earlier (there were in fact 81 instances prior to it, since I needed to start the count at 82 - if there’s a way to start autonumbering from a certain number, it would be really great to hear about it)

So there is something wrong with that specific file/project I guess. Because after search and replace it started working again.

Would you still like a copy of the ‘corrupted’ file? Or should I see if the issue rears its ugly head again?

1 Like

Glad to hear it somehow got fixed with find and replace. Perhaps there was a “junk” character in there, that was invisible to Find but not to the code that looks for placeholders (which is likely a regular expression, and thus a bit more picky).

So yeah, unless it comes back, I think we can set it aside as a “gremlin” for now.

…if there’s a way to start autonumbering from a certain number, it would be really great to hear about it)

There isn’t, unfortunately. we really need to implement that some day. We already have a reset code that can reset a stream to 1 by name, so why not <$start:dag:81>? The old workaround of having 81 junk placeholders you have to delete every time you compile is pretty awkward!

1 Like