From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/36648 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: section title: alignment Date: Tue, 18 Sep 2007 11:10:54 +0200 Message-ID: <20070918111054.f2f6dc3d.schuster.wolfgang@googlemail.com> References: <46EE4F22.5050301@unibas.ch> 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 1190106744 10394 80.91.229.12 (18 Sep 2007 09:12:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 18 Sep 2007 09:12:24 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Tue Sep 18 11:12:23 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 1IXZ7z-00078E-1t for gctc-ntg-context-518@m.gmane.org; Tue, 18 Sep 2007 11:12:19 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 6956D1FF0A; Tue, 18 Sep 2007 11:12:16 +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 02053-02-4; Tue, 18 Sep 2007 11:12:00 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id B60281FEB3; Tue, 18 Sep 2007 11:11:59 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 5ADA21FEEF for ; Tue, 18 Sep 2007 11:11:52 +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 02053-02-3 for ; Tue, 18 Sep 2007 11:11:38 +0200 (CEST) Original-Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.189]) by ronja.ntg.nl (Postfix) with ESMTP id AB66E1FE33 for ; Tue, 18 Sep 2007 11:11:37 +0200 (CEST) Original-Received: by nf-out-0910.google.com with SMTP id b2so1234634nfb for ; Tue, 18 Sep 2007 02:11:37 -0700 (PDT) Original-Received: by 10.86.100.7 with SMTP id x7mr4470924fgb.1190106697224; Tue, 18 Sep 2007 02:11:37 -0700 (PDT) Original-Received: from eve ( [62.180.200.36]) by mx.google.com with ESMTPS id d27sm4539599nfh.2007.09.18.02.11.23 (version=SSLv3 cipher=OTHER); Tue, 18 Sep 2007 02:11:34 -0700 (PDT) In-Reply-To: <46EE4F22.5050301@unibas.ch> X-Mailer: Sylpheed 2.4.4 (GTK+ 2.10.13; i686-pc-mingw32) 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:36648 Archived-At: 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 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 ___________________________________________________________________________= ________