From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/36650 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?J=F6rg_Hagmann?= Newsgroups: gmane.comp.tex.context Subject: Re: section title: alignment Date: Tue, 18 Sep 2007 14:44:06 +0200 Message-ID: <46EFC816.2050601@unibas.ch> References: <46EE4F22.5050301@unibas.ch> <20070918111054.f2f6dc3d.schuster.wolfgang@googlemail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1190119394 22205 80.91.229.12 (18 Sep 2007 12:43:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 18 Sep 2007 12:43:14 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Sep 18 14:43:11 2007 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1IXcQ1-0001ou-0H for gctc-ntg-context-518@m.gmane.org; Tue, 18 Sep 2007 14:43:09 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 599461FC82; Tue, 18 Sep 2007 14:43:07 +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 19829-05-9; Tue, 18 Sep 2007 14:42:53 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id EED231FD38; Tue, 18 Sep 2007 14:42:52 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 85E241FD38 for ; Tue, 18 Sep 2007 14:42:51 +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 19829-05-8 for ; Tue, 18 Sep 2007 14:42:45 +0200 (CEST) Original-Received: from balu3.urz.unibas.ch (balu3.urz.unibas.ch [131.152.1.57]) by ronja.ntg.nl (Postfix) with ESMTP id 8F1851FC82 for ; Tue, 18 Sep 2007 14:42:45 +0200 (CEST) Original-Received: from bonasa.local ([131.152.79.98]) by balu3.urz.unibas.ch (8.13.1/8.13.1) with ESMTP id l8ICgiwk023904 for ; Tue, 18 Sep 2007 14:42:45 +0200 User-Agent: Thunderbird 2.0.0.4 (Macintosh/20070604) In-Reply-To: <20070918111054.f2f6dc3d.schuster.wolfgang@googlemail.com> X-SMTP-Vilter-Version: 1.3.2 X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 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-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:36650 Archived-At: Hi Wolfgang, Thanks a lot. Luckily, the publisher is asking for amazingly few = alterations of the manuscript -- this was one to be expected. I bought Knuth's TeX book, but didn't have time to look into it -- I'll = have to wait until I understand your solution. Cheers, J=F6rg Wolfgang Schuster wrote: > On Mon, 17 Sep 2007 11:55:46 +0200 > J=F6rg Hagmann wrote: > > = >> Dear list members, >> >> My section titles have a gray background of textwidth, as follows: >> >> \def\SectionCommand#1#2{\framed[frame=3Doff,width=3D\textwidth,% >> align=3Dright,background=3Dcolor,backgroundcolor=3Dlightgray]{#1\quad#2}} >> \setuphead[section][command=3D\SectionCommand,numbercolor=3Dred] >> = > > \def\SectionCommand#1#2% > {\framed > [frame=3Doff, > width=3D\textwidth, > align=3D{right}, > background=3Dcolor, > backgroundcolor=3Dlightgray] > {\hbox to.05\textwidth{\strut#1}\quad > \vtop{\hsize\dimexpr\hsize-.05\textwidth-1em\relax\begstrut#2 > \endstrut}}} > > = >> That works, except when section titles are longer than textwidth: in = >> that case, the second line is aligned with the number, not the text. How = >> can I get correct alignment? I tried to include \starttabulate \NC #1 = >> \NC #2 \NC\NR \stoptabulate in SectionCommand, but then the background = >> extends too much above and below. >> >> I'm sure there is an easy solution? Thanks a lot, J=F6rg >> >> Minimal example: >> \setupcolors[state=3Dstart] >> \def\SectionCommand#1#2{\framed[frame=3Doff,width=3D\textwidth,% >> align=3Dright,background=3Dcolor,backgroundcolor=3Dlightgray]{#1\quad#2}} >> \setuphead[section][command=3D\SectionCommand,numbercolor=3Dred] >> >> \starttext >> \section{A very long title, longer than the width of the text and = >> therefore needing a second line} >> \stoptext >> = > > Wolfgang > _________________________________________________________________________= __________ > 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-co= ntext > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : https://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > _________________________________________________________________________= __________ > > = -- = Prof.Dr.med. J=F6rg Hagmann-Zanolari Institute of Biochemistry and Genetics Centre of Biomedicine, University of Basel Mattenstrasse 28 CH-4058 Basel Switzerland Phone +41 (0)61 267 3565 ___________________________________________________________________________= ________ If your question is of interest to others as well, please add an entry to t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________