Re: [NTG-context] Enumerations in an environment

2018-08-13 Thread Wolfgang Schuster



Fabrice Couvreur schrieb am 13.08.18 um 12:35:

Hello,
How to have :

Démonstration --- 1.one
2.two
3.three

Thanks
Fabrice

\defineenumeration
[proof]
  [text=Démonstration,
   alternative=serried,
number=no,
   headcommand=\groupedcommand{}{~---~},
headstyle=bolditalic,
   %headcommand=\groupedcommand{}{:\,},
width=broad,
   closesymbol={\symbol[square]}]

\starttext

\startproof
\startitemize[n]
   \item one
   \item two
   \item three
\stopitemize
 \stopproof


\startproof
  \startitemize[n,text][lefttext=,righttext=]
  \item one\par
  \item two\par
  \item three
  \stopitemize
\stopproof

Wolfgang
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Enumerations in an environment

2018-08-13 Thread Fabrice Couvreur
Hello,
How to have :

Démonstration --- 1.one
2.two
3.three

Thanks
Fabrice

\defineenumeration
  [proof]
  [text=Démonstration,
   alternative=serried,
   number=no,
   headcommand=\groupedcommand{}{~---~},
   headstyle=bolditalic,
   %headcommand=\groupedcommand{}{:\,},
   width=broad,
   closesymbol={\symbol[square]}]

\starttext

\startproof
   \startitemize[n]
   \item one
   \item two
   \item three
   \stopitemize
 \stopproof

\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Enumerations

2016-05-08 Thread Pablo Rodriguez
On 05/08/2016 06:50 PM, Wolfgang Schuster wrote:
>> Pablo Rodriguez 8. Mai 2016 um 11:10
>>
>> The source includes a norepeat keyword that should disable repetition.
>>
>> But I’m a afraid it doesn’t work:
>>
>> \setupitemgroup[itemize][1][n, repeat]
>> \setupitemgroup[itemize][2][n, repeat]
>> \setupitemgroup[itemize][3][a, norepeat]
> 
> Move "norepeat" to the second level setup.
> 
> \setupitemgroup[itemize][1][n,repeat]
> \setupitemgroup[itemize][2][n,norepeat]
> \setupitemgroup[itemize][3][a]

Many thanks for your reply, Wolfgang.

That makes everything clear to me.


Pablo
-- 
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Enumerations

2016-05-08 Thread Wolfgang Schuster

Pablo Rodriguez 
8. Mai 2016 um 11:10

The source includes a norepeat keyword that should disable repetition.

But I’m a afraid it doesn’t work:

\setupitemgroup[itemize][1][n, repeat]
\setupitemgroup[itemize][2][n, repeat]
\setupitemgroup[itemize][3][a, norepeat]

Move "norepeat" to the second level setup.

\setupitemgroup[itemize][1][n,repeat]
\setupitemgroup[itemize][2][n,norepeat]
\setupitemgroup[itemize][3][a]

Wolfgang
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Enumerations

2016-05-08 Thread Otared Kavian
Hi Pablo,

You are right, the « norepeat » key does not work any more, but I do not know 
when the change, or th ebug, was introduced. In the « Teste Suite » there is a 
file entitled « repeat-001.tex » which used to give the behavoir expected by 
Henman and you, but when typeset now it gives something different. Compare the 
two attached PDF files (repeat-001.pdf is the old PDF obtained in 2012, while 
repeat-001-bis.pdf is the same file typeset with the latest beta, version 
2016-05-08 01:35).

Best regards: OK



repeat-001.pdf
Description: Adobe PDF document




repeat-00-bis.pdf
Description: Adobe PDF document

