Difference between revisions of "Last Head Number"
Jump to navigation
Jump to search
(New page: 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 them. <...) |
m |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | To access the last head number in a document one can use: <texcode>\ | + | 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 | + | \chapter{Test \recurselevel} |
− | first: \ | + | first: \someheadnumber[chapter][first] \par |
− | current: \ | + | current: \someheadnumber[chapter][current] \par |
− | last: \ | + | last: \someheadnumber[chapter][last] |
\dorecurse {3} { | \dorecurse {3} { | ||
− | \section{Test | + | \section{Test \recurselevel} |
− | first: \ | + | first: \someheadnumber[section][first] \par |
− | current: \ | + | current: \someheadnumber[section][current] \par |
− | 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.