From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/23475 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: The whole (sub)section on a single page Date: Tue, 15 Nov 2005 10:38:02 +0100 Message-ID: <4379AC7A.1020109@wxs.nl> References: <6faad9f00511121555x5ff6084dn26e714128030392e@mail.gmail.com> <4377468E.4010802@elvenkind.com> <6faad9f00511141011g40a31af8nac87df252a3d6f5e@mail.gmail.com> <4378E7F8.4000505@wxs.nl> <6faad9f00511150015l6c4819c9qda1afd2e33dd3ee5@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1132047526 13228 80.91.229.2 (15 Nov 2005 09:38:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 15 Nov 2005 09:38:46 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Tue Nov 15 10:38:45 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 1EbxGX-0003RM-0I for gctc-ntg-context-518@m.gmane.org; Tue, 15 Nov 2005 10:38:13 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 7A400127D2; Tue, 15 Nov 2005 10:38:12 +0100 (CET) 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 04068-02; Tue, 15 Nov 2005 10:38:06 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id BABE71276F; Tue, 15 Nov 2005 10:38:06 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 935CA1276F for ; Tue, 15 Nov 2005 10:38:04 +0100 (CET) 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 03849-06 for ; Tue, 15 Nov 2005 10:38:03 +0100 (CET) Original-Received: from controller-1 (dsl-212-84-128-085.solcon.nl [212.84.128.85]) by ronja.ntg.nl (Postfix) with ESMTP id 7A6571276B for ; Tue, 15 Nov 2005 10:38:03 +0100 (CET) Original-Received: from [10.100.1.102] (unverified [10.100.1.102]) by controller-1 (SurgeMail 3.5b3) with ESMTP id 3299 for ; Tue, 15 Nov 2005 10:41:28 +0300 User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: <6faad9f00511150015l6c4819c9qda1afd2e33dd3ee5@mail.gmail.com> X-Server: High Performance Mail Server - http://surgemail.com r=-274017400 X-Authenticated-User: hagen@controller-1 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-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:23475 Archived-At: Mojca Miklavec wrote: >Hans Hagen wrote: > > >>Mojca Miklavec wrote: >> >> >>>Taco Hoekwater wrote: >>> >>> >>>>Mojca Miklavec wrote: >>>> >>>> >>>> >>>> >>>>>It doesn't need to automatically determine the subsection boundaries >>>>>automatically (although this would be great), so I can write something >>>>>like this: >>>>> >>>>>\startmaterialforonepage >>>>>\subsection{split only if too long for one page} >>>>>\dorecurse{10}{whatever comes here \dots } >>>>>\stopmaterialforonepage >>>>> >>>>> >>>>> >>>>> >>>>Do you want something like this? >>>> >>>> \long\def\startmaterialforonepage#1\stopmaterialforonepage% >>>> {\setbox0\vbox{#1}\ifdim\ht0<\textheight \page\fi #1} >>>> >>>> >>>> >>>> >>>Thak you, Taco. Yes, this is almost exactly what I wanted to do, >>>except that I would substitute >>> \ifdim\ht0<\textheight >>>with >>> \ifdim\ht0<\theremainingpageheight >>> >>>How/where can I get \theremainingpageheight? I saw some strange >>>"keywords" like \pagegoal, \pagetotal spread through the source, ... >>>but I have no clue what they are for and if they have anyting to do >>>with what I'm looking for. >>> >>> >>> >>> >>that's always tricky, because it's not really possible to determine the >>rest of the available space without entering the output routing, which >>then spoils spacing >> >>(there is \testpage[n] with n being a minimal number of lines, so, >>\testpage[10] will move to the next page if there are less than 10 lines) >> >> > >Thank you, Hans. I have to refresh my knowledge about the syntax and >I'll try it out. Making > \setbox0\vbox{#1} >and then executing the \testpage with "ceil(ht0 / lineheight)" should >then work OK, I hope. > > even that is tricky, imagine your method (along the lines): - \setbox0\vbox{\startitemize ... \stopitemize} - measure and decide if \page is needed - \unvbox0 putting something in a box prevents for instance \blank looking back and getting the spacing right (context goes to a large extent to get spacing right) even unvboxing does not help since esp the top of box damage has been done and is irreversible unless you do clever trickery officially you need something \startboxed ... \stopboxed where the start/stop do some housekeeping what you can try is to define an instance of framedtext (\startframedtext \stopframedtext) with no offsets and frame since that macro does reasonable job on spacing and still keeps things together Hans >I understand the problem of the approach that I asked for: as soon as >someone enters a \vfill(l) or \vss, it's approximately impossible to >determine where the text on the page ends. But in the first >approximation I would be satisfied with the empty space that would >remain if the document ended at that specific place. > >That information is also very valuable when trying to put pictures on >slides, where picture has to be as big as possible, but still has to >fit on the space under the title (I tuned them manually, which was OK >for just a couple of slides). > >Thank you, > Mojca >_______________________________________________ >ntg-context mailing list >ntg-context@ntg.nl >http://www.ntg.nl/mailman/listinfo/ntg-context > >