[NTG-context] setuphead command ! Argument of \xxx has an extra }.

2013-01-25 Thread Jean-Philippe Rey
Hi,

I am trying to use a homemade command to display chapter heads but I 
systematically get the following error:

! Argument of \ChapterHead has an extra }.

Here is my minimal example


\def\ChapterHead#1#2{#1 --- #2}
\setuphead[chapter][command=\ChapterHead]
\starttext
\chapter{Hello}
Some text
\stoptext


This example works fine with MKII and with the texlive 2012 version of MKIV 
(ConTeXt ver: 2012.05.30 11:26). It fails with the last beta (2013.01.24 16:47 
MKIV) and also with 2012.11.22 14:55 MKIV.

I tried \setuphead[chapter][alternative=command,command=\ChapterHead]
and  \startchapter ... \stopchapter
but still get the same error.

You will find below the content of the log file produced by my minimal example.

Thanks for your help.




(/Users/jprey/ConTeXt-2013.01.24/tex/texmf-context/tex/context/base/cont-yes.mkiv

ConTeXt  ver: 2013.01.24 16:47 MKIV  fmt: 2013.1.25  int: english/english

system   cont-new.mkiv loaded
(/Users/jprey/ConTeXt-2013.01.24/tex/texmf-context/tex/context/base/cont-new.mkiv
system   beware: some patches loaded from cont-new.mkiv
)
system   files  jobname: test-setuphead, input: test-setuphead, 
result: test-setuphead
fontslatin modern fonts are not preloaded
languageslanguage en is active
(test-setuphead.tex{/Users/jprey/ConTeXt-2013.01.24/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map}
fontspreloading latin modern fonts (second stage)
fontstypescripts  unknown: library 'loc'
{/Users/jprey/ConTeXt-2013.01.24/tex/texmf/fonts/map/dvips/lm/lm-math.map}{/Users/jprey/ConTeXt-2013.01.24/tex/texmf/fonts/map/dvips/lm/lm-rm.map}
fontsfallback modern rm 12pt is loaded

% begin of command line arguments
%
% noarrange= true
% input= ./test-setuphead.tex
% fulljobname  = ./test-setuphead.tex
% currentrun   = 1
% no-parse-first-line  = true
% arrange  = true
% script   = true
% synctex  = true
% kindofrun= 1
%
% end of command line arguments

% begin of command line files
%
% 1  ./test-setuphead.tex
%
% end of command line files

structuresectioning  chapter @ level 2: 0.1 - Hello
! Argument of \ChapterHead has an extra }.

system   tex  error on line 4 in file test-setuphead.tex: Argument of 
 ...

1 \def\ChapterHead#1#2{#1 --- #2}
2 \setuphead[chapter][command=\ChapterHead]
3 \starttext
4   \chapter{Hello}
5 Some text
6 \stoptext
7 

inserted text 
\par 
to be read again 
   }
\strc_rendering_inject_number_and_text ...ommand }
  \ifx \p_command \empty \di...
\strc_rendering_place_head_number_and_text ...ext 
  }\fi \strc_rendering_stop_...
\strc_sectioning_handle ...e_head_number_and_text 
  \else \strc_rendering_plac...
l.4 \chapter{Hello}
   
? 
! Emergency stop.

system   tex  error on line 4 in file test-setuphead.tex: Emergency 
stop ...

1 \def\ChapterHead#1#2{#1 --- #2}
2 \setuphead[chapter][command=\ChapterHead]
3 \starttext
4   \chapter{Hello}
5 Some text
6 \stoptext
7 

inserted text 
\par 
to be read again 
   }
\strc_rendering_inject_number_and_text ...ommand }
  \ifx \p_command \empty \di...
\strc_rendering_place_head_number_and_text ...ext 
  }\fi \strc_rendering_stop_...
\strc_sectioning_handle ...e_head_number_and_text 
  \else \strc_rendering_plac...
l.4 \chapter{Hello}
   
End of file on the terminal!

!  == Fatal error occurred, no output PDF file produced!

-- 
Jean-Philippe Rey Professeur - École Centrale Paris
jean-philippe@ecp.fr  92295 Châtenay-Malabry Cedex - France
Empreinte PGP : 807A 5B2C 69E4 D4B5 783A 428A 1B5E E83E 261B BF51




___
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] setuphead command ! Argument of \xxx has an extra }.

2013-01-25 Thread Marco Patzer
On 2013–01–25 Jean-Philippe Rey wrote:

 \def\ChapterHead#1#2{#1 --- #2}

\define[2]\ChapterHead{#1 --- #2}

or

\unexpanded\def\ChapterHead#1#2{#1 --- #2}

Marco


signature.asc
Description: Digital signature
___
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] setuphead command ! Argument of \xxx has an extra }.

2013-01-25 Thread Jean-Philippe Rey

Le 25 janv. 2013 à 17:00, Marco Patzer a écrit :

 On 2013–01–25 Jean-Philippe Rey wrote:
 
 \def\ChapterHead#1#2{#1 --- #2}
 
 \define[2]\ChapterHead{#1 --- #2}
 
 or
 
 \unexpanded\def\ChapterHead#1#2{#1 --- #2}


It works. Thank you very much.

-- 
Jean-Philippe Rey Professeur - École Centrale Paris
jean-philippe@ecp.fr  92295 Châtenay-Malabry Cedex - France
Empreinte PGP : 807A 5B2C 69E4 D4B5 783A 428A 1B5E E83E 261B BF51


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