Last Head Number

From Wiki
Revision as of 17:14, 15 June 2011 by Willi (talk | contribs) (Changed 'somestructureheadnumber' into somenamedheadnumber)
Jump to navigation Jump to search

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.