-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
Add theHcounter represention #1095
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See two pending comments:
one being a possible problem with the code.
base/doc/ltnews38.tex
Outdated
@@ -144,6 +144,16 @@ \section{Introduction} | |||
|
|||
\section{New or improved commands} | |||
|
|||
\subsection{Proving counter representations for link targets} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proving ==> Provide
base/ltcounts.dtx
Outdated
% \end{macrocode} | ||
% \end{macro} | ||
% | ||
% \begin{macro}{\@addtoreset} | ||
% \changes{v1.1n}{2023/06/15}{add the parent theHfoo if a counter is reset} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs further explanation, both of the details of the code that does this, and of the effects/reasons for doing this.
Thus, maybe some explanation of the details of how the H-* stuff works would be useful?
%<latexrelease> {provide theHfoo commands}% | ||
%<*2ekernel|latexrelease> | ||
\def\@addtoreset#1#2{\expandafter\@cons\csname cl@#2\endcsname {{#1}}% | ||
\expandafter\gdef\csname theH#1\endcsname{\csname theH#2\endcsname.\the\value{#1}}% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work as intended in the following cases?
-- Counter A is reset by Counter B and
Counter A is also reset by Counter C ;
-- Counter A is reset by Counter B and
Counter B is reset by Counter D .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The exact definition of \theHA
depends naturally on the order of the @addtoreset calls. It "works" if one get unique \theHA
value, which isn't 100% garantied -- users can always find a way to build something odd, -- but it is the definition used by hyperref since many years, so it is compatible with the current behaviour.
One more comment, but just a typo! |
Looking further into this suggests that it is not necessary for any of this to be in the kernel, at least not in this very specialised form. Is this move considered essential? If so, why? |
It seems likely that it would be safer to only add a hook here to the kernel version. This enables packages, including the various options in hyperref, to independently add whatever code they need. And it avoids building in particular, and not totally robust, code that is specific to some uses (options) of hyperref. |
The code is not specific to hyperref. As said above the counter representation is also used for structure references and for this the H-representation is needed also for counters created before hyperref is loaded and also if hyperref is not loaded at all. The latex-lab code contained therefore a copy of the hyperref code, and this PR mainly moves this code from latex-lab into the kernel. Generally: one goal of the tagging project is to move support for hyperlinks into the kernel. To quote one of the subtasks:
And this requires that hyperref stops to patch kernel commands, both directly and through hooks. |
OK, so the ability to adapt is needed more generally, including maybe for applications not yet imagined. In that case there are even stronger reasons to only add hooks or generic commands to the kernel, rather than very specific, and in some cases suboptimal, chunks of code. Or not? |
"To quote one of the subtasks: For the interfaces this is probably desirable at some stage. This is one of many ideas in hyperref that is strangely implemented. And in general the internal details should not be built into the kernel. So we need to decide what is a good interface to put into the kernel here, so as to avoid having to add such implememtation details. Aside: I never signed off on that subtask being included:-). |
Sorry I'm loosing you.
What is strange? It is simply another command associated with a counter and not stranger than |
This PR has been automatically marked as stale because it has not had recent activity. |
This PR has been automatically marked as stale because it has not had recent activity. |
Can you rebase this onto current dev? |
base/changes.txt
Outdated
* usrguide.tex | ||
Correct description of font encodings supported for case changing | ||
|
||
>>>>>>> develop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably remnant from merge conflict
hyperref and also the tagging code need for links and structure references an additional counter represention
\theH<counter>
. This moves the relevant hyperref and latex-lab patches of\@definecounter
,\@addtoreset
and\refstepcounter
into the kernel.Internal housekeeping
Status of pull request
Checklist of required changes before merge will be approved
\changes
entries in source includedchanges.txt
updatedltnewsX.tex
(and/orlatexchanges.tex
) updated