-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zref-perpage doesn't work with include files #10
Comments
zref explicitly excludes the unique counter used here from the standard resets:
Your example works if one get around this restriction by defining the counter before loading zref:
But I have currently no idea why zref doesn't simply use \newcounter. |
well not doing this ensure that the counter is indeed unique across the document run, but why that is a virtue or needed is not clear to me. If you have include files and in file A you get more labels then you get duplicates on file B which means you need to rerun file B. That may be the only reason why you have to rerun it, so perhaps he tried to avoid this, but now you get always duplicates whenever you run only some include files, so without it it is totally broken. What could perhaps work is to add some safety value at the end of an include file so that the counter saved is not say 65 but |
Hm, simply adding a value would shift all the following labels, wouldn't it? So you would have to rerun the files to get them right again. Rounding up to the next full 100 could probably work. |
you have to round to the next 100 (or 200) for sure, otherwise the problem would persist if file A gets additional labels: you want to be able to absorb them (usually) without the need to rerun B. If this counter is only used for per page values then rounding to the next 100 is probably fine. That means you get an unnecessary rerun when the page count of a chaper just crosses 100 pages (with footnotes) which will not happen often. |
Something like this?
|
I fear not but perhaps that means we have a thought error in the include set of hooks. If an include file is not loaded then non of its hooks are iare executeded. |
I thought I had tried it, but perhaps I got confused with the aux-file, I will check again. |
it works as documented the hook is not executed if the include is bypassed, but this is arguably wrong. One could argue that the include hooks should always be executed and if on wants something only executed when the file is loaded then the corresponding file hooks could be used (which also exist), doing that would give extra flexibility compared to what is offered now. |
Actually I think it works if expected if you additionally add if one allow the counter to add to the ckpt by remove the \let, or by doing
|
ok, my bad, it does work because when hook is executed before the checkpoint is written (I thought the after one comes later), so yes it would do. |
@FrankMittelbach Good that this can be made to work as needed. But probably good to note here that the include mechanism nevertheless needs to be analysed and revised sometime soon, in connection with 'attributes and cross-refs' more generally. |
zref-perpage generates labels the form
but the label name
zref@<number>
is always starting from 1 without regard to the fact that you may only run one include file not everything. As a result you get duplicate labels.Example
I haven't checked but if these labels are also used elsewhere by zref you will have the same problems with other modules of zref.
The text was updated successfully, but these errors were encountered: