ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Common counter for enumerations, way=bysection
@ 2006-07-12  8:47 David Arnold
  2006-07-12  9:28 ` Taco Hoekwater
  0 siblings, 1 reply; 3+ messages in thread
From: David Arnold @ 2006-07-12  8:47 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Common counter for enumerations, way=bysection
  2006-07-12  8:47 Common counter for enumerations, way=bysection David Arnold
@ 2006-07-12  9:28 ` Taco Hoekwater
  2006-07-12  9:47   ` David Arnold
  0 siblings, 1 reply; 3+ messages in thread
From: Taco Hoekwater @ 2006-07-12  9:28 UTC (permalink / raw)




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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Common counter for enumerations, way=bysection
  2006-07-12  9:28 ` Taco Hoekwater
@ 2006-07-12  9:47   ` David Arnold
  0 siblings, 0 replies; 3+ messages in thread
From: David Arnold @ 2006-07-12  9:47 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-07-12  9:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-12  8:47 Common counter for enumerations, way=bysection David Arnold
2006-07-12  9:28 ` Taco Hoekwater
2006-07-12  9:47   ` David Arnold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).