From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/87659 Path: news.gmane.org!not-for-mail From: Rik Newsgroups: gmane.comp.tex.context Subject: Re: sections Date: Sun, 01 Jun 2014 11:40:44 -0400 Message-ID: <538B497C.5010700@panix.com> References: <538B13B9.1030700@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0745122294==" X-Trace: ger.gmane.org 1401637277 19027 80.91.229.3 (1 Jun 2014 15:41:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 1 Jun 2014 15:41:17 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Sun Jun 01 17:41:12 2014 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Wr7sm-0001EB-1U for gctc-ntg-context-518@m.gmane.org; Sun, 01 Jun 2014 17:41:12 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 931D310228 for ; Sun, 1 Jun 2014 17:41:11 +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 cymnk+1Gxzpz for ; Sun, 1 Jun 2014 17:41:11 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id EF5CE10229 for ; Sun, 1 Jun 2014 17:41:05 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 774E4101E3 for ; Sun, 1 Jun 2014 17:41:02 +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 K4EpyCchnzcM for ; Sun, 1 Jun 2014 17:41:00 +0200 (CEST) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id 9C6D1101E2 for ; Sun, 1 Jun 2014 17:40:55 +0200 (CEST) Original-Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s51FelKp025641 for ; Sun, 1 Jun 2014 17:40:48 +0200 Original-Received: from [192.168.201.179] (cpe-67-240-55-150.nycap.res.rr.com [67.240.55.150]) by mailbackend.panix.com (Postfix) with ESMTP id CCF8E35159 for ; Sun, 1 Jun 2014 11:40:46 -0400 (EDT) User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 In-Reply-To: <538B13B9.1030700@wxs.nl> X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=166.84.1.89; country=US; region=New York; city=Richmond Hill; latitude=40.7005; longitude=-73.8345; http://maps.google.com/maps?q=40.7005,-73.8345&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0QM93ELL5 - 5cd12ecdddd3 - 20140601 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:87659 Archived-At: This is a multi-part message in MIME format. --===============0745122294== Content-Type: multipart/alternative; boundary="------------080809060200010807020609" This is a multi-part message in MIME format. --------------080809060200010807020609 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 2014-06-01 07:51, Hans Hagen wrote: > Hi Pablo, > > The section breaks are a bit of a headache. In the old mechanism (also > mkii) we used penalties between different section levels (different > values so that there is some hierarchy). > > In mkiv we have a weighted penalty/glue mechanism which has advantages > but can also create side effects. The method of a few weeks ago coul > deal with > > \section followed by 100 \subsections > > i.e. no text between this. In a strict mechanism you end up with one > long page fur to all the penalties. So, there was some precaution for > this. However that didn't work well with content following sections > that prefers breaks (read: section head followed by e.g. itemize or > tabulate). > > So, the newer mechanism tries to analyze the page stream which > (currently) is somewhat tricky. That's why we need to iterate to an > acceptable solution. > > Some of these mkiv mechanisms are already a bit old and could be done > better using some newer luatex trickery (but i need tome to do that). > > It would be nice to have a large test case for this (sort of hard to > make one as some trial and error is involved). As you already have > some, best collect them for future reference. > > A new beta ... > > Hans > Hans, Is this also the cause of problems I noted with heading placed into the margin, as in the example below? % Extra whitespace after some marginal section headings % % When section heads are set in the margin, the following body % text should start on the same line as the heading. This is % the case with plain text, but not always the case with other % features (floats and enumerations). Wolfgang suggested adding % insidesection={blank[overlay]} to the section heading setup, but % that only helps with enumerations and with tabulate tables that do % not start with an HL (it fails with natural tables as well). And % that success only comes with start/stop sectioning. With traditional % sectioning, there are more failures. % % \setupexternalfigures[location=default] \setuphead [section] [alternative=text, command=\SectionCommand, distance=0pt, insidesection={\blank[overlay]}, ] \define[2]\SectionCommand {\inmargin{#1 -- #2}} \setuplayout[backspace=4cm] \starttext \startchapter[title={Start/Stop sectioning}] \startsection[title={Okay with text first}] Text here \starttabulate \FL \NC Knuth \NC \input{knuth} \NC\NR \stoptabulate \stopsection \startsection[title={Okay with itemize}] \startitemize \item One \item Two \item Three \stopitemize \stopsection \startsection[title={Okay with tabulate no HL}] \starttabulate \NC Knuth \NC \input{knuth} \NC\NR \stoptabulate \page \stopsection \startsection[title={Fail with tabulate HL}] \starttabulate \FL \NC Knuth \NC \input{knuth} \NC\NR \stoptabulate \stopsection \startsection[title={Fail with TABLE frame}] \bTABLE \bTR \bTD Knuth \eTD\bTD \input{knuth} \eTD\eTR \eTABLE \stopsection \startsection[title={Fail with TABLE no frame}] \bTABLE[frame=off] \bTR \bTD Knuth \eTD\bTD \input{knuth} \eTD\eTR \eTABLE \page \stopsection \startsection[title={Fails with figures}] \startplacefigure[location=right,reference={fig:2},title={Caption}] \externalfigure[cow.pdf][width=2cm] \stopplacefigure \input{tufte} \stopsection \stopchapter \chapter{Traditional sectioning} \section{Okay with text first} Text here \starttabulate \FL \NC Knuth \NC \input{knuth} \NC\NR \stoptabulate \section{Fail with itemize} \startitemize \item One \item Two \item Three \stopitemize \page \section{Fail with tabulate no HL} \starttabulate \NC Knuth \NC \input{knuth} \NC\NR \stoptabulate \section{Fail with tabulate HL} \starttabulate \FL \NC Knuth \NC \input{knuth} \NC\NR \stoptabulate \section{Fail with TABLE frame} \bTABLE \bTR \bTD Knuth \eTD\bTD \input{knuth} \eTD\eTR \eTABLE \section{Fail with TABLE no frame} \bTABLE[frame=off] \bTR \bTD Knuth \eTD\bTD \input{knuth} \eTD\eTR \eTABLE \page \section[title={Fails with figures startstop}] \startplacefigure[location=right,reference={fig:2},title={Caption}] \externalfigure[cow.pdf][width=2cm] \stopplacefigure \input{tufte} \section[title={Fails with figures traditional}] \placefigure[right][fig:2]{Caption} {\externalfigure[cow.pdf][width=2cm]} \input{tufte} \stoptext -- Rik Kabel --------------080809060200010807020609 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
On 2014-06-01 07:51, Hans Hagen wrote:
Hi Pablo,

