From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/63333 Path: news.gmane.org!not-for-mail From: "Thomas A. Schmitz" Newsgroups: gmane.comp.tex.context Subject: Re: problems with vertical spacing and boxes Date: Tue, 9 Nov 2010 10:19:58 +0100 Message-ID: <7810ABF2-24E6-48ED-804F-04C7DE7831D0@uni-bonn.de> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1289294432 398 80.91.229.12 (9 Nov 2010 09:20:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 9 Nov 2010 09:20:32 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Nov 09 10:20:28 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PFkNQ-0000XA-51 for gctc-ntg-context-518@m.gmane.org; Tue, 09 Nov 2010 10:20:28 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A3098CA837; Tue, 9 Nov 2010 10:20:27 +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 fjzodVvtoFcz; Tue, 9 Nov 2010 10:20:21 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id CCC3DCA82F; Tue, 9 Nov 2010 10:20:21 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E94F6CA82F for ; Tue, 9 Nov 2010 10:20:20 +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 Gq1cpnxZJOJJ for ; Tue, 9 Nov 2010 10:20:15 +0100 (CET) Original-Received: from filter3-til.mf.surf.net (filter3-til.mf.surf.net [194.171.167.219]) by balder.ntg.nl (Postfix) with ESMTP id 3B65ACA80D for ; Tue, 9 Nov 2010 10:20:15 +0100 (CET) Original-Received: from uni-bonn.de (mail.uni-bonn.de [131.220.15.113]) by filter3-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id oA99KE7C026682 for ; Tue, 9 Nov 2010 10:20:14 +0100 Original-Received: from [93.210.237.147] (account tschmit1@uni-bonn.de HELO [192.168.0.2]) by fe2.uni-bonn.de (CommuniGate Pro SMTP 5.2.12) with ESMTPA id 49110911 for ntg-context@ntg.nl; Tue, 09 Nov 2010 10:20:14 +0100 In-Reply-To: X-Mailer: Apple Mail (2.1081) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=131.220.15.113; country=DE; region=07; city=Bonn; latitude=50.7333; longitude=7.1000; http://maps.google.com/maps?q=50.7333,7.1000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0eDsVkej6 - 3cf42af040e7 - 20101109 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.219 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 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 Xref: news.gmane.org gmane.comp.tex.context:63333 Archived-At: Oh, I forgot one important detail: I have protrusion enabled, so I need protrusion for the main text (argument #2). This works with the low-level approach, but not with the other ones, I think. On Nov 9, 2010, at 10:12 AM, Thomas A. Schmitz wrote: > Hi all, > > I need a somewhat unusual vertical setup for typesetting a play. Here is some ASCII art that may show what I want: > > SP XXXXXXXXXXX > XXXXXX 15 > > So: beginning of the line has a fixed space for the abbreviation of the speaker (if there is a speaker designation attached to the line). Then comes the line itself, which fills ca. 80 % amount of the linewidth and needs to be broken as a normal paragraph if it is longer than this space. At the end of the line, another fixed space with the line number, flushright; this number needs to be at the bottom of the paragraph. I have tried three different approaches, but all of them have some problem. One thing to keep in mind: there will be around 3000 such lines, so this might affect processing time. So here are the three approaches: > > 1. low-level, with boxes. Problem: messes up vertical spacing. (I have set the interlinespace to an absurd dimension because this shows the problem in a clearer way). I tried using \strut s at a few places, but couldn't get this to work: > > 2. tabulate: nice, but I can't get the number to be aligned to the bottom. Is there any parameter or trick for that? > > 3. baseline between columns is not aligned (maybe I'm missing the right parameter?), extra vertical space is added. > > Eagerly awaiting your suggestions! > > All best > > Thomas > > \setupbodyfont[termes,12pt] > > \setupinterlinespace[line=4.5ex] > > \startbuffer > \MyLine{5}{Fa.}{This line is short.} > > \MyLine{10}{Me.}{This line is slightly longer, so it will be broken into > two lines in the output.} > > \MyLine{15}{Fa.}{This line is short again.} > > \MyLine{20}{Me.}{Another longer line that will be broken into > two lines in the output.} > > \MyLine{25}{Fa.}{And the last line.} > \stopbuffer > \starttext > > \def\MyLine#1#2#3% > {\setbox\scratchbox\vbox{\hsize=6cm #3}\hbox{\vbox to \ht\scratchbox{\hbox to 1cm{\bf #2}\vfill}\vbox{\hsize=6cm #3\par}\vbox to \ht\scratchbox{\vfill\hbox to 1cm{\hfill #1}}}} > > \getbuffer > > \definetabulate[ELine][|Blw(0.65cm)|p(5.8cm)|rw(0.8cm)|] > > \def\MyLine#1#2#3% > {\startELine > \NC #2 \NC #3 \NC #1 \NR > \stopELine} > > \getbuffer > > \setupTABLE[column][1][width=1cm,frame=off,offset=0pt,,align={right}] > \setupTABLE[column][2][width=6cm,frame=off,align={normal}] > \setupTABLE[column][3][width=1cm,frame=off,align={left,low}] > > \def\MyLine#1#2#3% > {\bTABLE > \bTR\bTD \bf #2 \eTD\bTD #3 \eTD\bTD #1 \eTD \eTR > \eTABLE} > > \getbuffer > > \stoptext > > ___________________________________________________________________________________ > 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 ___________________________________________________________________________________