ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* One-off theorem titles
       [not found] <mailman.1142.1298911160.4223.ntg-context@ntg.nl>
@ 2011-03-03  8:05 ` S Barmeier
  2011-03-03  8:43   ` Otared Kavian
                     ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: S Barmeier @ 2011-03-03  8:05 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________


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

* Re: One-off theorem titles
  2011-03-03  8:05 ` One-off theorem titles S Barmeier
@ 2011-03-03  8:43   ` Otared Kavian
  2011-03-03 14:18   ` Wolfgang Schuster
  2011-03-03 18:07   ` Aditya Mahajan
  2 siblings, 0 replies; 19+ messages in thread
From: Otared Kavian @ 2011-03-03  8:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2935 bytes --]

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.Kavian@math.uvsq.fr





[-- Attachment #1.2: Type: text/html, Size: 5614 bytes --]

[-- Attachment #2: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

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

* Re: One-off theorem titles
  2011-03-03  8:05 ` One-off theorem titles S Barmeier
  2011-03-03  8:43   ` Otared Kavian
@ 2011-03-03 14:18   ` Wolfgang Schuster
  2011-03-03 18:18     ` Aditya Mahajan
  2011-03-03 18:07   ` Aditya Mahajan
  2 siblings, 1 reply; 19+ messages in thread
From: Wolfgang Schuster @ 2011-03-03 14:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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
___________________________________________________________________________________


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

* Re: One-off theorem titles
  2011-03-03  8:05 ` One-off theorem titles S Barmeier
  2011-03-03  8:43   ` Otared Kavian
  2011-03-03 14:18   ` Wolfgang Schuster
@ 2011-03-03 18:07   ` Aditya Mahajan
  2 siblings, 0 replies; 19+ messages in thread
From: Aditya Mahajan @ 2011-03-03 18:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


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

* Re: One-off theorem titles
  2011-03-03 14:18   ` Wolfgang Schuster
@ 2011-03-03 18:18     ` Aditya Mahajan
  2011-03-03 18:31       ` Wolfgang Schuster
  0 siblings, 1 reply; 19+ messages in thread
From: Aditya Mahajan @ 2011-03-03 18:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1009 bytes --]

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

[-- Attachment #2: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

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

* Re: One-off theorem titles
  2011-03-03 18:18     ` Aditya Mahajan
@ 2011-03-03 18:31       ` Wolfgang Schuster
  2011-03-03 23:55         ` Aditya Mahajan
  0 siblings, 1 reply; 19+ messages in thread
From: Wolfgang Schuster @ 2011-03-03 18:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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
___________________________________________________________________________________


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

* Re: One-off theorem titles
  2011-03-03 18:31       ` Wolfgang Schuster
@ 2011-03-03 23:55         ` Aditya Mahajan
  2011-03-04 10:33           ` Hans Hagen
  2011-03-04 10:36           ` Hans Hagen
  0 siblings, 2 replies; 19+ messages in thread
From: Aditya Mahajan @ 2011-03-03 23:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2034 bytes --]

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 \<module><command> 
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 \externafillter<command> 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

[-- Attachment #2: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

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

* Re: One-off theorem titles
  2011-03-03 23:55         ` Aditya Mahajan
@ 2011-03-04 10:33           ` Hans Hagen
  2011-03-04 10:36             ` luigi scarso
  2011-03-04 18:05             ` Wolfgang Schuster
  2011-03-04 10:36           ` Hans Hagen
  1 sibling, 2 replies; 19+ messages in thread
From: Hans Hagen @ 2011-03-04 10:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

> I also like \<module>_<command>. That is better than \<module><command>
> 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
___________________________________________________________________________________


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

* Re: One-off theorem titles
  2011-03-03 23:55         ` Aditya Mahajan
  2011-03-04 10:33           ` Hans Hagen
@ 2011-03-04 10:36           ` Hans Hagen
  1 sibling, 0 replies; 19+ messages in thread
From: Hans Hagen @ 2011-03-04 10:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


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

* Re: One-off theorem titles
  2011-03-04 10:33           ` Hans Hagen
@ 2011-03-04 10:36             ` luigi scarso
  2011-03-05 22:15               ` Aditya Mahajan
  2011-03-04 18:05             ` Wolfgang Schuster
  1 sibling, 1 reply; 19+ messages in thread
From: luigi scarso @ 2011-03-04 10:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, Mar 4, 2011 at 11:33 AM, Hans Hagen <pragma@wxs.nl> wrote:
> On 4-3-2011 12:55, Aditya Mahajan wrote:
>
>> I also like \<module>_<command>. That is better than \<module><command>
>> 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
___________________________________________________________________________________


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

* Re: One-off theorem titles
  2011-03-04 10:33           ` Hans Hagen
  2011-03-04 10:36             ` luigi scarso
@ 2011-03-04 18:05             ` Wolfgang Schuster
  2011-03-04 18:56               ` Hans Hagen
  1 sibling, 1 reply; 19+ messages in thread
From: Wolfgang Schuster @ 2011-03-04 18:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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
___________________________________________________________________________________


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

* Re: One-off theorem titles
  2011-03-04 18:05             ` Wolfgang Schuster
@ 2011-03-04 18:56               ` Hans Hagen
  2011-03-05 23:03                 ` Aditya Mahajan
  2011-03-06  8:17                 ` Wolfgang Schuster
  0 siblings, 2 replies; 19+ messages in thread
From: Hans Hagen @ 2011-03-04 18:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


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

* Re: One-off theorem titles
  2011-03-04 10:36             ` luigi scarso
@ 2011-03-05 22:15               ` Aditya Mahajan
  0 siblings, 0 replies; 19+ messages in thread
From: Aditya Mahajan @ 2011-03-05 22:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, 4 Mar 2011, luigi scarso wrote:

> On Fri, Mar 4, 2011 at 11:33 AM, Hans Hagen <pragma@wxs.nl> wrote:
>> On 4-3-2011 12:55, Aditya Mahajan wrote:
>>
>>> I also like \<module>_<command>. That is better than \<module><command>
>>> 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
___________________________________________________________________________________


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

* Re: One-off theorem titles
  2011-03-04 18:56               ` Hans Hagen
@ 2011-03-05 23:03                 ` Aditya Mahajan
  2011-03-06  5:39                   ` Underscore catcode in MkII (was Re: One-off theorem titles) Aditya Mahajan
  2011-03-06  8:44                   ` One-off theorem titles Wolfgang Schuster
  2011-03-06  8:17                 ` Wolfgang Schuster
  1 sibling, 2 replies; 19+ messages in thread
From: Aditya Mahajan @ 2011-03-05 23:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


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

* Underscore catcode in MkII (was Re: One-off theorem titles)
  2011-03-05 23:03                 ` Aditya Mahajan
@ 2011-03-06  5:39                   ` Aditya Mahajan
  2011-03-06 11:07                     ` Hans Hagen
  2011-03-06  8:44                   ` One-off theorem titles Wolfgang Schuster
  1 sibling, 1 reply; 19+ messages in thread
From: Aditya Mahajan @ 2011-03-06  5:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sat, 5 Mar 2011, Aditya Mahajan wrote:

> 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

@Hans: does it make sense to change the catcode of underscore to letter in 
ptrcatcodes in MkII? Or would that just open a pandora's box?

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
___________________________________________________________________________________


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

* Re: One-off theorem titles
  2011-03-04 18:56               ` Hans Hagen
  2011-03-05 23:03                 ` Aditya Mahajan
@ 2011-03-06  8:17                 ` Wolfgang Schuster
  1 sibling, 0 replies; 19+ messages in thread
From: Wolfgang Schuster @ 2011-03-06  8:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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
___________________________________________________________________________________


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

* Re: One-off theorem titles
  2011-03-05 23:03                 ` Aditya Mahajan
  2011-03-06  5:39                   ` Underscore catcode in MkII (was Re: One-off theorem titles) Aditya Mahajan
@ 2011-03-06  8:44                   ` Wolfgang Schuster
  1 sibling, 0 replies; 19+ messages in thread
From: Wolfgang Schuster @ 2011-03-06  8:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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
___________________________________________________________________________________


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

* Re: Underscore catcode in MkII (was Re: One-off theorem titles)
  2011-03-06  5:39                   ` Underscore catcode in MkII (was Re: One-off theorem titles) Aditya Mahajan
@ 2011-03-06 11:07                     ` Hans Hagen
  2011-03-06 16:59                       ` Aditya Mahajan
  0 siblings, 1 reply; 19+ messages in thread
From: Hans Hagen @ 2011-03-06 11:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 6-3-2011 6:39, Aditya Mahajan wrote:
> On Sat, 5 Mar 2011, Aditya Mahajan wrote:
>
>> 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
>
> @Hans: does it make sense to change the catcode of underscore to letter
> in ptrcatcodes in MkII? Or would that just open a pandora's box?

i have no clue ... in mkiv we have a pseudo active _ in math mode that 
handles it there (these "8000 codes) .. so doing it will take quite some 
testing so best postpone it till after the tex live code freeze as mkii 
is the context on tex live

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
___________________________________________________________________________________


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

* Re: Underscore catcode in MkII (was Re: One-off theorem titles)
  2011-03-06 11:07                     ` Hans Hagen
@ 2011-03-06 16:59                       ` Aditya Mahajan
  0 siblings, 0 replies; 19+ messages in thread
From: Aditya Mahajan @ 2011-03-06 16:59 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

On Sun, 6 Mar 2011, Hans Hagen wrote:

>> @Hans: does it make sense to change the catcode of underscore to letter
>> in ptrcatcodes in MkII? Or would that just open a pandora's box?
>
> i have no clue ... in mkiv we have a pseudo active _ in math mode that 
> handles it there (these "8000 codes) .. so doing it will take quite some 
> testing so best postpone it till after the tex live code freeze as mkii is 
> the context on tex live

OK. I will use a private catcode table in my module, so that it works wit 
both MkII and MkIV.

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
___________________________________________________________________________________


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

end of thread, other threads:[~2011-03-06 16:59 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.1142.1298911160.4223.ntg-context@ntg.nl>
2011-03-03  8:05 ` One-off theorem titles S Barmeier
2011-03-03  8:43   ` Otared Kavian
2011-03-03 14:18   ` Wolfgang Schuster
2011-03-03 18:18     ` Aditya Mahajan
2011-03-03 18:31       ` Wolfgang Schuster
2011-03-03 23:55         ` Aditya Mahajan
2011-03-04 10:33           ` Hans Hagen
2011-03-04 10:36             ` luigi scarso
2011-03-05 22:15               ` Aditya Mahajan
2011-03-04 18:05             ` Wolfgang Schuster
2011-03-04 18:56               ` Hans Hagen
2011-03-05 23:03                 ` Aditya Mahajan
2011-03-06  5:39                   ` Underscore catcode in MkII (was Re: One-off theorem titles) Aditya Mahajan
2011-03-06 11:07                     ` Hans Hagen
2011-03-06 16:59                       ` Aditya Mahajan
2011-03-06  8:44                   ` One-off theorem titles Wolfgang Schuster
2011-03-06  8:17                 ` Wolfgang Schuster
2011-03-04 10:36           ` Hans Hagen
2011-03-03 18:07   ` Aditya Mahajan

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).