The section breaks are a bit of a headache. In the old mechanism (also mkii) we used penalties between different section levels (different values so that there is some hierarchy).

In mkiv we have a weighted penalty/glue mechanism which has advantages but can also create side effects. The method of a few weeks ago coul deal with

\section followed by 100 \subsections

i.e. no text between this. In a strict mechanism you end up with one long page fur to all the penalties. So, there was some precaution for this. However that didn't work well with content following sections that prefers breaks (read: section head followed by e.g. itemize or tabulate).

So, the newer mechanism tries to analyze the page stream which (currently) is somewhat tricky. That's why we need to iterate to an acceptable solution.

Some of these mkiv mechanisms are already a bit old and could be done better using some newer luatex trickery (but i need tome to do that).

It would be nice to have a large test case for this (sort of hard to make one as some trial and error is involved). As you already have some, best collect them for future reference.

A new beta ...

Hans

Hans,

Is this also the cause of problems I noted with heading placed into the margin, as in the example below?
%   Extra whitespace after some marginal section headings
%
%   When section heads are set in the margin, the following body
%   text should start on the same line as the heading. This is
%   the case with plain text, but not always the case with other
%   features (floats and enumerations). Wolfgang suggested adding
%   insidesection={blank[overlay]} to the section heading setup, but
%   that only helps with enumerations and with tabulate tables that do
%   not start with an HL (it fails with natural tables as well). And
%   that success only comes with start/stop sectioning. With traditional
%   sectioning, there are more failures.
%
%
      \setupexternalfigures[location=default]
      \setuphead
        [section]
        [alternative=text,
         command=\SectionCommand,
         distance=0pt,
         insidesection={\blank[overlay]},
        ]
 
      \define[2]\SectionCommand
        {\inmargin{#1 – #2}}
 
      \setuplayout[backspace=4cm]
 
      \starttext
      \startchapter[title={Start/Stop sectioning}]
      \startsection[title={Okay with text first}]
 
      Text here
      \starttabulate
      \FL \NC Knuth \NC \input{knuth} \NC\NR
      \stoptabulate
 
      \stopsection
      \startsection[title={Okay with itemize}]
 
      \startitemize
      \item One
      \item Two
      \item Three
      \stopitemize
 
      \stopsection
      \startsection[title={Okay with tabulate no HL}]
 
      \starttabulate
      \NC Knuth \NC \input{knuth} \NC\NR
      \stoptabulate
 
      \page
      \stopsection
      \startsection[title={Fail with tabulate HL}]
 
      \starttabulate
      \FL \NC Knuth \NC \input{knuth} \NC\NR
      \stoptabulate
      \stopsection
      \startsection[title={Fail with TABLE frame}]
 
      \bTABLE
      \bTR \bTD Knuth \eTD\bTD \input{knuth} \eTD\eTR
      \eTABLE
 
      \stopsection
      \startsection[title={Fail with TABLE no frame}]
 
      \bTABLE[frame=off]
      \bTR \bTD Knuth \eTD\bTD \input{knuth} \eTD\eTR
      \eTABLE
 
      \page
      \stopsection
      \startsection[title={Fails with figures}]
 
      \startplacefigure[location=right,reference={fig:2},title={Caption}]
        \externalfigure[cow.pdf][width=2cm]
      \stopplacefigure
 
      \input{tufte}
 
      \stopsection
      \stopchapter
 
      \chapter{Traditional sectioning}
 
      \section{Okay with text first}
 
      Text here
      \starttabulate
      \FL \NC Knuth \NC \input{knuth} \NC\NR
      \stoptabulate
 
      \section{Fail with itemize}
 
      \startitemize
      \item One
      \item Two
      \item Three
      \stopitemize
 
      \page
      \section{Fail with tabulate no HL}
 
      \starttabulate
      \NC Knuth \NC \input{knuth} \NC\NR
      \stoptabulate
 
      \section{Fail with tabulate HL}
 
      \starttabulate
      \FL \NC Knuth \NC \input{knuth} \NC\NR
      \stoptabulate
 
      \section{Fail with TABLE frame}
 
      \bTABLE
      \bTR \bTD Knuth \eTD\bTD \input{knuth} \eTD\eTR
      \eTABLE
 
      \section{Fail with TABLE no frame}
 
      \bTABLE[frame=off]
      \bTR \bTD Knuth \eTD\bTD \input{knuth} \eTD\eTR
      \eTABLE
 
      \page
      \section[title={Fails with figures startstop}]
 
      \startplacefigure[location=right,reference={fig:2},title={Caption}]
        \externalfigure[cow.pdf][width=2cm]
      \stopplacefigure
 
      \input{tufte}
 
      \section[title={Fails with figures traditional}]
 
      \placefigure[right][fig:2]{Caption}
        {\externalfigure[cow.pdf][width=2cm]}
 
      \input{tufte}
 
      \stoptext

--
Rik Kabel
--------------080809060200010807020609-- --===============0745122294== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============0745122294==--