Re: [NTG-context] Repeat (*) key in TaBlE

2007-10-24 Thread Aditya Mahajan
On Wed, 24 Oct 2007, Aditya Mahajan wrote:

> Restarting an old thread ...
>
> On Wed, 6 Jun 2007, Aditya Mahajan wrote:
>
>> What is the correct way of using * key with TaBlE? The following does not 
>> work
>>
>> \starttext
>>
>> \starttable[|*{2}l|]
>
> This should be [*{2}{l|}] but even then it does not work.
>
>>   \HL
>>   \NC A \NC B \NC \NR
>>   \HL
>> \stoptable
>> \starttable[|l|l|]
>>   \HL
>>   \NC A \NC B \NC \NR
>>   \HL
>> \stoptable
>>
>> \stoptext
>
> I finally found out why this is not working. \getTABLEnofcolumns does
> not expand *. For example
>
> This works fine.
> \getTABLEnofcolumns{|l|l|}
> \the\maxTABLEcolumn % gives 2.
>
> This does not.
> \getTABLEnofcolumns{|*{2}{l|}}
> \the\maxTABLEcolumn %gives 1
>
> \getTABLEnoofcolumns is simply counting the number of | in the format.
> It should first expand the *#1#2, and then do the counting. A really
> ugly workaround
>
> \starttable[|*{2}{l|}]
>   % Manually set the number of columns :-(
>   \noalign{\global\maxTABLEcolumn=2}
>   \NC AA  \NC 5 \NC \AR
>   \NC AAA \NC 6 \NC \AR
> \stoptable
>
> I do not understand TeX well enough to correct the
> \get\TABLEnofcolumns macro.

Here is another solution. We first need a fully expandable \dorecurse 
macro. I copied David Kastrup's replicate from TeX pearls
http://www-stary.gust.org.pl/pearls/2005/david-kastrup/bachotex2005-david-kastrup-pearl3.pdf

This works as expected.

\def\replicate#1#2{\ifnum#1>0 #2%
   \expandafter\replicate\expandafter{\number\numexpr#1-1}{#2}\fi}

\starttable[|\replicate{2}{l|}]
   \NC AA  \NC 5 \NC \AR
   \NC AAA \NC 6 \NC \AR
\stoptable

Questions:

1. Is there something equivalent to replicate in ConTeXt. 
(\dorecuse is not expandable)? If not, should it be added?

2. Are there any plans to ensure that the * form works? I am happy 
with the above solution, but I am curious from the purpose of 
documentation. I am writing about some the advanced features of 
\starttable. If the * version will not be supported, I can just say 
that the replicate trick is the correct way to do things.

3. BTW, there are other things that do not work with \starttable. All 
the keys of TaBlE that start with \ do not work (\LeftGlue, 
\RightGlue, \{, \|), as they are tried to be expanded, and result in 
a undefined control sequence error. One solution is to pad 
each of them with \noexpand. Are there plans to work on this, or 
should I just say (in the tugboat article) that the \noexpand is the 
correct way to do things.

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] Repeat (*) key in TaBlE

2007-10-24 Thread Aditya Mahajan
Restarting an old thread ...

On Wed, 6 Jun 2007, Aditya Mahajan wrote:

> What is the correct way of using * key with TaBlE? The following does not work
>
> \starttext
>
> \starttable[|*{2}l|]

This should be [*{2}{l|}] but even then it does not work.

>   \HL
>   \NC A \NC B \NC \NR
>   \HL
> \stoptable
> \starttable[|l|l|]
>   \HL
>   \NC A \NC B \NC \NR
>   \HL
> \stoptable
>
> \stoptext

I finally found out why this is not working. \getTABLEnofcolumns does 
not expand *. For example

This works fine.
\getTABLEnofcolumns{|l|l|}
\the\maxTABLEcolumn % gives 2.

This does not.
\getTABLEnofcolumns{|*{2}{l|}}
\the\maxTABLEcolumn %gives 1

\getTABLEnoofcolumns is simply counting the number of | in the format. 
It should first expand the *#1#2, and then do the counting. A really 
ugly workaround

\starttable[|*{2}{l|}]
   % Manually set the number of columns :-(
   \noalign{\global\maxTABLEcolumn=2}
   \NC AA  \NC 5 \NC \AR
   \NC AAA \NC 6 \NC \AR
\stoptable

I do not understand TeX well enough to correct the 
\get\TABLEnofcolumns macro.

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] Numbered subitems

2007-10-24 Thread WN

Hi Wolfgang

In the meantime I found another way of getting the desired result. I am 
now using

enumerations out of the box, without needing extra counters.
After a bit of experimenting, this is what I did

% test code
\defineenumeration[artikel][location=left,text=Artikel,headstyle=bold,stopper=.,distance=5pt,width=broad,number=yes]
\setupenumerations[subartikel][text=,location=left,stopper=.,width=broad,distance=5pt]
\starttext
\startartikel First artikel \stopartikel
\startsubartikel Text for item 1.1. \stopsubartikel
\startsubartikel Text for item 1.2 \stopsubartikel

\startartikel Second artikel \stopartikel
\startsubartikel Text for item 2.1 \stopsubartikel
\startsubartikel Text for item 2.2 \stopsubartikel
\stoptext

Anyways, thanks for your help
Kind regards
Wim Neimeijer


2007/10/23, WN <[EMAIL PROTECTED] >:

Hi,

I want to make a numbered list as follows

*Artikel 1. First artikel

*1.1. Text for item 1.1.
1.2. Text for item 1.2

*Artikel 2. Second artikel*

2.1.  Text for item 2.1
2.2.  Text for item 2.2

etc.

I am trying to accomplish this with \setupitemgroup and
\defineitemgroup as
follows, but the second level start also with Artikel and is indented.
I looked at the some of the emails relating to numbered subitems
but could not find a working example.

Thanks for any help
Wim


% test code


\def\firstlevelnumber#1{\xdef\thefirstlevelnumber{#1}#1}
\defineconversion[firstlevelnumber][\firstlevelnumber]

\def\secondlevelnumber#1{\thefirstlevelnumber.#1}
\defineconversion[secondlevelnumber][\secondlevelnumber]

\defineitemgroup[mylist][levels=2]
\setupitemgroup[mylist][1][atmargin][n,repeat]


\setupitemgroup[mylist][1][atmargin][n,firstlevelnumber]

\setupitemgroup[mylist][1][width=5em,stopper=.,headstyle=bold,left=Artikel
]
\setupitemgroup[mylist][2][atmargin][n,repeat]


\setupitemgroup[mylist][2][atmargin][n,secondlevelnumber]

\setupitemgroup[mylist][2][width=2em,stopper=.,left=]

\startext
\startmylist
\head First artikel

\startmylist
\item Text for item 1.1.
\item Text for item 1.1.
\stopmylist

\head Second artikel

\startmylist
\item Text for item 2.1
\item Text for item 2.2
\stopmylist

\stopmylist
\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
___
  


___
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] 14th century music ("Mensuralnotation")

2007-10-24 Thread Jelle Huisman

Hans Hagen wrote:
Unbelievable stuff! Byzantine notation!! I never dared to hope that  
all this is available (and even non-commercial) with fonts ...



indeed

how about adding such top level links to the wiki (some font resource page)
I have added the link to the page "Fonts by Unicode character range" to 
the main Fonts page ( 
http://wiki.contextgarden.net/Fonts#Available_Free_Fonts )


Jelle
___
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] Numbered subitems

2007-10-24 Thread Wolfgang Schuster
2007/10/23, WN <[EMAIL PROTECTED]>:
>
>  Hi,
>
> I want to make a numbered list as follows
>
> *Artikel 1. First artikel
>
> *1.1. Text for item 1.1.
> 1.2. Text for item 1.2
>
> *Artikel 2. Second artikel*
>
> 2.1.  Text for item 2.1
> 2.2.  Text for item 2.2
>
> etc.
>
> I am trying to accomplish this with \setupitemgroup and \defineitemgroup
> as
> follows, but the second level start also with Artikel and is indented.
> I looked at the some of the emails relating to numbered subitems
> but could not find a working example.
>
> Thanks for any help
> Wim
>
>
> % test code
>

\def\firstlevelnumber#1{\xdef\thefirstlevelnumber{#1}#1}
\defineconversion[firstlevelnumber][\firstlevelnumber]

\def\secondlevelnumber#1{\thefirstlevelnumber.#1}
\defineconversion[secondlevelnumber][\secondlevelnumber]

\defineitemgroup[mylist][levels=2]
> \setupitemgroup[mylist][1][atmargin][n,repeat]
>

\setupitemgroup[mylist][1][atmargin][n,firstlevelnumber]

\setupitemgroup[mylist][1][width=5em,stopper=.,headstyle=bold,left=Artikel ]
> \setupitemgroup[mylist][2][atmargin][n,repeat]
>

\setupitemgroup[mylist][2][atmargin][n,secondlevelnumber]

\setupitemgroup[mylist][2][width=2em,stopper=.,left=]
>
> \startext
> \startmylist
> \head First artikel
>
> \startmylist
> \item Text for item 1.1.
> \item Text for item 1.1.
> \stopmylist
>
> \head Second artikel
>
> \startmylist
> \item Text for item 2.1
> \item Text for item 2.2
> \stopmylist
>
> \stopmylist
> \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
___