Re: [NTG-context] One-off theorem titles

2011-03-06 Thread Wolfgang Schuster

Am 04.03.2011 um 19:56 schrieb Hans Hagen:

 On 4-3-2011 7:05, Wolfgang Schuster wrote:
 
 In which are these alternatives are better than my module__command, you 
 replace only the _ by !
 
 because an ! stands out; anyway, we should avoid multiple _ in a row

It may stand out but it looks even worse. I replaces now multiple _ except in a 
two cases where i found no solution which looks satisfying to me, this is one:

\unexpanded\def\annotation_placement_define
  {\dodoubleargument\annotation_placement__define}

\def\annotation_placement__define[#name][#command]%
  {\setvalue{annotation:#name}{#command}}

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] One-off theorem titles

2011-03-06 Thread Wolfgang Schuster

Am 06.03.2011 um 00:03 schrieb Aditya Mahajan:

 On Fri, 4 Mar 2011, Hans Hagen wrote:
 
 On 4-3-2011 7:05, Wolfgang Schuster wrote:
 
 In which are these alternatives are better than my module__command, you 
 replace only the _ by !
 
 because an ! stands out; anyway, we should avoid multiple _ in a row
 
 (i'll put a few mkvi modules in the core to get a feeling .. using _ does 
 not always look better btw)
 
 Here is an experiment with @ and _. I would prefer to change @ to :: (but for 
 that we would need to change the ptrcatcodes).


+1 for “:”

I can then change this

\unexpanded\def\annotation_placement_define
  {\dodoubleargument\annotation_placement__define}

\def\annotation_placement__define[#name][#command]%
  {\setvalue{annotation:#name}{#command}}

to (took the “o” from latex3 :)

\unexpanded\def\annotation_placement_define
  {\dodoubleargument\annotation_placement_define:oo}

\def\annotation_placement_define:oo[#name][#command]%
  {\setvalue{annotation:#name}{#command}}

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] One-off theorem titles

2011-03-05 Thread Aditya Mahajan

On Fri, 4 Mar 2011, luigi scarso wrote:


On Fri, Mar 4, 2011 at 11:33 AM, Hans Hagen pra...@wxs.nl wrote:

On 4-3-2011 12:55, Aditya Mahajan wrote:


I also like \module_command. That is better than \modulecommand
that I have been using. Of course, this means that _ should not have its
usual meaning. I haven't checked on how \unprotect works in MkII. If it
makes _ a letter, then I'll switch to \module_command.


the main disadvantage of _ (at least in the past) is that it can get
invisible on a low res screen


Another option might be to use \module.command with . having the
right catcode. That will give macro names a more OOP feel.


indeed, but unfortunately it clashes with . being other in dimensions
(althoug i can imagine that we patch luatex to accept it)

why not
\module:command


Wrong catcode :-(

I would prefer the C++ style

module::command

A single : is not visually distinct.

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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] One-off theorem titles

2011-03-05 Thread Aditya Mahajan

On Fri, 4 Mar 2011, Hans Hagen wrote:


On 4-3-2011 7:05, Wolfgang Schuster wrote:

In which are these alternatives are better than my module__command, you 
replace only the _ by !


because an ! stands out; anyway, we should avoid multiple _ in a row

(i'll put a few mkvi modules in the core to get a feeling .. using _ does not 
always look better btw)


Here is an experiment with @ and _. I would prefer to change @ to :: 
(but for that we would need to change the ptrcatcodes).


https://github.com/adityam/filter/raw/dev/t-filter.tex

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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] One-off theorem titles

2011-03-04 Thread Hans Hagen

On 4-3-2011 12:55, Aditya Mahajan wrote:


I also like \module_command. That is better than \modulecommand
that I have been using. Of course, this means that _ should not have its
usual meaning. I haven't checked on how \unprotect works in MkII. If it
makes _ a letter, then I'll switch to \module_command.


the main disadvantage of _ (at least in the past) is that it can get 
invisible on a low res screen



Another option might be to use \module.command with . having the
right catcode. That will give macro names a more OOP feel.


indeed, but unfortunately it clashes with . being other in dimensions 
(althoug i can imagine that we patch luatex to accept it)



I know that \do \dodo \dododo is not the best notation, but I don't
find _ __ ___ better.


I don’t like the __ and ___ either but do you know a better way for good
names without using do, dodo, nodo, yes or nop?


we can have module_do_bla or module_x_bla module_xx_bla etc


I find that \module__command and \module___command are hard to
distinguish. For helper macros, a better idea might be:

\module_command
\module_command!
\module_command!!


or

\module_!_command
\module_!!_command


These commands are easy to distinguish visually. But this will not work
for too well for three or four levels. I think that none of the schemes
look good for three or four levels. Perhaps we could mix both existing
schemes to get something reasonable:

\module_command
\module_command!
\module_command!do
\module_command!redo

or maybe

\module_command
\module_command_one
\module_command_two
\module_command_three


or

\module_command_a
\module_command_b
\module_command_aa (used by _a)

etc

actually we can use ^ if we want:

\module_^_command
\module_^^_command

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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] One-off theorem titles

2011-03-04 Thread Hans Hagen

On 4-3-2011 12:55, Aditya Mahajan wrote:


Another option might be to use \module.command with . having the
right catcode. That will give macro names a more OOP feel.


in a mkvi file we can actually support \module.command if we want as we 
can convert it into \module_command so both would be equivalent then


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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] One-off theorem titles

2011-03-04 Thread luigi scarso
On Fri, Mar 4, 2011 at 11:33 AM, Hans Hagen pra...@wxs.nl wrote:
 On 4-3-2011 12:55, Aditya Mahajan wrote:

 I also like \module_command. That is better than \modulecommand
 that I have been using. Of course, this means that _ should not have its
 usual meaning. I haven't checked on how \unprotect works in MkII. If it
 makes _ a letter, then I'll switch to \module_command.

 the main disadvantage of _ (at least in the past) is that it can get
 invisible on a low res screen

 Another option might be to use \module.command with . having the
 right catcode. That will give macro names a more OOP feel.

 indeed, but unfortunately it clashes with . being other in dimensions
 (althoug i can imagine that we patch luatex to accept it)
why not
\module:command
?
(it's erlang style)
-- 
luigi
___
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] One-off theorem titles

2011-03-04 Thread Wolfgang Schuster

Am 04.03.2011 um 11:33 schrieb Hans Hagen:

 I don’t like the __ and ___ either but do you know a better way for good
 names without using do, dodo, nodo, yes or nop?
 
 we can have module_do_bla or module_x_bla module_xx_bla etc

I think module_bla, module_bla_do, module_bla_redo etc. is better

 I find that \module__command and \module___command are hard to
 distinguish. For helper macros, a better idea might be:
 
 \module_command
 \module_command!
 \module_command!!
 
 or
 
 \module_!_command
 \module_!!_command

In which are these alternatives are better than my module__command, you replace 
only the _ by !

 These commands are easy to distinguish visually. But this will not work
 for too well for three or four levels. I think that none of the schemes
 look good for three or four levels. Perhaps we could mix both existing
 schemes to get something reasonable:
 
 \module_command
 \module_command!
 \module_command!do
 \module_command!redo
 
 or maybe
 
 \module_command
 \module_command_one
 \module_command_two
 \module_command_three
 
 or
 
 \module_command_a
 \module_command_b
 \module_command_aa (used by _a)

+1

 etc
 
 actually we can use ^ if we want:
 
 \module_^_command
 \module_^^_command

Just another form of module_!_command or module__command.

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] One-off theorem titles

2011-03-04 Thread Hans Hagen

On 4-3-2011 7:05, Wolfgang Schuster wrote:


In which are these alternatives are better than my module__command, you replace 
only the _ by !


because an ! stands out; anyway, we should avoid multiple _ in a row

(i'll put a few mkvi modules in the core to get a feeling .. using _ 
does not always look better btw)


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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] One-off theorem titles

2011-03-03 Thread S Barmeier
Currently I am using something like

\defineenumeration[lemma]
   [location=serried,
headstyle=bold,
text=Lemma,
width=broad,
style=italic]

to define theorems, lemmas, etc.

Sometimes a theorem or lemma will have its own name (e.g. Yoneda Lemma),
and I find it slightly cumbersome to write something like

3.1 Theorem (Yoneda Lemma)
3.1 Lemma (Yoneda)
3.1 Lemma (Yoneda Lemma)

and was really hoping that

\startlemma[text={Yoneda Lemma}]

would give me the desired

3.1 Yoneda Lemma

but it doesn't. I would like to keep the whole setup the same and only
change the text for this instance. Is there any way to implement this
except for defining a whole new enumeration for one
theorem/lemma/proposition by

\startenumeration[text={Yoneda Lemma},location= ... ]

Thank you.
Severin


___
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] One-off theorem titles

2011-03-03 Thread Otared Kavian
Hi Severin,

Maybe this is what you want:
% begin
%% defining \proclaim which is built in Plain-teX
%% but has disappeared from ConTeXt
\defineenumeration[proclaim]
[text=,
style=slanted,
title=yes,
titleleft=,
titleright=,
location=serried,
width=fit,
right={.~}]
\setupnumber[proclaim][way=bysection,numbersection=yes]
%% end definition \proclaim

%% defining \remark 
\defineenumeration[remark]
[text=,
style=rm,
title=yes,
titleleft=,
titleright=,
location=serried,
width=fit,
right={.~}]
\setupnumber[remark][number=proclaim]
%% end definition \remark

\starttext
\input knuth.tex

\startproclaim[lem:Yoneda]{Yanada Theorem}
This is a theorem in set category theory.
\stopproclaim

\startremark{Remark}
The above theorem and this remark are numbered sequentially.
\stopremark

\section{A new section}

\input knuth.tex

\startproclaim[lem:Yoneda2]{Yanada Theorem}
As said above, this is a theorem in set category theory.
\stopproclaim

\startremark{Remark}
The above theorem and this remark are numbered sequentially.
\stopremark

\stoptext
% end

Best regards: OK

On 3 mars 2011, at 09:05, S Barmeier wrote:

 Currently I am using something like
 
 \defineenumeration[lemma]
   [location=serried,
headstyle=bold,
text=Lemma,
width=broad,
style=italic]
 
 to define theorems, lemmas, etc.
 
 Sometimes a theorem or lemma will have its own name (e.g. Yoneda Lemma),
 and I find it slightly cumbersome to write something like
 
 3.1 Theorem (Yoneda Lemma)
 3.1 Lemma (Yoneda)
 3.1 Lemma (Yoneda Lemma)
 
 and was really hoping that
 
 \startlemma[text={Yoneda Lemma}]
 
 would give me the desired
 
 3.1 Yoneda Lemma
 
 but it doesn't. I would like to keep the whole setup the same and only
 change the text for this instance. Is there any way to implement this
 except for defining a whole new enumeration for one
 theorem/lemma/proposition by
 
 \startenumeration[text={Yoneda Lemma},location= ... ]
 
 Thank you.
 Severin
 
 
 ___
 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
 ___

%%
Otared Kavian
Département de Mathématiques
Université de Versailles Saint-Quentin
Bâtiment Fermat
45 avenue des Etats Unis
78035 Versailles cedex

Téléphone: +33 1 39 25 46 42
Secrétariat: +33 1 39 25 46 44 
Secrétariat: +33 1 39 25 46 46

e-mail: otared.kav...@math.uvsq.fr




___
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] One-off theorem titles numberstyle

