Difference between revisions of "Last Head Number"

From Wiki
Jump to navigation Jump to search
m
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
To access the last head number in a document one can use: <texcode>\somestructureheadnumber[…][…]</texcode> The following example from the mailing list demonstrates how to use it.
+
To access the last head number in a document one can use:  
 +
<texcode>\someheadnumber[…][…]</texcode>  
 +
The following example from the mailing list demonstrates how to use it.
  
 
<texcode>
 
<texcode>
 
\dorecurse {5} {
 
\dorecurse {5} {
   \chapter{Test #1}
+
   \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 #1}
+
     \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]
 
   }
 
   }
 
}
 
}
 
</texcode>
 
</texcode>
 +
 +
For using inside a Metapost-environment you can use the expandable version:
 +
<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.
 +
 +
[[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.