From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/79130 Path: news.gmane.org!not-for-mail From: Andrew Dowell Newsgroups: gmane.comp.tex.context Subject: Re: Beginner question. Chapter heading in words Date: Sun, 11 Nov 2012 12:58:03 +0000 Message-ID: <509FA0DB.7030102@yahoo.co.uk> References: <509E4AC9.4030503@yahoo.co.uk> <509E50A8.7090600@wxs.nl> <20121110143732.664f8814@homerow> <20121110144352.49903bde@homerow> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1352638693 29689 80.91.229.3 (11 Nov 2012 12:58:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 11 Nov 2012 12:58:13 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Nov 11 13:58:21 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TXX7F-0004zZ-20 for gctc-ntg-context-518@m.gmane.org; Sun, 11 Nov 2012 13:58:21 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 3CB6C1023A; Sun, 11 Nov 2012 13:58:11 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 1cLziWSDMuG3; Sun, 11 Nov 2012 13:58:08 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id EE5CB101F8; Sun, 11 Nov 2012 13:58:07 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id EFCE9101F8 for ; Sun, 11 Nov 2012 13:58:05 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id DfKDNyDluhBT for ; Sun, 11 Nov 2012 13:58:04 +0100 (CET) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id A6BBC101F0 for ; Sun, 11 Nov 2012 13:58:04 +0100 (CET) Original-Received: from nm19.bullet.mail.ukl.yahoo.com (nm19.bullet.mail.ukl.yahoo.com [217.146.183.193]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id qABCw3OG012571 for ; Sun, 11 Nov 2012 13:58:03 +0100 Original-Received: from [217.146.183.212] by nm19.bullet.mail.ukl.yahoo.com with NNFMP; 11 Nov 2012 12:58:02 -0000 Original-Received: from [77.238.184.79] by tm5.bullet.mail.ukl.yahoo.com with NNFMP; 11 Nov 2012 12:58:02 -0000 Original-Received: from [127.0.0.1] by smtp148.mail.ukl.yahoo.com with NNFMP; 11 Nov 2012 12:58:02 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s1024; t=1352638682; bh=cdSkvFFwI4f6CZSCkZKKS/rKpT5W0r62ACHOwYSeNo4=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=ZaiI+xfDzXUZMFvvqbnnvojXlRH04/NSJ/wCP/AosChacL7GDLGqTL2A0aYu09K/cLKml4EKYJAzIWkhGi2Wdz3IlfAtOuArGYfuwXftElobETVLK26fQT3rjrSZGGotUMKQbc5i+8oRu6LK7w5HbMjoVGg/TANzWrplATdefrA= X-Yahoo-Newman-Id: 597828.90491.bm@smtp148.mail.ukl.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: dNr2XLMVM1mLWeVRZ8W7faWpTnuh4EPPs2X9aD92aIaVWKn ZLC0Cm21o3DTIXNFuD8SVFYiHrrp9FUdkgnPvuNl2VvkazdeN3moyPVdT4i1 J27.MBRAmdY87ZekkxBAIZ4ziL2IW2b8wXAuuESLLXBUJ8zFmriCo5M2K9lX 1gWVh.l_QGsNVLsF5jnQ0gQ7HBe39D0yo550rzfZV0bdLR4Vu5vTXA35jQAH yEt9C12s5OjvtG_RPtPVmVAAyX2W8soFlAM6pIXTq7itCincCab8ED7xu9Uj 8LT3w2FPrrWgUyKh2wlsfO7RWL6lfMgD302zSwFTc1k9atfpJFN3xj5j7kgh Ow5fciSW2MtOaNS.vDtUGve8I3EmnQYqYzaKjZ8Stk1Yo6mxdtQiC48dArdB v_zPkR6eSa6FcG02D_m2gYVDxgBMdDUidUhqQEkCynmcHQzzEbglA2zrnjXY p2cMYMR3wA_cg642j9.Co_.7qJMKD4sH4DEG50GuM8aIM.MHdpVjtY.iQWGO HkbytWh_k6jU.wscG84kAp.eS6Ji1Qa6vq9YU4zANN_SPx7OLcYUdEEkdxFa UyknIq2tVv2CIQsaeo82lXftH0l9Qx.druFwKInFfrkxZ0DdPMvmL_KG0Ho3 Y7T76s0T5..dh1JhnOVxbscc86o6XNrPNaKojHsSSBH6USxWjgw-- X-Yahoo-SMTP: Oy3fvdaswBB8dkAt7PTA.2aaOMvoxQ-- Original-Received: from [192.168.1.2] (and715244@78.150.123.169 with plain) by smtp148.mail.ukl.yahoo.com with SMTP; 11 Nov 2012 04:58:02 -0800 PST User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121011 Thunderbird/16.0.1 In-Reply-To: <20121110144352.49903bde@homerow> X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=217.146.183.193; country=GB; latitude=54.0000; longitude=-2.0000; http://maps.google.com/maps?q=54.0000,-2.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0QImcW3Kz - 0e7ff177bc38 - 20121111 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:79130 Archived-At: On 10/11/12 13:43, Marco Patzer wrote: > 2012-11-10 Marco Patzer: > >> 2012-11-10 Hans Hagen: >> >>> On 11/10/2012 1:38 PM, Andrew Dowell wrote: >>>> Chapter One >>>> >>>> This is the Name of the First Chapter >> I assume the OP was looking for a way to convert a counter to the >> corresponding English word: >> >> \defineconversion >> [words] >> [One, Two, Three, Four, Five] > I forgot to add how to hook this into Hans' example: > > \defineconversion > [words] > [One, Two, Three, Four, Five] > > \setuphead > [chapter] > [header=high, > command=\MyChapterTitle, > style=\bfc, > conversion=words, > numberstyle=\bfb] Thanks for your quick and helpful replies Marco and Hans. I've not quite managed to get it working yet. I also forgot to mention that I wanted it A5 2up on A4. I thought I'd got that sorted using \setuppapersize [A5][A4] \setuparranging [2UP,rotated,doublesided] \setuppagenumbering [alternative=doublesided] \setuplayout [margin=0pt,width=fit] \setupbodyfont [lbr,12pt] from the manual (page 55), but on closer inspection of the output seems to scramble the chapters. My test setup has four chapters. The output labels the first chapter 'Chapter 1', the second chapter 'Chapter 4', the third chapter 'Chapter 2' and the forth chapter 'Chapter 3'. Yes I did want the chapters to be numbered as words but I can't get Marco's modification to work. It would be useful if there was a build in conversion without having to write out the words as Jamie's book has 21 chapters! I've tried various permutations including \incrementcounter [mycount] \convertedcounter [mycount] in each chapter but none of the ones I tried work. (I also tried including the dorecurse, but presume that was for testing) I'm not sure if Han's example was supposed to be a stand alone or some sort of style file. I tried running ConteXt on it but it stopped half way through. I was using the the set up suggested in the manual of having a project file, and environment file, a product file and components. That may be unnecessary complication but I thought I'd just follow the instructions till I understand it better. I put your formatting suggestions into my environment file (pasted below). Thanks for the suggestion of punknova Hans, it might come in sometime but Jamie wants it to look as much like a proper book as possible. He's also telling me he wants the pages arranged as sheet one side one page4 p1 side two p2 p3 sheet two side one p8 p5 side two p6 p7 etc so that the folded A4's bind next to each other, rather than in each other as the format I'm using at the moment gives. I've pasted my environment and test component files below (I tried attaching them but then realised the attachments Hans sent me were off list) Thanks again Andrew Here's my environment file \startenvironment env2bookk \setuppapersize [A5][A4] \setuparranging [2UP,rotated,doublesided] \setuppagenumbering [alternative=doublesided] \setuplayout [margin=0pt,width=fit] \setupbodyfont [lbr,12pt] \setupheadertexts [][chapter] [\getvariable{document}{title}][] \setuppagenumbering [alternative=doublesided, location=footer] \unexpanded\def\MyChapterTitle#1#2% {\framed [offset=overlay, frame=off, width=\textwidth, align={middle,lohi}] {#1\blank#2}} \setuphead [chapter] [header=high, command=\MyChapterTitle, style=\bfc, numberstyle=\bfb] \setuplabeltext [chapter=Chapter~] \defineconversion [words] [One, Two, Three, Four, Five] \definecounter [mycount] \setupcounter [mycount] [numberconversion=words] \setuphead [chapter] [header=high, command=\MyChapterTitle, style=\bfc, conversion=words, numberstyle=\bfb] \stopenvironment And my test component file: \startcomponent pt1 \product prds2 % but you can use it in other products anyway \project projbook \startchapter[title=First] one \dorecurse{10}{\input ward\par} \stopchapter \startchapter[title=Second] two \dorecurse{10}{\input ward\par} \stopchapter \startchapter[title=third] three \dorecurse{10}{\input ward\par} \stopchapter \startchapter[title=fourth] four \dorecurse{10}{\input ward\par} \stopchapter \stopcomponent pt1 > > Marco > > ___________________________________________________________________________________ > 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 ___________________________________________________________________________________