2011-03-03 Thread S Barmeier
Thank you for the quick reply, it is getting quite close. I guess the
trick is to define an enumeration for one-off use and use title= to
fake text=. The only problem is that the number sits between text and
title. So to still be able to use \starttheorem alongside
\startproclaim{Theorem}, I would need to know how to either place the
number after the title or how to place it before the text.
I'd be interested in knowing how to do both.

Also, I have problem with the numbering mechanism and the
numberstyle/textstyle/etc.

\defineenumeration[theorem]
[text=Theorem,
numberstyle=normal,
headstyle=bold,
textstyle=caps,
number=yes]
\defineenumeration[proclaim]
[text=,
number=theorem,
headstyle=bold,
title=yes,
titleleft=,
titleright=]
\starttext

\starttheorem
Abc
\stoptheorem

\startproclaim{Special Theorem}
Def
\stopproclaim

\stoptext

This gives as is no number for \startproclaim{Special Theorem}, although
I asked for number=theorem. Also, the numberstyle of \starttheorem is
not normal, but bold, and adding textstyle=normal/caps/etc. seems to
have no effect either.

Best,
Severin




On 03/03/2011 05:43 PM, ntg-context-requ...@ntg.nl wrote:
 Maybe this is what you want:
 % begin
 %% defining \proclaim which is built in Plain-teX
 %% but has disappeared from ConTeXt
 \defineenumeration[proclaim]
   [text=,
   style=slanted,
   title=yes,
   titleleft=,
   titleright=,
   location=serried,
   width=fit,
   right={.~}]
 \setupnumber[proclaim][way=bysection,numbersection=yes]
 %% end definition \proclaim

 %% defining \remark 
 \defineenumeration[remark]
   [text=,
   style=rm,
   title=yes,
   titleleft=,
   titleright=,
   location=serried,
   width=fit,
   right={.~}]
 \setupnumber[remark][number=proclaim]
 %% end definition \remark

 \starttext
 \input knuth.tex

 \startproclaim[lem:Yoneda]{Yanada Theorem}
 This is a theorem in set category theory.
 \stopproclaim

 \startremark{Remark}
 The above theorem and this remark are numbered sequentially.
 \stopremark

 \section{A new section}

 \input knuth.tex

 \startproclaim[lem:Yoneda2]{Yanada Theorem}
 As said above, this is a theorem in set category theory.
 \stopproclaim

 \startremark{Remark}
 The above theorem and this remark are numbered sequentially.
 \stopremark

 \stoptext
 % end

 Best regards: OK

