From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/44950 Path: news.gmane.org!not-for-mail From: "Wolfgang Schuster" Newsgroups: gmane.comp.tex.context Subject: Re: \setuphead and horizontal rules Date: Wed, 22 Oct 2008 09:18:43 +0200 Message-ID: <115224fb0810220018l2588296eif8f1756fa9e957d8@mail.gmail.com> References: <20081021170018.GE24289@sebastian> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1224660021 27734 80.91.229.12 (22 Oct 2008 07:20:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 22 Oct 2008 07:20:21 +0000 (UTC) To: "mailing list for ConTeXt users" Original-X-From: ntg-context-bounces@ntg.nl Wed Oct 22 09:21:21 2008 connect(): Connection refused 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 1KsY1w-0006jm-T2 for gctc-ntg-context-518@m.gmane.org; Wed, 22 Oct 2008 09:21:20 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 702741FCCE; Wed, 22 Oct 2008 09:20:13 +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 19392-10-10; Wed, 22 Oct 2008 09:19:18 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 7C30F1FCBD; Wed, 22 Oct 2008 09:19:18 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id A82101FCBD for ; Wed, 22 Oct 2008 09:19: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 19392-10-9 for ; Wed, 22 Oct 2008 09:18:44 +0200 (CEST) Original-Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.175]) by ronja.ntg.nl (Postfix) with ESMTP id 580261FCAA for ; Wed, 22 Oct 2008 09:18:44 +0200 (CEST) Original-Received: by ug-out-1314.google.com with SMTP id s2so1192383uge.1 for ; Wed, 22 Oct 2008 00:18:44 -0700 (PDT) Original-Received: by 10.103.207.18 with SMTP id j18mr1799585muq.100.1224659923872; Wed, 22 Oct 2008 00:18:43 -0700 (PDT) Original-Received: by 10.103.215.10 with HTTP; Wed, 22 Oct 2008 00:18:43 -0700 (PDT) In-Reply-To: <20081021170018.GE24289@sebastian> Content-Disposition: inline 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:44950 Archived-At: On Tue, Oct 21, 2008 at 7:00 PM, Andrew Ho wrote: > Hi, > > Let me prefix this first my saying that I'm new to ConTeXT, so > apologies if there is an obvious solution to what I'm trying to do or > I'm approaching it in the wrong way. I'm trying to style chapter > headings so that they are right justified, with a line before them *on > the same line*. In other words, the page should look like this, where > vertical bars represent the edges of the text width: > > |------------------------------- 1.1 Some chapter --| > > Can anyone give me pointers on how to do this? I've trawled the wiki > and the internet at large, but an inability to precisely word this > leaves it difficult to find any previous example of this. > > Many thanks, > Andrew \define[2]\ChapterCommand {\line {\leaders\hbox {\vrule width 1pt height .5\strutht depth -\dimexpr.5\strutht-\linewidth\relax}\hfill #1\space#2}} \setuphead[chapter][command=\ChapterCommand] \starttext \chapter{Some chapter} \stoptext Works only for headers shorter than one line. 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-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________