Re: [NTG-context] common counter
Hallo! I'll try asking my question a little bit different: With \setupnumber[formula] [number=davidsnumber] the origin formulanumber(what is its name?) will be overwritten and replaced by davidsnumber. But with \setupnumber[figure] [number=davidsnumber] the origin figurenumbering remains untouched and davidsnumber gets an additionl counter. So there are the following questions: - Why is this different behaviour? - How can I replace the figurecounter by davidsnumber such, that captions and figuretables will use this new counter? - Are the origin formula/figure-counters compatible with counters defined by \definenumber? Or are they other animals? Wolfgang ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] common counter
Hallo! This is a question to a somewhat older post: Date: Tue, 11 Jul 2006 09:55:28 +0200 From: Hans Hagen [EMAIL PROTECTED] Subject: Re: [NTG-context] Common counter To: mailing list for ConTeXt users ntg-context@ntg.nl Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=UTF-8; format=flowed David Arnold wrote: This is excellent. Now, how can I include this \placeformula[eq:nine] \startformula f(x)=x^2 \stopformula with the same common counter as remark and definition below? hm, it's incredible what users come up with but this time you're lucky -) \defineenumeration[whatever] \definenumber[davidsnumber] \setupnumber[whatever][number=davidsnumber] \setupnumber[formula] [number=davidsnumber] % If one says additionally here: \setupnumber[figure][number=davidsnumber] \starttext \placeformula[x] \startformula x\stopformula \startwhatever x\stopwhatever \placeformula[x] \startformula y\stopformula \startwhatever y\stopwhatever % and here for example: \placefigure{image}{\framed[width=1cm,height=1cm]{image}} \stoptext then, davidsnumber is incremented by \placefigure but not used for the caption etc. How can I extend the usage of davidsnumber to captions and figuretables? Wolfgang ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
[NTG-context] Common counter for enumerations, way=bysection
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
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
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
Re: [NTG-context] Common counter
David Arnold wrote: This is excellent. Now, how can I include this \placeformula[eq:nine] \startformula f(x)=x^2 \stopformula with the same common counter as remark and definition below? hm, it's incredible what users come up with but this time you're lucky -) \defineenumeration[whatever] \definenumber[davidsnumber] \setupnumber[whatever][number=davidsnumber] \setupnumber[formula] [number=davidsnumber] \starttext \placeformula[x] \startformula x\stopformula \startwhatever x\stopwhatever \placeformula[x] \startformula y\stopformula \startwhatever y\stopwhatever \stoptext (1) can you wikify this (2) can someone add this to the test suite since we need to make sure that it keeps working Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Common counter
David Arnold wrote: All, How do you get two enumerations to use a common counter? This didn't work. just clone the definition one: \defineenumeration [remark] [location=serried, width=broad, text=Remark, headstyle=bold, inbetween=\blank, before=\blank, after=\blank, way=bysection] \defineenumeration [definition] [remark] [text=Definition] \starttext \startremark Foo \stopremark \startdefinition Foo \stopdefinition \stoptext \setupoutput[pdf] \newcounter\NonFigCtr \define\nctr{\doglobal\increment\NonFigCtr \color[red]{[\NonFigCtr]}} \defineenumeration [remark] [location=serried, width=broad, text=Remark, headstyle=bold, inbetween=\blank, before=\blank, after=\blank, way=bysection, number=nctr] \defineenumeration [definition] [location=serried, width=broad, text=Definition, headstyle=bold, inbetween=\blank, before=\blank, after=\blank, way=bysection, number=nctr] \starttext \startremark Foo \stopremark \startdefinition Foo \stopdefinition \stoptext ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context -- - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Common counter
This is excellent. Now, how can I include this \placeformula[eq:nine] \startformula f(x)=x^2 \stopformula with the same common counter as remark and definition below? just clone the definition one: \defineenumeration [remark] [location=serried, width=broad, text=Remark, headstyle=bold, inbetween=\blank, before=\blank, after=\blank, way=bysection] \defineenumeration [definition] [remark] [text=Definition] \starttext \startremark Foo \stopremark \startdefinition Foo \stopdefinition \stoptext \setupoutput[pdf] \newcounter\NonFigCtr \define\nctr{\doglobal\increment\NonFigCtr \color[red]{[\NonFigCtr]}} \defineenumeration [remark] [location=serried, width=broad, text=Remark, headstyle=bold, inbetween=\blank, before=\blank, after=\blank, way=bysection, number=nctr] \defineenumeration [definition] [location=serried, width=broad, text=Definition, headstyle=bold, inbetween=\blank, before=\blank, after=\blank, way=bysection, number=nctr] \starttext \startremark Foo \stopremark \startdefinition Foo \stopdefinition \stoptext ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context -- - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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
[NTG-context] Common counter
All, How do you get two enumerations to use a common counter? This didn't work. \setupoutput[pdf] \newcounter\NonFigCtr \define\nctr{\doglobal\increment\NonFigCtr \color[red]{[\NonFigCtr]}} \defineenumeration [remark] [location=serried, width=broad, text=Remark, headstyle=bold, inbetween=\blank, before=\blank, after=\blank, way=bysection, number=nctr] \defineenumeration [definition] [location=serried, width=broad, text=Definition, headstyle=bold, inbetween=\blank, before=\blank, after=\blank, way=bysection, number=nctr] \starttext \startremark Foo \stopremark \startdefinition Foo \stopdefinition \stoptext ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context