___
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] One-off theorem titles numberstyle

2011-03-03 Thread Otared Kavian
Hi Severin,

Actually if you are using mkiv, the definitions I sent this morning should be 
slightly changed: perhaps the following suits your needs (however I don't know 
how to change the style of the numbers…).

% begin
%!TEX TS-program = mkiv

%% defining \proclaim which is built in Plain-teX
%% but has disappeared from ConTeXt
%% the following is adapted for mkiv
\defineenumeration[theorem]
\setupenumerations[theorem]
[text=Theorem,
style=sc, % or slanted
title=yes,
titleleft=,
titleright={.},
location=serried,
width=fit,
right={.},
prefix=yes,
way=bysection,
]

%% defining \remark numbered with the same counter as \proclaim
\defineenumeration[proclaim][theorem] % clone proclaim
\setupenumerations[proclaim]
[text=,
style=slanted,
title=yes,
titleright={.},
location=serried,
width=fit,
right={.}]
%% end definition \remark

\starttext
\input knuth.tex

\startproclaim[lem:Yoneda]{Yoneda Theorem}
This is a theorem in set category theory.
\stopproclaim

\starttheorem 
The above theorem and this one are numbered sequentially.
\stoptheorem

\section{A new section}

\input knuth.tex

\startproclaim[lem:Yoneda]{Yoneda Theorem}
As said above, this is a theorem in set category theory.
\stopproclaim

