From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/22337 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: cropping text Date: Wed, 07 Sep 2005 15:38:32 +0200 Message-ID: <431EED58.8080809@wxs.nl> References: <431ED16F.90609@gmx.net> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1126100436 9820 80.91.229.2 (7 Sep 2005 13:40:36 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 7 Sep 2005 13:40:36 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Wed Sep 07 15:40:34 2005 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1ED08H-0001cV-RD for gctc-ntg-context-518@m.gmane.org; Wed, 07 Sep 2005 15:38:33 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id BDCDE12810; Wed, 7 Sep 2005 15:38:32 +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 30595-07; Wed, 7 Sep 2005 15:38:27 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id BF604127D5; Wed, 7 Sep 2005 15:38:26 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id D80A8127D5 for ; Wed, 7 Sep 2005 15:38:24 +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 30610-07 for ; Wed, 7 Sep 2005 15:38:23 +0200 (CEST) Original-Received: from mailrelay02.solcon.nl (maillb.solcon.nl [212.45.32.200]) by ronja.ntg.nl (Postfix) with ESMTP id 2CF28127A8 for ; Wed, 7 Sep 2005 15:38:22 +0200 (CEST) Original-Received: from server-1.pragma-net.nl (dsl-212-84-128-085.solcon.nl [212.84.128.85]) by mailrelay02.solcon.nl (8.12.11/SQL-8.12.11-5/8.12.11) with ESMTP id j87DcJoY000638 for ; Wed, 7 Sep 2005 15:38:19 +0200 Original-Received: by server-1.pragma-net.nl (Postfix, from userid 65534) id 700CE361C9; Wed, 7 Sep 2005 14:46:05 +0200 (CEST) Original-Received: from [10.100.1.15] (unknown [10.100.1.15]) by server-1.pragma-net.nl (Postfix) with ESMTP id 6F3E6361C7 for ; Wed, 7 Sep 2005 12:46:04 +0000 (UTC) User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: <431ED16F.90609@gmx.net> X-Virus-Scanned: ClamAV version 0.86.2, clamav-milter version 0.86 on mailrelay02 X-Virus-Status: Clean X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 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-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on smtp.ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:22337 Archived-At: Peter Rolf wrote: >Hi all, > >I've used \doboundtext so far, to crop my text exactly as I want it. But >now I've problems with text, that contains a \underbar token. It seems, >that \handletokens can't handle \underbar. > >The other cropping alternative, \limitatetext, perfectly works with >\underbar, but it's useless for me, as it cropps off only at word >boundaries. mhh.. > >Is there an (more or less) easy way to solve my problem? >I don't need a full solution; any hints are welcome. > > here is a full solution; it's up to you to add documentation to the wiki (the macro will be in the next release) \def\limitatefirstline#1#2#3% {\hbox\bgroup\strut \setbox\scratchbox\hbox{#1}% \ifdim\wd\scratchbox>#2\relax \setbox\scratchbox\hbox{#3}% \hsize#2\relax \advance\hsize-\wd\scratchbox \setbox\scratchbox\vbox{\forgetall#1}% \setbox\scratchbox\vsplit\scratchbox to \lineheight \vbox{\unvbox\scratchbox}% #3% \else #1% \fi \egroup} \starttext \limitatefirstline{\input tufte\relax}{10cm}{\unknown} \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------