> On 08 May 2016, at 11:10, Pablo Rodriguez  wrote:
> 
> On 05/08/2016 12:07 AM, Henman wrote:
>> I am using the 'repeat' directive to cause itemizations to display upper 
>> level numbers as well as lower ones, but, sometimes I want to put it on 
>> hold and just display a simple alpha enumeration  For example at the 
>> third level.  I can't see how to turn off the repeat.
> 
> The source includes a norepeat keyword that should disable repetition.
> 
> But I’m a afraid it doesn’t work:
> 
>\setupitemgroup[itemize][1][n, repeat]
>\setupitemgroup[itemize][2][n, repeat]
>\setupitemgroup[itemize][3][a, norepeat]
> 
>\starttext
> 
>This is our item list:
> 
>\startitemize
>\item ...  % 1
>\startitemize
>\item ...  % 1.1
>\startitemize
>\item ...  % a
>\stopitemize
>\item ...  % 1.2
>\startitemize
>\item ...  % a
>\item ...  % b
>\stopitemize
>\stopitemize
>\item ...  % 2
>\stopitemize
> 
>\stoptext
> 
> I may be missing something or there might be a bug here.
> 
> 
> Pablo
> -- 
> http://www.ousia.tk
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki : http://contextgarden.net
> ___

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Enumerations

2016-05-08 Thread Pablo Rodriguez
On 05/08/2016 12:07 AM, Henman wrote:
> I am using the 'repeat' directive to cause itemizations to display upper 
> level numbers as well as lower ones, but, sometimes I want to put it on 
> hold and just display a simple alpha enumeration  For example at the 
> third level.  I can't see how to turn off the repeat.

The source includes a norepeat keyword that should disable repetition.

But I’m a afraid it doesn’t work:

\setupitemgroup[itemize][1][n, repeat]
\setupitemgroup[itemize][2][n, repeat]
\setupitemgroup[itemize][3][a, norepeat]

\starttext

This is our item list:

\startitemize
\item ...  % 1
\startitemize
\item ...  % 1.1
\startitemize
\item ...  % a
\stopitemize
\item ...  % 1.2
\startitemize
\item ...  % a
\item ...  % b
\stopitemize
\stopitemize
\item ...  % 2
\stopitemize

\stoptext

I may be missing something or there might be a bug here.


Pablo
-- 
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Enumerations

2016-05-08 Thread Henman
I am using the 'repeat' directive to cause itemizations to display upper 
level numbers as well as lower ones, but, sometimes I want to put it on 
hold and just display a simple alpha enumeration  For example at the 
third level.  I can't see how to turn off the repeat.



  1
  1.1
  1.2
   a.For example here I just want the alphabetical enumerators.
/   b.
  1.3
 2.
/
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Enumerations: location=serried ignored (Wolfgang Schuster)

2012-04-03 Thread Jeong Dalyoung
Dear Wolfgang,

To use the option title=yes in enumeration, I have encountered a unwanted 
result.
It display the first letter as a title when I didn't put title.

Would you please check the following code?

\setupenumerations[location=serried,width=broad,distance=0.5em]
\defineenumeration[theorem][text=Satz,title=yes]
\defineenumeration[corollary][counter=theorem,text=Korollar]
\starttext
\starttheorem[title={Pythagoras Theorem}]
The square on the hypotenuse is equal to the sum of the squares on
the other two sides.
\stoptheorem
\starttheorem{Pythagoras Theorem}
The square on the hypotenuse is equal to the sum of the squares on
the other two sides.
\stoptheorem
\starttheorem   %no title is suggested
The square on the hypotenuse is equal to the sum of the squares on
the other two sides.
\stoptheorem
\startcorollary
The sum of angles of a quadrilateral is 360 degrees.
\stopcorollary
\stoptext

Thank you.
Best regards,

Dalyoung
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] Enumerations: optional title (was Enumerations: location=serried ignored)

2012-04-03 Thread Wolfgang Schuster

Am 03.04.2012 um 10:50 schrieb Jeong Dalyoung:

 Dear Wolfgang,
 
 To use the option title=yes in enumeration, I have encountered a unwanted 
 result.
 It display the first letter as a title when I didn't put title.
 
 Would you please check the following code?

The optional title for enumerations isn’t yet added to the new enumeration code
and in the case where you haven’t told \starttheorem what it should take as 
title
the first token (the “T” from ”The”) is used as title.

Wolfgang
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] Enumerations: optional title (was Enumerations:location=serried ignored) (Wolfgang Schuster)

2012-04-03 Thread Jeong Dalyoung
Dear Wolfgang,

Thank you for the explanation.

The optional title for theorem is very useful in many ways. 
I hope that it is added to the new code soon.

Best regards,

Dalyoung
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] Enumerations: location=serried ignored

2012-03-28 Thread Diane Uschner

Hello,

I noticed that the enumerations environment is behaving oddly when used 
for theorem environments. In the following minimal example, the option 
location=serried (which should result in an inline heading) is ignored.


