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 Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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