Difference between revisions of "Last Head Number"

From Wiki
Jump to navigation Jump to search
m (Changed 'somestructureheadnumber' into somenamedheadnumber)
Line 1: Line 1:
 
To access the last head number in a document one can use:  
 
To access the last head number in a document one can use:  
<texcode>\somestructureheadnumber[…][…]</texcode>  
+
<texcode>\someheadnumber[…][…]</texcode>  
 
The following example from the mailing list demonstrates how to use it.
 
The following example from the mailing list demonstrates how to use it.
  
Line 6: Line 6:
 
\dorecurse {5} {
 
\dorecurse {5} {
 
   \chapter{Test \recurselevel}
 
   \chapter{Test \recurselevel}
   first:  \somestructureheadnumber[chapter][first]  \par
+
   first:  \someheadnumber[chapter][first]  \par
   current: \somestructureheadnumber[chapter][current] \par
+
   current: \someheadnumber[chapter][current] \par
   last:    \somestructureheadnumber[chapter][last]
+
   last:    \someheadnumber[chapter][last]
 
   \dorecurse {3} {
 
   \dorecurse {3} {
 
     \section{Test \recurselevel}
 
     \section{Test \recurselevel}
     first:  \somestructureheadnumber[section][first]  \par
+
     first:  \someheadnumber[section][first]  \par
     current: \somestructureheadnumber[section][current] \par
+
     current: \someheadnumber[section][current] \par
     last:    \somestructureheadnumber[section][last]
+
     last:    \someheadnumber[section][last]
 
   }
 
   }
 
}
 
}
Line 20: Line 20:
 
For using inside a Metapost-environment you can use the expandable version:
 
For using inside a Metapost-environment you can use the expandable version:
 
  <texcode>\somenamedheadnumber{…}{…}</texcode>
 
  <texcode>\somenamedheadnumber{…}{…}</texcode>
 +
 +
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.

Revision as of 17:14, 15 June 2011

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.