Unwanted whitespace for tables and enumerations after \inmargin headings
(This appears to be the same issue which was raised by Alexandros Frantzis in October 2008; see the thread at http://www.mail-archive.com/ntg-context%40ntg.nl/msg32125.html. No resolution was proposed at that time, and the problem still exists.) Extra whitespace occurs before itemizations and tabulations (and quite possibly other structures) which appear immediately following an in-margin heading. The following example illustrates this. \setuplayout [backspace=7cm,leftmargin=6cm] \setuphead [chapter][] \setuphead [subsection] [alternative=normal,command=,distance=1em] \setuphead [subsubsection] [alternative=normal,command=,distance=1em] \setuphead [section][distance=0pt, alternative=text, command=\MarginHead] \define[2]\MarginHead{\inmargin{#1 #2}} \startbuffer[Item] \startitemize \item Item \item Idem \stopitemize \stopbuffer \startbuffer[Table] \starttabulate[|l|l|] \FL\NC Entry \NC one \NC\NR \NC Entry \NC two \NC\NR\LL \stoptabulate \stopbuffer \starttext \chapter{Itemize} \section{No extra whitespace} With text here there is no extra whitespace before the itemization. \getbuffer[Item] \subsection{No extra whitespace} With text here there is no extra whitespace before the itemization. \getbuffer[Item] \section{Extra whitespace} \getbuffer[Item] With no text before the itemization there is extra space after the heading. \subsection{No extra whitespace} \getbuffer[Item] With no text before the itemization there is extra space after the heading. \chapter{Tabulate} \section{No extra whitespace} With text here there is no extra whitespace before the table. \getbuffer[Table] \subsection{No extra whitespace} With text here there is no extra whitespace before the table. \getbuffer[Table] \section{Extra whitespace} \getbuffer[Table] With no text before the table there is extra space after the heading. \subsection{No extra whitespace} \getbuffer[Table] With no text before the table there is extra space after the heading. \stoptext Is this unresolvable? Like Alexandros, I have tried many of the options that looked appropriate, but nothing seems to work. -- Rik Kabel
Hi Rik, The example isn't quite as minimal as it could be... Here is a simplified version demonstrating the problem: \setuplayout[backspace=4cm] \define[2]\MarginHead{\inmargin{#1 #2}} \setuphead[section][ alternative=text, command=\MarginHead, ] \defineitemgroup[itemz] \setupitemgroup[itemz][each][joinedup] \startbuffer[Item] \startitemz \item Item \item Item \stopitemz \stopbuffer \starttext \section{No Whitespace} No extra whitespace before items. \getbuffer[Item] \section{Extra Whitespace} \getbuffer[Item] Unexpected extra whitespace before items. \stoptext
On Fri, 18 Apr 2014, Thangalin wrote:
Hi Rik,
The example isn't quite as minimal as it could be... Here is a simplified version demonstrating the problem:
\setuplayout[backspace=4cm]
\define[2]\MarginHead{\inmargin{#1 #2}}
\setuphead[section][ alternative=text, command=\MarginHead, ]
\defineitemgroup[itemz] \setupitemgroup[itemz][each][joinedup]
\startbuffer[Item] \startitemz \item Item \item Item \stopitemz \stopbuffer
\starttext \section{No Whitespace} No extra whitespace before items. \getbuffer[Item]
\section{Extra Whitespace} \getbuffer[Item] Unexpected extra whitespace before items. \stoptext
Here is one way to get rid of the extra white-space. I could not figure out a clean way of adding this signal to the setup. \setuplayout[backspace=6cm, leftmargin=5.5cm] \define[2]\MarginHead{\inmargin{#1 #2}} \setuphead[section] [ command=\MarginHead, alternative=text, distance=\zeropoint, ] \unprotect \def\SIGNAL{\hskip\d_strc_itemgroups_signal} \protect \defineitemgroup[itemz] \setupitemgroup[itemz][each][joinedup] \startbuffer[Item] \startitemz \item Item \item Item \stopitemz \stopbuffer \starttext \section{No Whitespace} No extra whitespace before items. \getbuffer[Item] \section{Extra Whitespace} \SIGNAL \getbuffer[Item] Unexpected extra whitespace before items. \stoptext
On 2014-04-18 17:36, Aditya Mahajan wrote:
On Fri, 18 Apr 2014, Thangalin wrote:
Hi Rik,
The example isn't quite as minimal as it could be... Here is a simplified version demonstrating the problem:
\setuplayout[backspace=4cm]
\define[2]\MarginHead{\inmargin{#1 #2}}
\setuphead[section][ alternative=text, command=\MarginHead, ]
\defineitemgroup[itemz] \setupitemgroup[itemz][each][joinedup]
\startbuffer[Item] \startitemz \item Item \item Item \stopitemz \stopbuffer
\starttext \section{No Whitespace} No extra whitespace before items. \getbuffer[Item]
\section{Extra Whitespace} \getbuffer[Item] Unexpected extra whitespace before items. \stoptext
Here is one way to get rid of the extra white-space. I could not figure out a clean way of adding this signal to the setup.
\setuplayout[backspace=6cm, leftmargin=5.5cm]
\define[2]\MarginHead{\inmargin{#1 #2}}
\setuphead[section] [ command=\MarginHead, alternative=text, distance=\zeropoint, ]
\unprotect \def\SIGNAL{\hskip\d_strc_itemgroups_signal} \protect \defineitemgroup[itemz] \setupitemgroup[itemz][each][joinedup]
\startbuffer[Item] \startitemz \item Item \item Item \stopitemz \stopbuffer
\starttext \section{No Whitespace} No extra whitespace before items. \getbuffer[Item]
\section{Extra Whitespace} \SIGNAL \getbuffer[Item] Unexpected extra whitespace before items. \stoptext
Pretty ugly, but thank you for that, Aditya. Is there a similar kludge for tabulate? (That was part of my original problem, removed in the subsequent simplification of the example.) -- Rik
Am 19.04.2014 um 02:11 schrieb Rik Kabel
On 2014-04-18 17:36, Aditya Mahajan wrote:
On Fri, 18 Apr 2014, Thangalin wrote:
Hi Rik,
The example isn't quite as minimal as it could be... Here is a simplified version demonstrating the problem:
\setuplayout[backspace=4cm]
\define[2]\MarginHead{\inmargin{#1 #2}}
\setuphead[section][ alternative=text, command=\MarginHead, ]
\defineitemgroup[itemz] \setupitemgroup[itemz][each][joinedup]
\startbuffer[Item] \startitemz \item Item \item Item \stopitemz \stopbuffer
\starttext \section{No Whitespace} No extra whitespace before items. \getbuffer[Item]
\section{Extra Whitespace} \getbuffer[Item] Unexpected extra whitespace before items. \stoptext
Here is one way to get rid of the extra white-space. I could not figure out a clean way of adding this signal to the setup.
\setuplayout[backspace=6cm, leftmargin=5.5cm]
\define[2]\MarginHead{\inmargin{#1 #2}}
\setuphead[section] [ command=\MarginHead, alternative=text, distance=\zeropoint, ]
\unprotect \def\SIGNAL{\hskip\d_strc_itemgroups_signal} \protect \defineitemgroup[itemz] \setupitemgroup[itemz][each][joinedup]
\startbuffer[Item] \startitemz \item Item \item Item \stopitemz \stopbuffer
\starttext \section{No Whitespace} No extra whitespace before items. \getbuffer[Item]
\section{Extra Whitespace} \SIGNAL \getbuffer[Item] Unexpected extra whitespace before items. \stoptext
Pretty ugly, but thank you for that, Aditya.
Is there a similar kludge for tabulate? (That was part of my original problem, removed in the subsequent simplification of the example.)
\setuphead [section] [alternative=text, command=\SectionCommand, distance=0pt, insidesection={\blank[overlay]}] \define[2]\SectionCommand {\inmargin{#1 – #2}} \setuplayout[backspace=4cm] \starttext \startsection[title={First}] \input ward \stopsection \startsection[title={Second}] \startitemize \item One \item Two \stopitemize \stopsection \startsection[title={Third}] \starttabulate \NC Knuth \NC \input{knuth} \NC\NR \NC Tufte \NC \input{tufte} \NC\NR \stoptabulate \stopsection \stoptext Wolfgang
On 2014-04-19 04:55, Wolfgang Schuster wrote:
\setuphead [section] [alternative=text, command=\SectionCommand, distance=0pt, insidesection={\blank[overlay]}]
\define[2]\SectionCommand {\inmargin{#1 -- #2}}
\setuplayout[backspace=4cm]
\starttext
\startsection[title={First}]
\input ward
\stopsection
\startsection[title={Second}]
\startitemize \item One \item Two \stopitemize
\stopsection
\startsection[title={Third}]
\starttabulate \NC Knuth \NC \input{knuth} \NC\NR \NC Tufte \NC \input{tufte} \NC\NR \stoptabulate
\stopsection
\stoptext
Wolfgang
Thank you, Wolfgang. This works mostly, but not completely, for start/stop sectioning (not for classic sectioning). I do notice that there is still a problem with tabulations if you add a horizontal line (\HL or \FL) to the beginning of the table. New example, building on yours: \setuphead [section] [alternative=text, command=\SectionCommand, distance=0pt, insidesection={\blank[overlay]}] \define[2]\SectionCommand {\inmargin{#1 -- #2}} \setuplayout[backspace=4cm] \starttext \startsection[title={Okay with text here}] Text here \starttabulate \FL \NC Knuth \NC \input{knuth} \NC\NR \NC Tufte \NC \input{tufte} \NC\NR \stoptabulate \stopsection \startsection[title={Fails with no text}] \starttabulate \FL \NC Knuth \NC \input{knuth} \NC\NR \NC Tufte \NC \input{tufte} \NC\NR \stoptabulate \stopsection \stoptext -- RIk Kabel
participants (5)
-
Aditya Mahajan
-
Rik
-
Rik Kabel
-
Thangalin
-
Wolfgang Schuster