\starttheorem 
The above theorem and this one are numbered sequentially.
\stoptheorem

\stoptext
%%% end

Best regards: OK

On 3 mars 2011, at 10:56, S Barmeier wrote:

 Thank you for the quick reply, it is getting quite close. I guess the
 trick is to define an enumeration for one-off use and use title= to
 fake text=. The only problem is that the number sits between text and
 title. So to still be able to use \starttheorem alongside
 \startproclaim{Theorem}, I would need to know how to either place the
 number after the title or how to place it before the text.
 I'd be interested in knowing how to do both.
 
 Also, I have problem with the numbering mechanism and the
 numberstyle/textstyle/etc.
 
 \defineenumeration[theorem]
[text=Theorem,
numberstyle=normal,
headstyle=bold,
textstyle=caps,
number=yes]
 \defineenumeration[proclaim]
[text=,
number=theorem,
headstyle=bold,
title=yes,
titleleft=,
titleright=]
 \starttext
 
 \starttheorem
 Abc
 \stoptheorem
 
 \startproclaim{Special Theorem}
 Def
 \stopproclaim
 
 \stoptext
 
 This gives as is no number for \startproclaim{Special Theorem}, although
 I asked for number=theorem. Also, the numberstyle of \starttheorem is
 not normal, but bold, and adding textstyle=normal/caps/etc. seems to
 have no effect either.
 
 Best,
 Severin
 
 
 
 
 On 03/03/2011 05:43 PM, ntg-context-requ...@ntg.nl wrote:
 Maybe this is what you want:
 % begin
 %% defining \proclaim which is built in Plain-teX
 %% but has disappeared from ConTeXt
 \defineenumeration[proclaim]
  [text=,
  style=slanted,
  title=yes,
  titleleft=,
  titleright=,
  location=serried,
  width=fit,
  right={.~}]
 \setupnumber[proclaim][way=bysection,numbersection=yes]
 %% end definition \proclaim
 
 %% defining \remark 
 \defineenumeration[remark]
  [text=,
  style=rm,
  title=yes,
  titleleft=,
  titleright=,
  location=serried,
  width=fit,
  right={.~}]
 \setupnumber[remark][number=proclaim]
 %% end definition \remark
 
 \starttext
 \input knuth.tex
 
 \startproclaim[lem:Yoneda]{Yanada Theorem}
 This is a theorem in set category theory.
 \stopproclaim
 
 \startremark{Remark}
 The above theorem and this remark are numbered sequentially.
 \stopremark
 
 \section{A new section}
 
 \input knuth.tex
 
 \startproclaim[lem:Yoneda2]{Yanada Theorem}
 As said above, this is a theorem in set category theory.
 \stopproclaim
 
 \startremark{Remark}
 The above theorem and this remark are numbered sequentially.
 \stopremark
 
 \stoptext
 % end
 
 Best regards: OK
 
 ___
 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] One-off theorem titles

