ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Basic \def error?
@ 2013-04-23 17:04 Verhaag, G.C.H.M.
  2013-04-23 17:08 ` luigi scarso
  0 siblings, 1 reply; 6+ messages in thread
From: Verhaag, G.C.H.M. @ 2013-04-23 17:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi ConTeXt User's,

Again I'm struggling with MKIV!

I get the following error message:

! Argument of \HeadTitle has an extra }

My environment file contains the following definition:

\def\HeadTitle#1#2%
   {\hbox to \hsize \bgroup
    \hfill
    \lbox to 2cm{\hsize 7cm #2}%
    \egroup}

\setuphead
   [chapter]
   [command=\HeadTitle]

In the text I use:

\chapter[voorwrd]{Voorwoord}

I updated to the following version:

ConTeXt  ver: 2013.04.20 01:15 MKIV current  fmt: 2013.4.22  int: 
english/english,

but must admit that I haven't used ConTeXt for quite a while!

Probably I've missed something but couldn't find any hint from the mail 
archive to solve this problem, sorry!

Regards,
Verhaag,G.C.H.M.

___________________________________________________________________________________
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] 6+ messages in thread

* Re: Basic \def error?
  2013-04-23 17:04 Basic \def error? Verhaag, G.C.H.M.
@ 2013-04-23 17:08 ` luigi scarso
  2013-04-23 18:11   ` Verhaag, G.C.H.M.
  2013-04-23 21:33   ` Wolfgang Schuster
  0 siblings, 2 replies; 6+ messages in thread
From: luigi scarso @ 2013-04-23 17:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Tue, Apr 23, 2013 at 7:04 PM, Verhaag, G.C.H.M. <verhaaggchm@ziggo.nl> wrote:
> Hi ConTeXt User's,
>
> Again I'm struggling with MKIV!
>
> I get the following error message:
>
> ! Argument of \HeadTitle has an extra }
>
> My environment file contains the following definition:
>
> \def\HeadTitle#1#2%
>   {\hbox to \hsize \bgroup
>    \hfill
>    \lbox to 2cm{\hsize 7cm #2}%
>    \egroup}

\unexpanded\def\HeadTitle#1#2%
  {\hbox to \hsize \bgroup
    \hfill
    \lbox to 2cm{\hsize 7cm #2}%
    \egroup}



--
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] 6+ messages in thread

* Re: Basic \def error?
  2013-04-23 17:08 ` luigi scarso
@ 2013-04-23 18:11   ` Verhaag, G.C.H.M.
  2013-04-23 22:20     ` Wolfgang Schuster
  2013-04-23 21:33   ` Wolfgang Schuster
  1 sibling, 1 reply; 6+ messages in thread
From: Verhaag, G.C.H.M. @ 2013-04-23 18:11 UTC (permalink / raw)
  To: ntg-context

Hi Luigi,

Thanks for your very quick response, just great! Your suggestion works!

By the way, what does this expanded mean, is it documented somewhere? Is 
it a typical MKIV thing related to Lua?

Regards,
Verhaag, G.C.H.M.

On 04/23/2013 07:08 PM, luigi scarso wrote:
> On Tue, Apr 23, 2013 at 7:04 PM, Verhaag, G.C.H.M.<verhaaggchm@ziggo.nl>  wrote:
>    
>> Hi ConTeXt User's,
>>
>> Again I'm struggling with MKIV!
>>
>> I get the following error message:
>>
>> ! Argument of \HeadTitle has an extra }
>>
>> My environment file contains the following definition:
>>
>> \def\HeadTitle#1#2%
>>    {\hbox to \hsize \bgroup
>>     \hfill
>>     \lbox to 2cm{\hsize 7cm #2}%
>>     \egroup}
>>      
> \unexpanded\def\HeadTitle#1#2%
>    {\hbox to \hsize \bgroup
>      \hfill
>      \lbox to 2cm{\hsize 7cm #2}%
>      \egroup}
>
>
>
> --
> 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
> ___________________________________________________________________________________
>
>    


-- 
Afz.: Geert C.H.M. Verhaag
       St. Jorisstraat 29
       5954 AN Beesel
       NETHERLANDS

       Tel.: +31-(0)774742493, E-mail: verhaaggchm@ziggo.nl

Ik vertrouw erop dat de persoonlijke gegevens, te vinden in deze mail,
uitsluitend voor correspondentie met ondergetekende worden gebruikt en
beslist niet voor reclamedoeleinden of welke andere wijze dan ook. Het
opnemen van deze gegevens, in welk soort van opslagsysteem dan ook,
evenals het doorgeven ervan aan derden, zie ik als een schending van
mijn privacy.

___________________________________________________________________________________
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] 6+ messages in thread

* Re: Basic \def error?
  2013-04-23 17:08 ` luigi scarso
  2013-04-23 18:11   ` Verhaag, G.C.H.M.
@ 2013-04-23 21:33   ` Wolfgang Schuster
  1 sibling, 0 replies; 6+ messages in thread
From: Wolfgang Schuster @ 2013-04-23 21:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 23.04.2013 um 19:08 schrieb luigi scarso <luigi.scarso@gmail.com>:

> On Tue, Apr 23, 2013 at 7:04 PM, Verhaag, G.C.H.M. <verhaaggchm@ziggo.nl> wrote:
>> Hi ConTeXt User's,
>> 
>> Again I'm struggling with MKIV!
>> 
>> I get the following error message:
>> 
>> ! Argument of \HeadTitle has an extra }
>> 
>> My environment file contains the following definition:
>> 
>> \def\HeadTitle#1#2%
>>  {\hbox to \hsize \bgroup
>>   \hfill
>>   \lbox to 2cm{\hsize 7cm #2}%
>>   \egroup}
> 
> \unexpanded\def\HeadTitle#1#2%
>  {\hbox to \hsize \bgroup
>    \hfill
>    \lbox to 2cm{\hsize 7cm #2}%
>    \egroup}

\define[2]\HeadTitle
  {\startframedtext[right][height=2cm,width=7cm,frame=off,offset=none,align=flushright]
   #2
   \stopframedtext}

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] 6+ messages in thread

* Re: Basic \def error?
  2013-04-23 18:11   ` Verhaag, G.C.H.M.
@ 2013-04-23 22:20     ` Wolfgang Schuster
  2013-04-25 12:10       ` Verhaag, G.C.H.M.
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Schuster @ 2013-04-23 22:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 23.04.2013 um 20:11 schrieb "Verhaag, G.C.H.M." <verhaaggchm@ziggo.nl>:

> Hi Luigi,
> 
> Thanks for your very quick response, just great! Your suggestion works!
> 
> By the way, what does this expanded mean, is it documented somewhere? Is it a typical MKIV thing related to Lua?

It’s a typical way in MkIV to check for the existing of values in “command” keys but it has nothing to do with Lua.


I can demonstrate the purpose of \unexpanded with the following example. First I create the two
command \one and \two, afterwards I add \expandedone and \expandedtwo which hold the
expanded values of \one and \two.

As you can see I get the same text with \one and \expandedone. In the next step I redefine \one
and \two to hold a new value and compare again the content of all four macros. Unlike in the
previous output \one and \expandedone are different while \two and \expandedtwo show
the same result. The reason why \expandedtwo show “Second” is that \unexpanded\def
prevented the expansion of \two in \edef\expandedtwo{…}.

\starttext

           \def\one{One}
\unexpanded\def\two{Two}

\edef\expandedone{\one}
\edef\expandedtwo{\two}

\startlines
\one:\expandedone
\two:\expandedtwo
\stoplines

\def\one{First}
\def\two{Second}

\startlines
\one:\expandedone
\two:\expandedtwo
\stoplines

\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] 6+ messages in thread

