[NTG-context] Common counter for enumerations, way=bysection

2006-07-12 Thread David Arnold
All, 2 questions: (1) why don't my chapter numbers turn off, and (2),  
why doesn't the counter start over in the new section?

\setupwhitespace[medium]
\setupindenting[medium,yes]

\def\N{{\Bbb N}}
\def\W{{\Bbb W}}
\def\Z{{\Bbb Z}}
\def\Q{{\Bbb Q}}
\def\R{{\Bbb R}}

\defineenumeration
[definition]
[location=serried,
width=broad,
distance=1em,
headstyle=bold,
text=Definition,
stopper=.,
right=.,
style=slanted,
inbetween=\blank,
before=\blank
after=\blank,
way=bysection,
chapternumber=no,
number=yes]

\defineenumeration
[example]
[location=serried,
width=broad,
distance=1em,
headstyle=bold,
text=Example,
stopper=.,
right=.,
style=slanted,
inbetween=\blank,
before=\blank
after=\blank,
way=bysection,
chapternumber=no,
number=yes]

\defineenumeration
[theorem]
[location=serried,
width=broad,
distance=1em,
headstyle=bold,
text=Theorem,
stopper=.,
right=.,
style=slanted,
inbetween=\blank,
before=\blank
after=\blank,
way=bysection,
chapternumber=no,
number=yes]

\defineenumeration
[property]
[location=serried,
width=broad,
distance=1em,
headstyle=bold,
text=Property,
stopper=.,
right=.,
style=slanted,
inbetween=\blank,
before=\blank
after=\blank,
way=bysection,
chapternumber=no,
number=yes]


\definenumber[CommonCtr]

\setupnumber[example][number=CommonCtr]
\setupnumber[theorem][number=CommonCtr]
\setupnumber[property][number=CommonCtr]
\setupnumber[definition][number=CommonCtr]
\setupnumber[formula] [number=CommonCtr]

\setuphead
[subsection]
[number=no]

\starttext

\chapter[sec:first]{First}

\section[section:numbers]{Number Systems}

\input tufte

\startdefinition
   Now is the time
\stopdefinition

\startdefinition
   Now is the time
\stopdefinition

\placeformula[eq:1]
\startformula
   f(x)=x^3
\stopformula

\starttheorem[thm:one]
   A fine time.
\stoptheorem

\placeformula[eq:1]
\startformula
   f(x)=x^3
\stopformula

\startexample[exmpl:one]
fine example
\stopexample

\startproperty
   A list.
\stopproperty

\section[section:two]{Section Two}

\input tufte

\startdefinition
   Now is the time
\stopdefinition

\stoptext


___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Common counter for enumerations, way=bysection

2006-07-12 Thread Taco Hoekwater


David Arnold wrote:
 All, 2 questions: (1) why don't my chapter numbers turn off, and 

I do not know. You had a comma missing after the before= line,
and the stopper= is superfluous i think, but both appear unrelated.

(It is probably related to the change to using CommonCtr, but
I do not see how exactly).

(2),  why doesn't the counter start over in the new section?

That one, I do know:

   \definenumber[CommonCtr][way=bysection]

Btw, you can greatly reduce the number of code lines needed by doing
the definitions like so:

   \defineenumeration [property][text=Property] % five lines like this

   \setupenumerations
   [example,theorem,property,definition,formula] % one single block
   [location=serried,
width=broad,
distance=1em,
headstyle=bold,
style=slanted,
right=.,
inbetween=\blank,
before=\blank,
after=\blank,
number=yes,
chapternumber=no]

Greetings, Taco
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Common counter for enumerations, way=bysection

2006-07-12 Thread David Arnold
This seems to be what I want, but the two uses of sectionnumber=no  
seem so redundant.

\setupwhitespace[medium]
\setupindenting[medium,yes]

\def\N{{\Bbb N}}
\def\W{{\Bbb W}}
\def\Z{{\Bbb Z}}
\def\Q{{\Bbb Q}}
\def\R{{\Bbb R}}

\defineenumeration[definition][text=Definition]
\defineenumeration[example][text=Example]
\defineenumeration[theorem][text=Theorem]
\defineenumeration[property][text=Property]

\setupenumerations
[definition,example,theorem,property,formula]
[location=serried,
width=broad,
distance=1em,
headstyle=bold,
right=.,
style=slanted,
inbetween=\blank,
before=\blank,
after=\blank,
way=bysection,
sectionnumber=no,
number=yes]

\definenumber[CommonCtr][way=bysection,sectionnumber=no]

\setupnumber[example][number=CommonCtr]
\setupnumber[theorem][number=CommonCtr]
\setupnumber[property][number=CommonCtr]
\setupnumber[definition][number=CommonCtr]
\setupnumber[formula] [number=CommonCtr]

\setuphead
[subsection]
[number=no]

\starttext

\chapter[sec:first]{First}

\section[section:numbers]{Number Systems}

\input tufte

\startdefinition
   Now is the time
\stopdefinition

\startdefinition
   Now is the time
\stopdefinition

\placeformula[eq:1]
\startformula
   f(x)=x^3
\stopformula

\starttheorem[thm:one]
   A fine time.
\stoptheorem

\placeformula[eq:2]
\startformula
   f(x)=x^3
\stopformula

\startexample[exmpl:one]
fine example
\stopexample

\startproperty
   A list.
\stopproperty

\section[section:two]{Section Two}

\input tufte

\startdefinition
   Now is the time
\stopdefinition

\section[section:two]{Two}

\input tufte

\startdefinition
   Now is the time
\stopdefinition

\startdefinition
   Now is the time
\stopdefinition

\placeformula[eq:3]
\startformula
   f(x)=x^3
\stopformula

\starttheorem[thm:two]
   A fine time.
\stoptheorem

\placeformula[eq:4]
\startformula
   f(x)=x^3
\stopformula

\startexample[exmpl:two]
fine example
\stopexample

\startproperty
   A list.
\stopproperty

\section[section:two]{Section Two}

\input tufte

\startdefinition
   Now is the time
\stopdefinition

\stoptext



On Jul 12, 2006, at 2:28 AM, Taco Hoekwater wrote:



 David Arnold wrote:
 All, 2 questions: (1) why don't my chapter numbers turn off, and

 I do not know. You had a comma missing after the before= line,
 and the stopper= is superfluous i think, but both appear unrelated.

 (It is probably related to the change to using CommonCtr, but
 I do not see how exactly).

 (2),  why doesn't the counter start over in the new section?

 That one, I do know:

\definenumber[CommonCtr][way=bysection]

 Btw, you can greatly reduce the number of code lines needed by doing
 the definitions like so:

\defineenumeration [property]  [text=Property] % five lines like  
 this

\setupenumerations
[example,theorem,property,definition,formula] % one single block
[location=serried,
 width=broad,
 distance=1em,
 headstyle=bold,
 style=slanted,
 right=.,
 inbetween=\blank,
 before=\blank,
 after=\blank,
 number=yes,
 chapternumber=no]

 Greetings, Taco
 ___
 ntg-context mailing list
 ntg-context@ntg.nl
 http://www.ntg.nl/mailman/listinfo/ntg-context

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context