ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Unwanted whitespace for tables and enumerations after \inmargin headings
@ 2014-04-17 23:19 Rik Kabel
  2014-04-18 19:54 ` Thangalin
  0 siblings, 1 reply; 7+ messages in thread
From: Rik Kabel @ 2014-04-17 23:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2434 bytes --]

(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

[-- Attachment #1.2: Type: text/html, Size: 4763 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Unwanted whitespace for tables and enumerations after \inmargin headings
  2014-04-17 23:19 Unwanted whitespace for tables and enumerations after \inmargin headings Rik Kabel
@ 2014-04-18 19:54 ` Thangalin
  2014-04-18 21:36   ` Aditya Mahajan
  0 siblings, 1 reply; 7+ messages in thread
From: Thangalin @ 2014-04-18 19:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Unwanted whitespace for tables and enumerations after \inmargin headings
  2014-04-18 19:54 ` Thangalin
@ 2014-04-18 21:36   ` Aditya Mahajan
  2014-04-19  0:11     ` Rik Kabel
  0 siblings, 1 reply; 7+ messages in thread
From: Aditya Mahajan @ 2014-04-18 21:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Unwanted whitespace for tables and enumerations after \inmargin headings
  2014-04-18 21:36   ` Aditya Mahajan
@ 2014-04-19  0:11     ` Rik Kabel
  2014-04-19  8:55       ` Wolfgang Schuster
  0 siblings, 1 reply; 7+ messages in thread
From: Rik Kabel @ 2014-04-19  0:11 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Unwanted whitespace for tables and enumerations after \inmargin headings
  2014-04-19  0:11     ` Rik Kabel
@ 2014-04-19  8:55       ` Wolfgang Schuster
  2014-04-19  9:07         ` Thangalin
  2014-04-19 15:46         ` Rik
  0 siblings, 2 replies; 7+ messages in thread
From: Wolfgang Schuster @ 2014-04-19  8:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2549 bytes --]


Am 19.04.2014 um 02:11 schrieb Rik Kabel <context@rik.users.panix.com>:

> 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

[-- Attachment #1.2: Type: text/html, Size: 3816 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Unwanted whitespace for tables and enumerations after \inmargin headings
  2014-04-19  8:55       ` Wolfgang Schuster
@ 2014-04-19  9:07         ` Thangalin
  2014-04-19 15:46         ` Rik
  1 sibling, 0 replies; 7+ messages in thread
From: Thangalin @ 2014-04-19  9:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

>    insidesection={\blank[overlay]}]

This appears to require the latest beta.
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Unwanted whitespace for tables and enumerations after \inmargin headings
  2014-04-19  8:55       ` Wolfgang Schuster
  2014-04-19  9:07         ` Thangalin
@ 2014-04-19 15:46         ` Rik
  1 sibling, 0 replies; 7+ messages in thread
From: Rik @ 2014-04-19 15:46 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 1612 bytes --]

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


[-- Attachment #1.2: Type: text/html, Size: 4159 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-04-19 15:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-17 23:19 Unwanted whitespace for tables and enumerations after \inmargin headings Rik Kabel
2014-04-18 19:54 ` Thangalin
2014-04-18 21:36   ` Aditya Mahajan
2014-04-19  0:11     ` Rik Kabel
2014-04-19  8:55       ` Wolfgang Schuster
2014-04-19  9:07         ` Thangalin
2014-04-19 15:46         ` Rik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).