1

When my MWE has \setupalign[height], my bottom floats sit correctly at the bottom of the page, but the vertical gap between a heading and the following text can be too big.

When I delete \setupalign[height], my bottom floats are just above the bottom of the page, but the vertical gap between a heading and the following text is correct.

I seem to be able to fix the problem by including \setupalign[height] and changing my \setupwhitespace to:

\setupwhitespace [4pt plus 1pt minus 1pt]

Is this the best thing to do ?

align

\setupalign[height] % delete this line or not

\showframe 
\setupwhitespace [quarterline]

\defineexternalfigure [myfigure][width=\textwidth]
\definefloat[myfloat][figure][location={bottom,none}]

\starttext

\dorecurse{1}{\input tufte\par}
We thrive in information--thick worlds because of our marvelous and everyday ca­ pacity to select, edit, single out, structure, highlight, group, pair, merge, harmo­ nize, synthesize, focus, organize, condense, reduce, boil down, choose, categorize, catalog, classify, list, abstract, scan, look into, idealize, isolate, discriminate, dis­ tinguish, screen, pigeonhole, pick over.
\startplacefloat [myfloat][location={bottom,none}]
    \externalfigure[greybox][myfigure]
\stopplacefloat
\dorecurse{2}{\input tufte\par}

\page

\startsection [title=First section]
\dorecurse{6}{\input tufte\par}

\page

\startsection [title=Second section]
\dorecurse{2}{\input tufte\par}

\stopsection

\stoptext

1 Answer 1

2

When you use \setupalign[height], you're forcing the bottom of the last line to be aligned with the bottom of the textblock. If the height of the text on the page is less than height of the textblock, then something has to stretch to align the bottom. On page 3, the glue after the header is the "stretchiest", so it expands to correctly align the bottom. Adding \setupwhitespace[quarterline] adds a quarter-line of stretch(?) after each paragraph, meaning that the glue after the section heading doesn't need to stretch as much. Whether or not this is the best thing to do is purely a matter of taste.

If your only goal here is to get bottom floats to be at the very bottom of the page, then you can remove \setupalign[height] and \setupwhitespace[quarterline] and add \setupfloat[bottombefore=\vfill]:

\showframe
\setupfloat[bottombefore=\vfill]

\defineexternalfigure [myfigure][width=\textwidth]
\definefloat[myfloat][figure][location={bottom,none}]

\starttext

\dorecurse{1}{\input tufte\par}
We thrive in information--thick worlds because of our marvelous and everyday ca­ pacity to select, edit, single out, structure, highlight, group, pair, merge, harmo­ nize, synthesize, focus, organize, condense, reduce, boil down, choose, categorize, catalog, classify, list, abstract, scan, look into, idealize, isolate, discriminate, dis­ tinguish, screen, pigeonhole, pick over.
\startplacefloat [myfloat][location={bottom,none}]
    \externalfigure[greybox][myfigure]
\stopplacefloat
\dorecurse{2}{\input tufte\par}

\page

\startsection [title=First section]
\dorecurse{6}{\input tufte\par}

\page

\startsection [title=Second section]
\dorecurse{2}{\input tufte\par}

\stopsection

\stoptext

enter image description here

If you want to keep \setupalign[height] and don't want the glue after the header to stretch, then you'll need to either adjust the total height of the heading (before skip + text height + after skip) to be an integer multiple of \baselineskip, or you'll need to add some stretch somewhere else on the page (like you did with \setupwhitespace[quarterline].

1
  • 1
    Thank you. I'm using whitespace to separate my parahraphs, not the more ususal no-whitespace + indent first word. I like how \setupalign [height] will stretch the layout to put the bottom of a text-only page actually at the bottom of the page. So, I'll go with your second suggestion, and use stretchy whitespace between paragraphs.
    – Stanley
    Commented Feb 17, 2023 at 20:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .