On Sun, Dec  7, 2025 at 01:31 (+0100), Hans Hagen via ntg-context wrote:

> On 12/6/2025 11:43 PM, Jim wrote:
>> On Sat, Dec  6, 2025 at 17:48 (+0100), Wolfgang Schuster wrote:

>>> Am 06.12.2025 um 17:34 schrieb Jim:
>>> > Hi,

>>> > In my continuing quest to adjust white space to my liking, I ran up 
>>> > against
>>> > an issue with \starttyping that I can't solve.  Here is the example:

>>> > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

>>> > \starttext

>>> > This is a line above \type{\starttyping}:
>>> > \starttyping
>>> > 1. this is typing (and has space above and below)
>>> > \stoptyping
>>> > This is a line below.

>>> > \hairline

>>> > This is a line above \type{\starttyping[before=,after=,]}
>>> > \starttyping[before=,after=,]
>>> > 2. this is typing (and has NO space above or below, just as I want)
>>> > \stoptyping
>>> > This is a line below.

>>> > \hairline

>>> > \setupwhitespace [big]

>>> > \midaligned{\type{*** \setupwhitespace[big]} now in effect ***}

>>> > \hairline

>>> > This is a line above \type{\starttyping}:
>>> > \starttyping
>>> > 3. this is typing (and has space above and below just like '1.')
>>> > \stoptyping
>>> > This is a line below.

>>> > \hairline

>>> > This is a line above \type{\starttyping[before=,after=,]}
>>> > \starttyping[before=,after=,]
>>> > 4. this is typing (and has space above and below, even with 
>>> > [before=,after=,])
>>> > \stoptyping
>>> > This is a line below.

>>> > \hairline

>>> > This is a line above
>>> > \type{\starttyping[before={\blank[disable]},after={\blank[disable]},]}
>>> > \starttyping[before={\blank[disable]},after={\blank[disable]},]
>>> > 5. this is typing (and has space below, even with
>>> >                     [before={\blank[disable]},after={\blank[disable]},])
>>> > \stoptyping
>>> > This is a line below.

>>> > \hairline

>>> > This is a line above \type{\starttyping[before={\blank[order:99,0pt]}},\\
>>> > \null\type{                              
>>> > after={\blank[order:111,disable]}]}
>>> > \starttyping[before={\blank[order:99,0pt]},after={\blank[order:111,disable]},]
>>> > 6. this is typing (space above cancelled, space below still there, even
>>> > with after={\blank[order:111,disable] (or order:1,...)
>>> > \stoptyping
>>> > This is a line below.

>>> > \stoptext

>>> > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

>>> > Attached is the PDF I get when I run ConTeXt on the example above.


>>> > Q1: I had hoped that before=, and after=, would work as well when I have
>>> >       \setupwhitespace [big]
>>> > as when the whitespace is (I assume) [none], but that didn't work.
>>> > Can someone explain the Zen of why I am still getting space in this
>>> > case?

>>> >       (I first speculated that \startyping does something like putting out
>>> > the larger of two vertical space amounts (the \parskip and its default
>>> > before= and after= amounts), but that doesn't seem to be a full
>>> > explanation.)


>>> > Q2: I tried various and sundry incantations to remove the space above and
>>> > below the typing.  As seen, I did manage to remove the "above" space,
>>> > but the "below" space has resisted my pathetic attempts (some shown
>>> > above, others not included here) to remove it.

>>> > Can someone explain to me how I can remove the "below" space?
>>> >       (Or point me to a part of some documentation that explains it?)

>>> \setupwhitespace
>>>    [big]

>>> \setuptyping
>>>    [before={\blank[disable]},
>>> after={\blank[nowhite]}]

>>> \starttext

>>> Before
>>> \starttyping
>>> Inbetween
>>> \stoptyping
>>> After

>>> \stoptext

>> Wolfgang,

>> thanks very much for the help.  I had tried \blank[nowhite], but for
>> before=, not realizing it only works for after=.

> It all depends on where you hook it in. In principle using before should
> work, but it depends bit on the situation. Whitespace aka parskip kicks in
> when a new paragraph starts. The spacing is one of the more complicated
> mechanisms but also an oldie, basically not that different from mkii
> although it has extra features in mkiv (that probably no one uses). Changes
> are unlikely.

> \starttext
>     \setupwhitespace[big]
>     \samplefile{tchaikovsky}\par
>     \blank[nowhite]
>     \samplefile{tchaikovsky}\par
>     \blank[3*big]
>     \blank[back]
>     \samplefile{tchaikovsky}\par
>     \blank[3*big]
>     \blank[back]
>     \blank[nowhite]
>     \samplefile{tchaikovsky}\par
>     \samplefile{tchaikovsky}\par
>     \blank[packed]
>     \samplefile{tchaikovsky}\par

>     \definestartstop[one]  [before=\par,after=\blank[nowhite]]
>     \definestartstop[two]  [before=\blank[nowhite],after=\par]
>     \definestartstop[three][before=\blank[packed],after=\par]

>     \startone
> one: \samplefile{tchaikovsky}
>     \stopone
> none: \samplefile{tchaikovsky}
>     \starttwo
> two: \samplefile{tchaikovsky}
>     \stoptwo % whitespace after
> none: \samplefile{tchaikovsky}
>     \startthree
> three: \samplefile{tchaikovsky}
>     \stopthree
> \stoptext

Hans, thanks for the example.  (I might have guessed Tchaikovsky might have
wrote something about music...)

Your example, and Wolfgang's solution to my original question, are both
helpful.  And yet the moment of Zen enlightenment has not (yet) arrived in
my brain.

I think the wiki page for \blank would be more helpful if there was some
pseudo-code description of what \blank actually does, especially in the
case where \blank[] is before and/or after other vertical space or other
\blank[] commands.  I have a glimpse of (part of) what is happening, but I
know it is incomplete.

I recognize it is easy for me to suggest that "someone" should improve the
wiki page.  I would volunteer to do this if I actually understood what was
going on, but at this point I'm not near that level of understanding.


Incidentally, even having updated my ConTeXt distro today, I get different
results when I copy and paste the large example into a file and run ConTeXt
on that file.  (Once again I wonder whether this is somehow a "me" thing, or
whether the wiki uses an older version of ConTeXt, or something else yet.)

Thanks.
                                Jim

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to