Changes

Jump to navigation Jump to search
1,144 bytes added ,  18:43, 29 November 2008
independently numbered heading
See the mailing list thread [[http://www.ntg.nl/pipermail/ntg-context/2003/002053.html]] for more on this.
 
===Headings numbered independent of chapters or other headings===
 
If you want a heading that gets numbered without resetting at new sections or chapters (for example, for problems whose numbers increment throughout a book), here is a solution due to Hans [http://archive.contextgarden.net/message/20030415.153451.374310d8.en.html on the mailing list]:
 
<texcode>
% use a lower level head
 
\definehead
[Problem]
[subsubsubsection]
 
% cleaned up
 
\setuphead
[Problem]
[style=\ss\bf,
color=red,
before=\blank]
 
% use a label text
 
\setuplabeltext
[Problem=Problem ]
 
% use your own numbers
 
\setuphead
[Problem]
[ownnumber=yes]
 
% increment and feed
 
\newcounter\ProblemNumber
 
\def\problem#1%
{\doglobal\increment\ProblemNumber
\Problem{\ProblemNumber}{#1}}
 
% nicer here
 
\setuplist
[Problem]
[alternative=c,
criterium=all,
width=2em,
interaction=all]
 
% the test
 
\starttext
 
List of Problems
 
\blank[big] \placelist[Problem] \blank[big]
 
\section{Tufte}
 
\input tufte
 
\problem{First problem}
 
The first problem description.
 
\section{Another Tufte}
 
\input tufte
 
\problem{Second problem}
 
Second problem description.
 
\stoptext
</texcode>
127

edits

Navigation menu