Furthermore, the number of corrolary is not displayed, instead of being 
shared with theorem. The general idea of this exaple is from [1] 
http://www.ntg.nl/maps/36/09.pdf. I've not managed to figure out on my 
own what I'm doing wrong. Any suggestions are appreciated.

Diane

Context is version 2012.03.13 21:26 MKIV  fmt: 2012.3.16  int: 
english/english.


% minimal example
\setupenumerations[location=serried,width=broad,distance=0.5em]
\defineenumeration[theorem][text=Satz,title=yes]
\defineenumeration[corollary][number=theorem,text=Korollar]

\starttext
\starttheorem[title={Pythagoras Theorem}]
The square on the hypotenuse is equal to the sum of the squares on 
the other two sides.

\stoptheorem
\startcorrolary
The sum of angles of a quadrilateral is 360 degrees.
\stopcorrolary
\stoptext


[1] http://www.ntg.nl/maps/36/09.pdf (Aditya Mahajan's Theorems in 
Context)




enumerations.pdf
Description: Adobe PDF document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Enumerations: location=serried ignored

2012-03-28 Thread dalyoung
Dear Diane,

Recently, I have seen a mail in which location= is changed to alternative= 
in mailing list.
You will get what you want if you replace 'location' with 'alternative'.

For the number of corollary, I have no idea. 
Experts in this list will tell you what to do.

Best regards,

Dalyoung

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Enumerations: location=serried ignored

2012-03-28 Thread Wolfgang Schuster

Am 28.03.2012 um 13:49 schrieb Diane Uschner:

 Hello,
 
 I noticed that the enumerations environment is behaving oddly when used for 
 theorem environments. In the following minimal example, the option 
 location=serried (which should result in an inline heading) is ignored.
 
 Furthermore, the number of corrolary is not displayed, instead of being 
 shared with theorem. The general idea of this exaple is from [1]. I've not 
 managed to figure out on my own what I'm doing wrong. Any suggestions are 
 appreciated. 

1. The “location” key was replaced with the “alternative” key.

2. You need the “counter” key to share counters.

\setupenumeration[alternative=serried,width=broad,distance=0.5em]
\defineenumeration[theorem][text=Satz,title=yes]
\defineenumeration[corollary][counter=theorem,text=Korollar]

\starttext

\starttheorem[title={Pythagoras Theorem}]
The square on the hypotenuse is equal to the sum of the squares on the 
other two sides.
\stoptheorem

\startcorollary
The sum of angles of a quadrilateral is 360 degrees.
\stopcorollary

\stoptext

Wolfgang___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Enumerations: location=serried ignored

2012-03-28 Thread Diane Uschner

Dear Wolfgang, dear list,

Am 28.03.2012 18:20, schrieb Wolfgang Schuster:

1. The “location” key was replaced with the “alternative” key.

2. You need the “counter” key to share counters.


thank you very much for your hints, now it works perfectly!

Regards
Diane
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] enumerations and definehead

2009-08-08 Thread B. Vogel
Hi all,

How do I reset an enumeration with my own header?

See the example below.
The build-in section works and my own header fails.

Tia,

Bernard


% MKIV beta
% MTXrun | current version: 2009.08.07 11:22
% linux-32

\definehead[Mysection][section]

\setuphead[Mysection]
  [after=\nowhitespace\hairline]

\defineenumeration[example]
  [way=bysection]

\starttext

\dorecurse {3} {
  \Mysection{Mysection \recurselevel}
  \dorecurse {3} {\startexample \recurselevel \stopexample}} 
\page

\dorecurse {3} {
  \section{Section \recurselevel}
  \dorecurse {3} {\startexample \recurselevel \stopexample}} 

\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Enumerations and numbered labels

2007-07-12 Thread Wolfgang Schuster
2007/7/11, Norbert Zeh [EMAIL PROTECTED]:
 Ah, excellent.  Also thanks to Wolfgang for his earlier comment.  I
 had looked at location=left before but was thrown off by the
 excessive distance between the heading and the text...until I
 discovered the meaning of width=fit.  As you can see, I'm new to
 context.

 Has anybody looked into the bug (?) with numbered labels?

 Cheers,
 Norbert

\unprotect