2011-03-03 Thread Wolfgang Schuster

Am 03.03.2011 um 09:05 schrieb S Barmeier:

 \startenumeration[text={Yoneda Lemma},location= ... ]

Enumeration don’t support key-val-input for the commands and environments
(although it isn’t hard to add it). The both arguments are “[reference]”
and “{title}”.

Besides the already presented solution here is one which use the annotation
module (local replacement of the enumeration text doesn’t work because
\setupenumerations resets the counter):

\usemodule[annotation]

% solution 1

%\defineenumeration
%  [thelemma]
%  [ location=serried,
%text=Lemma,
%   width=broad]
%
%\define[2]\LemmaCommand
%  {\doiftext
%{\placeannotationtitle}
%{\setupenumerations[thelemma][text=\placeannotationtitle]}%
%   \startthelemma#2\stopthelemma}

\defineenumeration
  [thelemma]
  [ location=serried,
text=\placeannotationtitle,
   width=broad]

\define[2]\LemmaCommand
  {\doiftextelse{\placeannotationtitle}
{}
{\def\placeannotationtitle{Lemma}}%
   \startthelemma#2\stopthelemma}

\defineannotation
  [lemma]
  [alternative=command,
   command=\LemmaCommand]

% solution 2

%\defineenumeration
%  [theproclaim]
%  [ location=serried,
%text=Proclaim,
%   width=broad]
%
%\define[2]\ProclaimCommand
%  {\doiftext
%{\placeannotationtext}
%{\setupenumerations[theproclaim][text=\placeannotationtext]}%
%   \starttheproclaim#2\stoptheproclaim}

\defineenumeration
  [theproclaim]
  [ location=serried,
text=\placeannotationtext,
   width=broad]

\define[2]\ProclaimCommand
  {\doiftextelse{\placeannotationtext}
{}
{\def\placeannotationtext{Proclaim}}%
   \starttheproclaim#2\stoptheproclaim}

\defineannotation
  [proclaim]
  [alternative=command,
   command=\ProclaimCommand]

\starttext

\startlemma
…
\stoplemma

\startlemma{Another Lemma}
…
\stoplemma

\blank[2*line]

\startproclaim
…
\stopproclaim

\startproclaim[text={Another Proclaim}]
…
\stopproclaim

\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] One-off theorem titles

2011-03-03 Thread S Barmeier
With the current solution, I still have the problem that the numbers of
\starttheorem and \startproclaim{Theorem} are on the (resp.) left and
right side of the text/title and I don't know how to change that.

I still find \starttheorem[text={Special Theorem}] (and that is called
key-val-input?) the more intuitive, though. Maybe it would be worth
considering to enable such inputs - it seems many other \start...
\stop... environments allow such key-val-inputs.

The annotation module looks good from afar, I just can't find it on
contextgarden nor on tlcontrib...

Thanks,
Severin



On 03/03/2011 11:37 PM, ntg-context-requ...@ntg.nl wrote:
 Enumeration don?t support key-val-input for the commands and environments
 (although it isn?t hard to add it). The both arguments are ?[reference]?
 and ?{title}?.

 Besides the already presented solution here is one which use the annotation
 module (local replacement of the enumeration text doesn?t work because
 \setupenumerations resets the counter):

 \usemodule[annotation]

___
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] One-off theorem titles

2011-03-03 Thread Wolfgang Schuster

Am 03.03.2011 um 16:00 schrieb S Barmeier:

 With the current solution, I still have the problem that the numbers of
 \starttheorem and \startproclaim{Theorem} are on the (resp.) left and
 right side of the text/title and I don't know how to change that.

The order of the elements os fixed: textnumbertitle

 I still find \starttheorem[text={Special Theorem}] (and that is called
 key-val-input?) the more intuitive, though. Maybe it would be worth
 considering to enable such inputs - it seems many other \start...
 \stop... environments allow such key-val-inputs.

It’s a old command and the syntax has changed when Hans rewrote the command for 
MkIV.

 The annotation module looks good from afar, I just can't find it on
 contextgarden nor on tlcontrib...


It’s part of the minimals but you have to install the third party modules.

You can find it also at the modules section [1] of the wiki and a more
recent version on bitbucket [2]. There is documentation in the source
but it isn’t finished and a pdf is missing but i put a draft online [3].

[2] https://bitbucket.org/wolfs/annotation
[1] http://modules.contextgarden.net/annotation
[3] http://d.pr/7FhB

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] One-off theorem titles

2011-03-03 Thread Aditya Mahajan

On Thu, 3 Mar 2011, S Barmeier wrote:


Currently I am using something like

\defineenumeration[lemma]
  [location=serried,
   headstyle=bold,
   text=Lemma,
   width=broad,
   style=italic]

to define theorems, lemmas, etc.

Sometimes a theorem or lemma will have its own name (e.g. Yoneda Lemma),
and I find it slightly cumbersome to write something like

3.1 Theorem (Yoneda Lemma)
3.1 Lemma (Yoneda)
3.1 Lemma (Yoneda Lemma)

and was really hoping that

\startlemma[text={Yoneda Lemma}]

would give me the desired

3.1 Yoneda Lemma

but it doesn't. I would like to keep the whole setup the same and only
change the text for this instance. Is there any way to implement this
except for defining a whole new enumeration for one
theorem/lemma/proposition by

\startenumeration[text={Yoneda Lemma},location= ... ]


@Hans: Does it make sense to redo all the theorem etc using the new 
structure code? There is a little difference between


\startsection  \stopsection

\starttheorem  \stoptheorem

except that in enumerations the title is optional and there are a few 
predefined header styles (location=whatever), and enumerations have a 
closesymbol.


That will easily allow:

\startthoerem[text={Yoneda Lemma}]

etc and one will also get the option of setting the list text, bookmarks, 
and page marks.



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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] One-off theorem titles

