From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/60133 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: horizontal alignment Date: Sun, 11 Jul 2010 09:22:40 +0200 Message-ID: <4C397140.6090200@googlemail.com> References: <4C370476.8010407@uni-ulm.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1278832977 6102 80.91.229.12 (11 Jul 2010 07:22:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 11 Jul 2010 07:22:57 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Jul 11 09:22:56 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 1OXqsI-00021O-6Q for gctc-ntg-context-518@m.gmane.org; Sun, 11 Jul 2010 09:22:54 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 90C93C9C85; Sun, 11 Jul 2010 09:22:52 +0200 (CEST) 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 fe3kv-hQqhq7; Sun, 11 Jul 2010 09:22:48 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8B3ABC9A9C; Sun, 11 Jul 2010 09:22:48 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 2BD2DC9A9C for ; Sun, 11 Jul 2010 09:22:47 +0200 (CEST) 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 xgtBXc7RjdKj for ; Sun, 11 Jul 2010 09:22:44 +0200 (CEST) Original-Received: from mail-ey0-f169.google.com (mail-ey0-f169.google.com [209.85.215.169]) by balder.ntg.nl (Postfix) with ESMTP id 627C7C9A70 for ; Sun, 11 Jul 2010 09:22:44 +0200 (CEST) Original-Received: by eydd26 with SMTP id d26so545539eyd.14 for ; Sun, 11 Jul 2010 00:22:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=pNj64odjeHAG1AwoBOin3awKpRA9HWo00kh8KIwSbA4=; b=qBGJUNaqadQbSq7ikDiS6DZWsPe9+FKfr4RbZCpR3q4+VVhkXEu3ILOpoVXm+Srg7F imbkUHLvZikWggRujgW15l0V0SBnJxqLaCc+RJ5EW34088SM2eoel2FelAZdjrA9FCC7 PBbS6+W9YNNaDoYdv+ftvvxJk4G9hbKnS+nA0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=MsbxdIEphYqiQpo++T177P8Gw1wq7AJ0OBLl5A2A8BYxr0GSwkMtGJ0nL9MIlhcvy/ o3eO+j0mh4wXGaSoLCXfxuc7wCo7N/dBF4pef0W4bO/gp0lctxmtnCjR4K8PdK4p3J1I bjihnYqrKRphoXDR6r6Ge1z/4zA4mpFbJvF8U= Original-Received: by 10.213.33.73 with SMTP id g9mr2099049ebd.46.1278832963933; Sun, 11 Jul 2010 00:22:43 -0700 (PDT) Original-Received: from meta.fritz.box (dslb-094-217-195-017.pools.arcor-ip.net [94.217.195.17]) by mx.google.com with ESMTPS id v59sm24757985eeh.4.2010.07.11.00.22.41 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 11 Jul 2010 00:22:42 -0700 (PDT) User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5 In-Reply-To: <4C370476.8010407@uni-ulm.de> 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:60133 Archived-At: Am 09.07.10 13:13, schrieb Michael Murphy: > On 09/07/10 01:32, Michael Goerz wrote: >> Hi everyone, >> >> I'm trying to do some horizontal alignment, for typesetting poetry. >> How would you solve this kind of problem? I've considered defining a >> macro \BrokenLine[line1][line2] that does the above. But, there are >> also instances where there are two or more lines as a continuation of >> one previous line. Maybe there is a possibility to mark a horizontal >> position temporarily, and then jump to that position later? > > Didn't know you were into ConTeXt... > > Anyway, this is a crappy solution and you could probably make it better. > As far as I'm aware, there is no way to get the current horizontal > position across the page at any particular moment. The method below > essentially just measures the length of the line that you want to enter, > and sets this as the indent. > > \dimendef\indentl=10 > > \def\savewidth#1{% > \setbox0=\hbox{#1}% > \copy0% > \indentl=\wd0% > } > > \def\addtosavewidth#1{% > \setbox0=\hbox{#1}% > \mindent\copy0% > \advance\indentl by \wd0% > } > > \def\mindent{\hskip\indentl} Nice solution but you can improve it with a few context functions: \newdimen\indentleft \def\savewidth {\dowithnextbox {\indentleft\nextboxwd \copy\nextbox} \hbox} \def\addtosavewidth {\dowithnextbox {\mindent\copy\nextbox \advance\indentleft\nextboxwd} \hbox} \def\mindent{\hskip\indentleft} A different solution is to store the end of the last line in one run and reuse this value in the next: \def\SKIP {\doglobal\increment\SKIPcount \xypos{NP:\SKIPcount}% \par\hskip\dimexpr\MPx{NP:\SKIPcount}-\MPx{text:\realfolio}\relax} \def\LASTSKIP {\par\hskip\dimexpr\MPx{NP:\SKIPcount}-\MPx{text:\realfolio}\relax} \starttext \startlines here we now see you ~~ already in grief as you see ~~ yourselves ~~ as the last of the lasts we are mirrors of your consciousness \SKIP as you see the end and you see us ~~ deep \SKIP in \SKIP the spring \LASTSKIP of the universe seeing you deep ~~ in the gravity well of the heat death \stoplines \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-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________