ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* setuphead command "! Argument of \xxx has an extra }."
@ 2013-01-25 15:52 Jean-Philippe Rey
  2013-01-25 16:00 ` Marco Patzer
  0 siblings, 1 reply; 3+ messages in thread
From: Jean-Philippe Rey @ 2013-01-25 15:52 UTC (permalink / raw)
  To: ntg-context

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
fonts           > latin modern fonts are not preloaded
languages       > language en is active
(test-setuphead.tex{/Users/jprey/ConTeXt-2013.01.24/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map}
fonts           > preloading latin modern fonts (second stage)
fonts           > typescripts > 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}
fonts           > fallback 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

structure       > sectioning > 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.rey@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
___________________________________________________________________________________


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

* Re: setuphead command "! Argument of \xxx has an extra }."
  2013-01-25 15:52 setuphead command "! Argument of \xxx has an extra }." Jean-Philippe Rey
@ 2013-01-25 16:00 ` Marco Patzer
  2013-01-25 17:30   ` Jean-Philippe Rey
  0 siblings, 1 reply; 3+ messages in thread
From: Marco Patzer @ 2013-01-25 16:00 UTC (permalink / raw)
  To: ntg-context


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

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

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 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] 3+ messages in thread

* Re: setuphead command "! Argument of \xxx has an extra }."
  2013-01-25 16:00 ` Marco Patzer
@ 2013-01-25 17:30   ` Jean-Philippe Rey
  0 siblings, 0 replies; 3+ messages in thread
From: Jean-Philippe Rey @ 2013-01-25 17:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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.rey@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
___________________________________________________________________________________


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

end of thread, other threads:[~2013-01-25 17:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-25 15:52 setuphead command "! Argument of \xxx has an extra }." Jean-Philippe Rey
2013-01-25 16:00 ` Marco Patzer
2013-01-25 17:30   ` Jean-Philippe Rey

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