Skip to content

@eq displays inconsistent numbering with the label #2280

Answered by Julian-Wassmann
ivaquero asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

If I understand you correctly, your custom equation numbering is working correctly for equations, but not when referenced. The reason for this is that you have to customize the reference function so that it can use the right location (target element, not reference itself) for querying counter(heading).

It makes sense to define a custom equation numbering function which is then used in equation and ref rules. This way, you don't have to define the numbering format twice. Like so:

Custom equation numbering function

#let customEqNumbering(n, loc) = {
  let hCounter = counter(heading).at(loc)
  let chapter = hCounter.at(0)
  let headingNumbering = numbering("1", chapter)
  if hCounter.len…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ivaquero
Comment options

Answer selected by ivaquero
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants