ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Does \Level2Command work?
@ 2007-03-29  8:02 Steffen Wolfrum
  2007-03-29  8:20 ` Thomas A. Schmitz
  0 siblings, 1 reply; 4+ messages in thread
From: Steffen Wolfrum @ 2007-03-29  8:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

in one of Luigi's "Grid-keeping table"-mail I saw the term "\setbox100". I didn't try that code, don't know what it means.
But it gave me the idea: is it actually possible to use numbers in defining command's names?

Something like this ...

\setuphead[Level2]
[header=empty,page=yes,numbercommand=\Level2Command,align=middle,alternative=paragraph,style=\Level2Style,before={\strut\blank[42pt]},after={\blank[12pt]}]
\setuphead[Level3]
[header=empty,page=yes,numbercommand=\Level3Command,align=middle,alternative=paragraph,style=\Level3Style,before={\strut\blank[42pt]},after={\blank[12pt]}]

... looks much clearer than using the numbers written out in letters.

Steffen

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

* Re: Does \Level2Command work?
  2007-03-29  8:02 Does \Level2Command work? Steffen Wolfrum
@ 2007-03-29  8:20 ` Thomas A. Schmitz
  2007-03-29  8:54   ` Hans Hagen
  2007-03-29 12:35   ` luigi scarso
  0 siblings, 2 replies; 4+ messages in thread
From: Thomas A. Schmitz @ 2007-03-29  8:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users


On Mar 29, 2007, at 10:02 AM, Steffen Wolfrum wrote:

> Hi,
>
> in one of Luigi's "Grid-keeping table"-mail I saw the term  
> "\setbox100". I didn't try that code, don't know what it means.
> But it gave me the idea: is it actually possible to use numbers in  
> defining command's names?
>
> Something like this ...
>
> \setuphead[Level2]
> [header=empty,page=yes,numbercommand= 
> \Level2Command,align=middle,alternative=paragraph,style= 
> \Level2Style,before={\strut\blank[42pt]},after={\blank[12pt]}]
> \setuphead[Level3]
> [header=empty,page=yes,numbercommand= 
> \Level3Command,align=middle,alternative=paragraph,style= 
> \Level3Style,before={\strut\blank[42pt]},after={\blank[12pt]}]
>
> ... looks much clearer than using the numbers written out in letters.
>
> Steffen

The command is \setbox, 100 is the argument to this command. This is  
pure \TeX, I think it could also be written as \setbox{100} (but I  
may be wrong here). In \TeX, numbers have a catcode which is  
different from letters, that's why they cannot normally be used in  
command words (they can, however, become control symbols). For more,  
see the TeXbook, chapter 3, or Eijkhout's wonderful TeX by Topic, ch. 2.

HTH

Thomas

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

* Re: Does \Level2Command work?
  2007-03-29  8:20 ` Thomas A. Schmitz
@ 2007-03-29  8:54   ` Hans Hagen
  2007-03-29 12:35   ` luigi scarso
  1 sibling, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2007-03-29  8:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Thomas A. Schmitz wrote:
> On Mar 29, 2007, at 10:02 AM, Steffen Wolfrum wrote:
>
>   
>> Hi,
>>
>> in one of Luigi's "Grid-keeping table"-mail I saw the term  
>> "\setbox100". I didn't try that code, don't know what it means.
>> But it gave me the idea: is it actually possible to use numbers in  
>> defining command's names?
>>
>> Something like this ...
>>
>> \setuphead[Level2]
>> [header=empty,page=yes,numbercommand= 
>> \Level2Command,align=middle,alternative=paragraph,style= 
>> \Level2Style,before={\strut\blank[42pt]},after={\blank[12pt]}]
>> \setuphead[Level3]
>> [header=empty,page=yes,numbercommand= 
>> \Level3Command,align=middle,alternative=paragraph,style= 
>> \Level3Style,before={\strut\blank[42pt]},after={\blank[12pt]}]
>>
>> ... looks much clearer than using the numbers written out in letters.
>>
>> Steffen
>>     
>
> The command is \setbox, 100 is the argument to this command. This is  
> pure \TeX, I think it could also be written as \setbox{100} (but I  
> may be wrong here). In \TeX, numbers have a catcode which is  
> different from letters, that's why they cannot normally be used in  
> command words (they can, however, become control symbols). For more,  
> see the TeXbook, chapter 3, or Eijkhout's wonderful TeX by Topic, ch. 2.
>
>   
\setvalue{abc123}#1{\framed{#1}}

numbercommand=\getvalue{abc123}

should work

-- 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

* Re: Does \Level2Command work?
  2007-03-29  8:20 ` Thomas A. Schmitz
  2007-03-29  8:54   ` Hans Hagen
@ 2007-03-29 12:35   ` luigi scarso
  1 sibling, 0 replies; 4+ messages in thread
From: luigi scarso @ 2007-03-29 12:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 3/29/07, Thomas A. Schmitz <thomas.schmitz@uni-bonn.de> wrote:
>
> On Mar 29, 2007, at 10:02 AM, Steffen Wolfrum wrote:
>
> > Hi,
> >
> > in one of Luigi's "Grid-keeping table"-mail I saw the term
> > "\setbox100". I didn't try that code
good, it doesn't work, sorry. (It to was too much near to time of my
return at home).

> The command is \setbox, 100 is the argument to this command. This is
> pure \TeX, I think it could also be written as \setbox{100} (but I
> may be wrong here).
hmm
 Missing number, treated as zero.
<to be read again>
                   {
l.4 \setbox{
            100}=\ruledvbox{\hsize=18cm\input tufte }




Also wonderful for a programmer:

\expandafter\def\csname VBOX 100 00 01\endcsname{FOOO}

\csname VBOX 100 00 01\endcsname -- ok
Almost anything (numbers, spaces,..): you can use a sort of namespaces

 \csname VBOX100 00 01\endcsname -- nothing, and no error
Not defined before it, but it's not en error to call it.

\VBOX100 00 01
! Undefined control sequence.
l.8 \VBOX
        100 00 01
An error, of course: I never defined it.

The context way
\setvalue{abc123}#1{\framed{#1}}

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

end of thread, other threads:[~2007-03-29 12:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-29  8:02 Does \Level2Command work? Steffen Wolfrum
2007-03-29  8:20 ` Thomas A. Schmitz
2007-03-29  8:54   ` Hans Hagen
2007-03-29 12:35   ` luigi scarso

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