2011-03-03 Thread Aditya Mahajan

On Thu, 3 Mar 2011, Wolfgang Schuster wrote:



Am 03.03.2011 um 09:05 schrieb S Barmeier:


\startenumeration[text={Yoneda Lemma},location= ... ]


Enumeration don’t support key-val-input for the commands and environments
(although it isn’t hard to add it). The both arguments are “[reference]”
and “{title}”.

Besides the already presented solution here is one which use the annotation
module (local replacement of the enumeration text doesn’t work because
\setupenumerations resets the counter):

\usemodule[annotation]


A very useful module to have! But how is it different from enumerations 
(apart from having a modern interface)? in particular, would you consider 
reimplimenting definitions and enumerations by using annotations as a 
base?


I am a bit surprised by the naming of the internal macros:

annotation_cmd
annotation__cmd
annotation___cmd

I know that \do \dodo \dododo is not the best notation, but I don't find 
_ __ ___ better.


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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] One-off theorem titles

2011-03-03 Thread Wolfgang Schuster

Am 03.03.2011 um 19:18 schrieb Aditya Mahajan:

 \usemodule[annotation]
 
 A very useful module to have! But how is it different from enumerations 
 (apart from having a modern interface)? in particular, would you consider 
 reimplimenting definitions and enumerations by using annotations as a base?

