From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/20477 Path: news.gmane.org!not-for-mail From: Mojca Miklavec Newsgroups: gmane.comp.tex.context Subject: Re: replace chapter text by an image, possible ? Date: Tue, 24 May 2005 11:29:25 +0200 Message-ID: <4292F3F5.506@gmail.com> References: <428D0B4E.9080402@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1116947771 9893 80.91.229.2 (24 May 2005 15:16:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 24 May 2005 15:16:11 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Tue May 24 17:16:07 2005 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dab8B-0007MA-DW for gctc-ntg-context-518@m.gmane.org; Tue, 24 May 2005 17:15:43 +0200 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 0FB67127B8; Tue, 24 May 2005 17:17:22 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 28508-04; Tue, 24 May 2005 17:17:18 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 6820212775; Tue, 24 May 2005 17:17:17 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id CF52012775 for ; Tue, 24 May 2005 17:17:15 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 28669-01 for ; Tue, 24 May 2005 17:17:14 +0200 (CEST) Original-Received: from avs3.arnes.si (avs3.arnes.si [193.2.1.68]) by ronja.ntg.nl (Postfix) with ESMTP id DCF141276F for ; Tue, 24 May 2005 17:17:14 +0200 (CEST) Original-Received: from localhost (avs3.arnes.si [193.2.1.68]) by avs3.arnes.si (Postfix) with ESMTP id 1B06F1D7AA0; Tue, 24 May 2005 17:17:14 +0200 (CEST) Original-Received: from avs3.arnes.si ([193.2.1.68]) by localhost (avs3.arnes.si [193.2.1.68]) (amavisd-new, port 10024) with ESMTP id 57739-05; Tue, 24 May 2005 17:17:13 +0200 (CEST) Original-Received: from [141.84.28.190] (a190.lmu.vpn.lrz-muenchen.de [141.84.28.190]) by avs3.arnes.si (Postfix) with ESMTP id 686D41D7A40; Tue, 24 May 2005 17:17:03 +0200 (CEST) User-Agent: Mozilla/4.5-4.75 (Windows; U; Windows NT 5.1; sl-SI; rv:1.4) Gecko/20030624 Netscape/7.1 X-Accept-Language: sl, en, en-us, de Original-To: VnPenguin , mailing list for ConTeXt users In-Reply-To: X-Virus-Scanned: by amavisd-new at arnes.si X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on smtp.ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:20477 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:20477 VnPenguin wrote: > On 5/19/05, Hans Hagen wrote: > >>VnPenguin wrote: >> >>>Hi all, >>>I would like to know if it's possible to replace the chapter text by an image ? >>>How to do that ? And in this case, how to insert a normal text into >>>TOC manually in order to have a normal TOC. >>> >>>Thank you in advance, >> >>\useexternalfigure[chapter-1][cow.pdf] >>\useexternalfigure[chapter-2][hacker.jpg] >> >>\setuphead >> [chapter] >> [command=\MyChapterCommand] >> >>\def\MyChapterCommand#1#2% >> {\externalfigure[chapter-\currentheadnumber][height=5cm]} > > Your code works fine. However when I try to add TOC: > > \chapter{One} > \section{One-1} > > \chapter{Two} > \section{Two-1} > > \setuplist [chapter][before=\blank, after=\blank, > style={\switchtobodyfont[20pt]\bf}] > \setuplist [section][margin=2em, width=3em] > \setuplist [chapter,section][interaction=all] > \setupcombinedlist > [content] > [alternative=c, aligntitle=no, width=2em] > > \placelist[chapter,section] > > In the TOC result, there are ONLY item for section. You see, this > question is not simple at all :) I don't know the mechanisms behind the scenes, but I suppose that you override placing the chapter in TOC if you make your own "command=\MyChapterCommand". (Line 2034 in core-sec.tex is \c!command=\@@placehead. Is this one perhaps responsible for the strange behavior?) However this solves the problem: \setuphead [chapter] [textcommand=\MyChapterTextCommand, numbercommand=\MyChapterNumberCommand] \def\MyChapterNumberCommand#1{} % hide chapter number \def\MyChapterTextCommand#1% {\externalfigure[chapter-\currentheadnumber][height=5cm]} Mojca