* Re: Basic \def error?
  2013-04-23 22:20     ` Wolfgang Schuster
@ 2013-04-25 12:10       ` Verhaag, G.C.H.M.
  0 siblings, 0 replies; 6+ messages in thread
From: Verhaag, G.C.H.M. @ 2013-04-25 12:10 UTC (permalink / raw)
  To: ntg-context

Hi,

Thank you very much for the explanation, now it's clear to me!

Regards,
Verhaag, G.C.H.M.

On 04/24/2013 12:20 AM, Wolfgang Schuster wrote:
> Am 23.04.2013 um 20:11 schrieb "Verhaag, G.C.H.M."<verhaaggchm@ziggo.nl>:
>
>    
>> Hi Luigi,
>>
>> Thanks for your very quick response, just great! Your suggestion works!
>>
>> By the way, what does this expanded mean, is it documented somewhere? Is it a typical MKIV thing related to Lua?
>>      
> It’s a typical way in MkIV to check for the existing of values in “command” keys but it has nothing to do with Lua.
>
>
> I can demonstrate the purpose of \unexpanded with the following example. First I create the two
> command \one and \two, afterwards I add \expandedone and \expandedtwo which hold the
> expanded values of \one and \two.
>
> As you can see I get the same text with \one and \expandedone. In the next step I redefine \one
> and \two to hold a new value and compare again the content of all four macros. Unlike in the
> previous output \one and \expandedone are different while \two and \expandedtwo show
> the same result. The reason why \expandedtwo show “Second” is that \unexpanded\def
> prevented the expansion of \two in \edef\expandedtwo{…}.
>
> \starttext
>
>             \def\one{One}
> \unexpanded\def\two{Two}
>
> \edef\expandedone{\one}
> \edef\expandedtwo{\two}
>
> \startlines
> \one:\expandedone
> \two:\expandedtwo
> \stoplines
>
> \def\one{First}
> \def\two{Second}
>
> \startlines
> \one:\expandedone
> \two:\expandedtwo
> \stoplines
>
> \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
> ___________________________________________________________________________________
>
>    
___________________________________________________________________________________
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] 6+ messages in thread

end of thread, other threads:[~2013-04-25 12:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-23 17:04 Basic \def error? Verhaag, G.C.H.M.
2013-04-23 17:08 ` luigi scarso
2013-04-23 18:11   ` Verhaag, G.C.H.M.
2013-04-23 22:20     ` Wolfgang Schuster
2013-04-25 12:10       ` Verhaag, G.C.H.M.
2013-04-23 21:33   ` Wolfgang Schuster

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