That’s only one way what you can use the module for. The main purpose are todo 
lists etc., e.g.

\defineannotation[todo]

\starttext

\todo{Add a table}

\stoptext

And later you can remove all remaining \todo texts with 
\setupannotation[todo][alternative=none]

 I am a bit surprised by the naming of the internal macros:
 
 annotation_cmd
 annotation__cmd
 annotation___cmd

I liked the LaTeX3 system to have names in the form \module_command,
with this you have a easy way to protect internal commands and to avoid
command clashes, e.g. you define the command \getfirstcharacter in your
filter module but this name is already used in the core (syst-aux.mkiv)
and with the name \filter_getfirstcharacter you can avoid this without
thinking too much about a good name.

 I know that \do \dodo \dododo is not the best notation, but I don't find _ __ 
 ___ better.

I don’t like the __ and ___ either but do you know a better way for good
names without using do, dodo, nodo, yes or nop?

I first thought about this:

\def\module_command
  {\dosingleempty\module_docommand}

\def\module_docommand[#1]{}

but i don’t liked it and in the end i use now this:

\def\module_command
  {\dosingleempty\module__command}

\def\module__command[#1]{}

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] One-off theorem titles

2011-03-03 Thread Aditya Mahajan

On Thu, 3 Mar 2011, Wolfgang Schuster wrote:




I am a bit surprised by the naming of the internal macros:

annotation_cmd
annotation__cmd
annotation___cmd


I liked the LaTeX3 system to have names in the form \module_command,
with this you have a easy way to protect internal commands and to avoid
command clashes,


I also like \module_command. That is better than \modulecommand 
that I have been using. Of course, this means that _ should not have its 
usual meaning. I haven't checked on how \unprotect works in MkII. If it 
makes _ a letter, then I'll switch to \module_command.


Another option might be to use \module.command with . having the right 
catcode. That will give macro names a more OOP feel.



e.g. you define the command \getfirstcharacter in your
filter module but this name is already used in the core (syst-aux.mkiv)
and with the name \filter_getfirstcharacter you can avoid this without
thinking too much about a good name.


I didn't know that. I'll change that name.

So far, I have been using \externafilltercommand for 
most commands, and sometimes it gets unreadable.



I know that \do \dodo \dododo is not the best notation, but I don't find _ __ 
___ better.


I don’t like the __ and ___ either but do you know a better way for good
names without using do, dodo, nodo, yes or nop?


I find that \module__command and \module___command are hard to 
distinguish. For helper macros, a better idea might be:


\module_command
\module_command!
\module_command!!

These commands are easy to distinguish visually. But this will not work 
for too well for three or four levels. I think that none of the schemes 
look good for three or four levels. Perhaps we could mix both existing 
schemes to get something reasonable:


\module_command
\module_command!
\module_command!do
\module_command!redo

or maybe

\module_command
\module_command_one
\module_command_two
\module_command_three

etc.

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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___