On Wed, Jan 28, 2026 at 21:37 (+0100), Hans Hagen wrote:

> On 1/28/2026 8:58 PM, Jim wrote:
>> Hi,

>> I am in the middle of trying to put a newsletter together.  A heading
>> occurred as the last line on a page, so I put
>>          \testpage[][1.5in]
>> in front of it.

>> All was good, the heading went onto the next page.

>> Then, higher up in the page, I put
>>          \blank[2*line]
>> to separate a couple of things.

>> Curiously, the afore-mentioned heading now appears on the page.

>> In desperation (publishing deadlines, you know) I can use brute force, but
>> I hate doing that.

>> I tried creating a minimal example, but (sort of unfortunately) that
>> behaved as expected.

>> Doing a binary search through my config may reveal what sin I have
>> committed to cause this, but that will have to wait (publishing deadline).

>> In the interim, does this situation tweak anyone's memory of seeing
>> something like this before?  If so, do you have any words of wisdom for me,
>> so I can narrow down the hunt?

> It will always be unreliable as it triggers the output routine which can
> interfere.

> You can try several methods:

> \testpage
> \testpageonly
> \testpagesync

> If you're in experimental mode you can try this (\pagelastheight might be
> more reliable that \pagetotal).

> \unprotect

> \defcsname\??pagecheckermethod 4\endcsname
>   {\ifdim\pagegoal<\maxdimen \relax
>      \ifdim\pagelastheight<\pagegoal \relax
>        \ifdim{\page_check_amount-\pagegoal}>-\lineheight
>          \pagecheckerparameter\c!before
>          \penalty-\plustenthousand
>          \pagecheckerparameter\c!after
>        \else
>          \pagecheckerparameter\c!inbetween
>        \fi
>      \else
>        \pagecheckerparameter\c!inbetween
>      \fi
>    \else
>      \goodbreak
>      \pagecheckerparameter\c!inbetween
>    \fi}

> \definepagechecker[\s!unknown:4][\s!unknown:0][\c!method=4]

> \protect

> \showframe

> \starttext
>     \dorecurse{38}{test #1.1\par}
>     \checkpage[unknown:4][lines=23,offset=0pt]
>     \dorecurse{10}{test #1.2\par}
> \stoptext

What with my deadline behind me, I am happy to go into experimental mode.
However, aside from running your example, I regret to report that I'm not
sure what I should learn from the above.

In related news, I managed to create a sorta-kinda-minimal example showing
(a) my issue with \testpage not ejecting the page when it "really should",
    (i.e., when I think it really should); and
(b) some other sources of confusion for me:
    (i)  change the "\iftrue" to "\iffalse", and although the word
         "Announcements" (in the middle of the page) stays in the same spot
         on the page (+/- epsilon), the page further down shifts around a
         bit and "Layout" gets to the next page, as called for.
         But why?
    (ii) If "%Word  " on the 7th last line is uncommented, even though this
         is after the page break, now "Layout" moves to the second page, as
         called for.

(This example doesn't exactly reproduce the problem I originally had, but I
didn't save the exact page contents for that problem, and so my example
below shows some closely related problems.)

No doubt (*cough*) some of these issues have to do with ConTeXt's output
routines.  While I understand plain TeX's output routine enough to have
modified it for my own purposes on occasion, I have no familiarity with
ConTeXt's output routine.

But even in the face of my lack of understanding about the "(b)" sources of
confusion, I would like to know why neither of my \testpage commands give me
a page break.

I apologize for my example not being minimum, but I think it is close to
minimal.

%%%%%%%%%%%%%%%%%%%%%%%%%%%% Line 0 of example %%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setupwhitespace [big]
\setuppapersize [letter]
\setuplayout[
        backspace=0.5in,
        width=7.5in,
        topspace=37.77pt,
        header=12pt,
        headerdistance=20.5pt,
        height=705.70255,
        footerdistance=11.5pt,
        footer=12pt,
]

\starttext

Word\vskip 26pt

Word\vskip0.6in\relax word.

% If this \iftrue is changed to \iffalse, the word "Announcements" below
% is the same distance from the top of the page, but the rest of the page
% changes a bit and "Layout:" moves to the next page.
%\iffalse
\iftrue
Word \\ word \\ word \\ word \\ word \\ word \\ word.

Word \\ word.
\else
\vskip 134pt
\fi

\vskip 6pt

{\bfa Announcements:}
\startitemize[packed]
\item Word \\ word \\ word \\ word.
\item Word
    \startitemize[nowhite]
    \item Word
    \item More words
    \item More words
    \stopitemize
\stopitemize

\vskip 6 pt

{\bfa Word:}

Word \\ word \\ word.

{\bf Word:}
\startitemize[packed]
\item Word \\ word.
\item Word \\ word.
\item Word \\ word.
\stopitemize

\testpage[121]          % 121 lines left?
\testpage[][4in]        % 4 inches left?

{\bf Layout:}

\startitemize[packed]
\vskip-\parskip % Counter-measure to unwanted vertical space.

%Word  % If this line is uncommented, "Layout:" jumps to page 2(!).

\placefigure[right,none,height,low]{}{\externalfigure[doesNotMatter][width=3.3in]}
\item Word.
\stopitemize

\stoptext

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% end of example %%%%%%%%%%%%%%%%%%%%%%%%%%%%%

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