Difference between revisions of "Last Head Number"

From Wiki
Jump to navigation Jump to search
m (Changed 'somestructureheadnumber' into somenamedheadnumber)
m
 
Line 23: Line 23:
 
Willi's comment on 15-06-2011:
 
Willi's comment on 15-06-2011:
 
Sinds Context 13 june 2011 the name <texcode>\somestructureheadnumber</texcode> is replaced by <texcode>\someheadnumber</texcode>. This is in line with Hans' plans to get rid of the 'structure' part inside interface-names dealing with internal counters.
 
Sinds Context 13 june 2011 the name <texcode>\somestructureheadnumber</texcode> is replaced by <texcode>\someheadnumber</texcode>. This is in line with Hans' plans to get rid of the 'structure' part inside interface-names dealing with internal counters.
 +
 +
[[Category:Basics]]
 +
[[Category:Tools]]

Latest revision as of 14:50, 8 June 2020

To access the last head number in a document one can use:

\someheadnumber[][]

The following example from the mailing list demonstrates how to use it.

\dorecurse {5} {
  \chapter{Test \recurselevel}
  first:   \someheadnumber[chapter][first]   \par
  current: \someheadnumber[chapter][current] \par
  last:    \someheadnumber[chapter][last]
  \dorecurse {3} {
    \section{Test \recurselevel}
    first:   \someheadnumber[section][first]   \par
    current: \someheadnumber[section][current] \par
    last:    \someheadnumber[section][last]
  }
}

For using inside a Metapost-environment you can use the expandable version:

\somenamedheadnumber{}{}

Willi's comment on 15-06-2011:

Sinds Context 13 june 2011 the name

\somestructureheadnumber

is replaced by

\someheadnumber

. This is in line with Hans' plans to get rid of the 'structure' part inside interface-names dealing with internal counters.