\def\do@@label[#1][#2]%
  {\numberparameter{#1}\c!before
   \numberparameter{#1}\c!command
 {\doattributes{\@@thenumber{#1}}\c!headstyle\c!headcolor
{%\dotextprefix{\numberparameter{#1}\c!text}%
 \getvalue{\e!next#1}[#2]}}%
   \numberparameter{#1}\c!after}%

\protect

\definelabel[frage][text=Frage,location=inmargin]

\starttext

\frage text

\stoptext

Wolfgang
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Enumerations and numbered labels

2007-07-11 Thread Aditya Mahajan
On Tue, 10 Jul 2007, Norbert Zeh wrote:

 E.g., in assignments I typeset, I often have either

 \begin{question}
 ...
 \end{question}

 which simply produces

 
 Question 1  ...
 

 or

 \begin{question}[20 marks]
 ...
 \end{question}

 which produces

 
 Question 1  (20 marks)  ...
 

 This second option is easy to simulate if I can produce something
 that has no hanging indents.  As it is, I can't.

\defineenueration[question][title=yes]

\startquestion
...
\stopquestion

and

\startquestion {20 marks}

\stopquestion

title is a relatively new feature and right now there is no 
documentation for it. Search in the dev mailing list for theorems for 
some examples. If you want some specific details, ask here. I will 
write a myway on theorems soon.


Aditya
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Enumerations and numbered labels

2007-07-11 Thread Norbert Zeh
Ah, excellent.  Also thanks to Wolfgang for his earlier comment.  I  
had looked at location=left before but was thrown off by the  
excessive distance between the heading and the text...until I  
discovered the meaning of width=fit.  As you can see, I'm new to  
context.

Has anybody looked into the bug (?) with numbered labels?

Cheers,
Norbert

On 11-Jul-07, at 4:39 AM, Aditya Mahajan wrote:

 On Tue, 10 Jul 2007, Norbert Zeh wrote:

 E.g., in assignments I typeset, I often have either

 \begin{question}
 ...
 \end{question}

 which simply produces

 
 Question 1  ...
 

 or

 \begin{question}[20 marks]
 ...
 \end{question}

 which produces

 
 Question 1  (20 marks)  ...
 

 This second option is easy to simulate if I can produce something
 that has no hanging indents.  As it is, I can't.

 \defineenueration[question][title=yes]

 \startquestion
 ...
 \stopquestion

 and

 \startquestion {20 marks}
 
 \stopquestion

 title is a relatively new feature and right now there is no
 documentation for it. Search in the dev mailing list for theorems for
 some examples. If you want some specific details, ask here. I will
 write a myway on theorems soon.


 Aditya
 __ 
 _
 If your question is of interest to others as well, please add an  
 entry to the Wiki!

 maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ 
 ntg-context
 webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
 archive  : https://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net
 __ 
 _

--
NORBERT ZEH
Faculty of Computer Science : Dalhousie University
[EMAIL PROTECTED] : http://www.cs.dal.ca/~nzeh : 902.494.3154

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] Enumerations and numbered labels

2007-07-10 Thread Norbert Zeh
Hi folks,

I've recently started to consider ConTeXt as an alternative to my  
long-time friend LaTeX.  I like ConTeXt very much but noticed a few  
things that are either less than ideal or maybe I simply haven't  
figured out yet how to do them right.  Here are the first two:

1)  Enumerations

I've read in a few places that this is what is to be used whenever I  
would use theorem-style environments in latex.  There are two things  
I seem to be unable to do:  Creating Theorems that look like this.

-
THEOREM 1  It would be nice if Context could produce a theorem where  
the title is not separated from the text and the next line has no  
hanging indent.
-

I was able to produce only

--
THEOREM 1

It would be nice ...
--

or

--
THEOREM 1  It would
 be nice ...
--

using location=top or location=hanging.  What I want is no hanging  
indent at all.  (I also tried location=serried, which produced an  
overly large gap between THEOREM 1 and the theorem text.  The second  
thing I am used to in latex is the option to place things in  
parentheses by providing an optional argument to the environment.   
E.g., in assignments I typeset, I often have either

\begin{question}
...
\end{question}

which simply produces


Question 1  ...


or

\begin{question}[20 marks]
...
\end{question}

which produces


Question 1  (20 marks)  ...


This second option is easy to simulate if I can produce something  
that has no hanging indents.  As it is, I can't.

2)  Numbered labels

I tried to use numbered labels plus a little bit of tex-code to  
simulate the above environment.  The gist is that I used

\definelabel[question][location=intext,text=Question]

to define the label and, wherever I needed a new question, \question 
[ref].

The result of writing \question[ref], however, was Question Question  
1.  The label always seemed to be duplicated for some reason.  Is  
this a known bug?

Thanks for your help with this.

Cheers,
Norbert

--
NORBERT ZEH
Faculty of Computer Science : Dalhousie University
[EMAIL PROTECTED] : http://www.cs.dal.ca/~nzeh : 902.494.3154


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Enumerations and numbered labels

2007-07-10 Thread Wolfgang Schuster
2007/7/10, Norbert Zeh [EMAIL PROTECTED]:
 Hi folks,

 I've recently started to consider ConTeXt as an alternative to my
 long-time friend LaTeX.  I like ConTeXt very much but noticed a few
 things that are either less than ideal or maybe I simply haven't
 figured out yet how to do them right.  Here are the first two:

 1)  Enumerations

 I've read in a few places that this is what is to be used whenever I
 would use theorem-style environments in latex.  There are two things
 I seem to be unable to do:  Creating Theorems that look like this.

 -
 THEOREM 1  It would be nice if Context could produce a theorem where
 the title is not separated from the text and the next line has no
 hanging indent.
 -

\defineenumeration[theorem][text=THEOREM,location=left,hang=1]

\starttext

\theorem \input knuth

\stoptext

 I was able to produce only

 --
 THEOREM 1

 It would be nice ...
 --

 or

 --
 THEOREM 1  It would
  be nice ...
 --

 using location=top or location=hanging.  What I want is no hanging
 indent at all.  (I also tried location=serried, which produced an
 overly large gap between THEOREM 1 and the theorem text.  The second
 thing I am used to in latex is the option to place things in
 parentheses by providing an optional argument to the environment.
 E.g., in assignments I typeset, I often have either

 \begin{question}
 ...
 \end{question}

 which simply produces

 
 Question 1  ...
 

 or

 \begin{question}[20 marks]
 ...
 \end{question}

 which produces

 
 Question 1  (20 marks)  ...
 

 This second option is easy to simulate if I can produce something
 that has no hanging indents.  As it is, I can't.

 2)  Numbered labels

 I tried to use numbered labels plus a little bit of tex-code to
 simulate the above environment.  The gist is that I used

 \definelabel[question][location=intext,text=Question]

 to define the label and, wherever I needed a new question, \question
 [ref].

 The result of writing \question[ref], however, was Question Question
 1.  The label always seemed to be duplicated for some reason.  Is
 this a known bug?

http://www.tug.org/pracjourn/2006-4/mahajan/

 Thanks for your help with this.

 Cheers,
 Norbert

Wolfgang
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] enumerations and fomrula with same counter

2006-07-08 Thread Mojca Miklavec
On 7/7/06, David Arnold wrote:
 All,

 Let me adjust my previous post with this request. How can I get my
 enumerations and my formulae to use the same 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

 \placeformula[eqa;one]
 \startformula
   f(x)=x^2
 \stopformula

 \startdefinition
Foo
 \stopdefinition

 \stoptext


 The goal is to have these come out:

 Remark 1.

 f(x)=x^2  (2)

 Definition 3.

 A second goal is to include the section number.

 Remark 5-1.

 f(x)=x^2  (5-2)

 Definition 5-3.

My idea was to trigger commands such as \nextdefinition, \nextremark,
\incrementnumber[formula] in after=, but \nextdefinition for example
gives an error.

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


[NTG-context] enumerations and fomrula with same counter

2006-07-07 Thread David Arnold
All,

Let me adjust my previous post with this request. How can I get my  
enumerations and my formulae to use the same 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

\placeformula[eqa;one]
\startformula
  f(x)=x^2
\stopformula

\startdefinition
   Foo
\stopdefinition

\stoptext


The goal is to have these come out:

Remark 1.

f(x)=x^2  (2)

Definition 3.

A second goal is to include the section number.

Remark 5-1.

f(x)=x^2  (5-2)

Definition 5-3.

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