ConTeXt is barfing on my code :
-----
%output=pdf
%% chapter head layout
\setupcolors[state=start]
\setuplist[section]
[style=boldslanted,
align=right,
interaction=all,
symbol=1,
width=1em,
pagenumber=no,
before=,
after=]
\setuphead[chapter]
[header=empty,
numberstyle=ChapterTitleNumberFont,
textstyle=ChapterTitleTextFont
alternative=command,
command=\ContentsHead,
page=right,
after={\blank[2*big]}]
\definefont[ChapterTitleTextFont][Serif at 24.9pt]
\definefont[ChapterTitleNumberFont][SerifBold at 40pt]
\def\ContentsHead#1#2%
{\setupframed [frame=off]%
\framed [width=\hsize,offset=overlay]
{\placesidebyside
{\doifelsenothing{#1}
{\framed [width=.6\hsize]{}} % dummy
{\framed [width=.6\hsize,offset=1em,strut=no,align=right,
background=screen]
{\vi In this chapter: \blank
\placelist[section][criterium=chapter]}}}
{\framed [width=.4\hsize,strut=no,align=left]
%% Typeset Chapter Number
{\hbox{\vbox to 24.9pt{% height ChapterTitleTextFont
\vss
#1}}}
\vfilll}
}%
%% Typeset Chapter Title
\llap{\lower24.9pt\hbox{#2\hskip0.5em}}}
\showmakeup
\starttext
\chapter {Berend}
\section {Botje}
\section {Botje}
\section {Botje}
\stoptext
-----
Attached is the log:
This is pdfeTeXk, Version 3.14159-1.10a-2.1 (Web2c 7.4.5) (format=cont-en 2003.3.20) 20 MAR 2003 16:54
entering extended mode
\write18 enabled.
%&-line parsing enabled.
**&cont-en tryOreillyHead.ctx
(./tryOreillyHead.ctx{c:/Local/TeX/texmf-var/pdftex/config/pdftex.cfg}
ConTeXt ver: 2003.3.17 fmt: 2003.3.20 int: english mes: english
language : language en is active
At 08:48 PM 3/20/2003 +0800, you wrote:
color : system rgb is global activated check : missing or ungrouped '=' after 'textstyle' in line 21 (@@kocha pter)
how about this error? Hans ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com ------------------------------------------------------------------------- information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf -------------------------------------------------------------------------
I wrote: Hans Hagen wrote:
color : system rgb is global activated check : missing or ungrouped '=' after 'textstyle' in line 21 (@@kocha pter)
how about this error?
Sorry, cut and paste error (I added the comma on line 21). The
underlying error is still there
This is pdfeTeXk, Version 3.14159-1.10a-2.1 (Web2c 7.4.5) (format=cont-en 2003.3.20) 21 MAR 2003 08:19
entering extended mode
\write18 enabled.
%&-line parsing enabled.
**&cont-en tryoreillyhead.ctx
(./tryoreillyhead.ctx{c:/Local/TeX/texmf-var/pdftex/config/pdftex.cfg}
ConTeXt ver: 2003.3.17 fmt: 2003.3.20 int: english mes: english
language : language en is active
At 08:25 AM 3/21/2003 +0800, you wrote:
Sorry, cut and paste error (I added the comma on line 21). The underlying error is still there
in that case i need a minimal file showing the problem Hans ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com ------------------------------------------------------------------------- information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf -------------------------------------------------------------------------
Hans Hagen
Sorry, cut and paste error (I added the comma on line 21). The underlying error is still there
in that case i need a minimal file showing the problem
I am not Guy Worthington, but I had a (non successful) look at it and this is my testing file: ================================================== \setuphead[chapter] [alternative=command, command=\ContentsHead] \def\ContentsHead#1#2% {\framed [width=\hsize]{\doifelsenothing{#1}{a}{b}}} \starttext \chapter {Berend} \stoptext ================================================== Error: ! Extra \else. \dodododosomekop ...section {#1}{#3}{#4}\fi \else \getvalue {\??ko #1\c!tuss... l.10 \chapter {Berend} There is even something weired when removing width=\hsize in the framed macro: ! Undefined control sequence. \exitloop ->\let \endofloop \nodoloop <argument> ...>\zeropoint \unskip \else \exitloop \fi \doloop ...@@arecurse \recursedepth \endcsname {#1
At 10:24 AM 3/21/2003 +0100, Patrick Gundlach wrote:
Hans Hagen
writes: Hello,
Sorry, cut and paste error (I added the comma on line 21). The underlying error is still there
in that case i need a minimal file showing the problem
I am not Guy Worthington, but I had a (non successful) look at it and this is my testing file:
================================================== \setuphead[chapter] [alternative=command, command=\ContentsHead]
\def\ContentsHead#1#2% {\framed [width=\hsize]{\doifelsenothing{#1}{a}{b}}}
\starttext \chapter {Berend} \stoptext ==================================================
Ah, this is beause \ContentsHead gets a truckload of rubish passed (add \showargument{#1} and you see what i mean) and this confuses tex when testing things (if..else in argument); even if i would solve this, other *user) code could mess up things; this is why we have (inside a head): \doifmodeelse{*sectionnumber} or alternatively: \doiftextelse for content testing (btw, sorry that i didn't yet answer your question about the numbering) Hans ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com ------------------------------------------------------------------------- information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf -------------------------------------------------------------------------
Hans Hagen wrote:
Patrick Gundlach wrote:
[a sensible and minimal test case]
================================================== \setuphead[chapter] [alternative=command, command=\ContentsHead]
\def\ContentsHead#1#2% {\framed [width=\hsize]{\doifelsenothing{#1}{a}{b}}}
\starttext \chapter {Berend} \stoptext ==================================================
...\ContentsHead gets a truckload of rubbish passed (add \showargument{#1} and you see what i mean) and this confuses tex when testing things (if..else in argument); even if i would solve this, other *user) code could mess up things; this is why we have (inside a head):
\doifmodeelse{*sectionnumber}
Thanks Patrick for generating the minimal test case. (Hans I promise I'll do my own homework from now on.) Replacing \doifelsenothing{#1} with \doifmodeelse{*sectionnumber} does cure the problem. ----- \setuphead[chapter] [alternative=command, command=\ContentsHead] \def\ContentsHead#1#2% {\framed [width=\hsize]{\doifmodeelse{*sectionhead}{a}{b}}} \starttext \chapter {Berend} \stoptext -----
participants (3)
-
Guy Worthington
-
Hans Hagen
-
Patrick Gundlach