ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
	Thomas Meyer <thomasgmeyer@t-online.de>
Subject: [NTG-context] Re: context version 20240118 ("Registerhaltigkeit")
Date: Mon, 22 Jan 2024 20:24:25 +0100	[thread overview]
Message-ID: <ffc74ad8-710b-536e-f6bb-2022fadc7df4@gmail.com> (raw)
In-Reply-To: <33703a4d-89ef-4aaa-937e-4284fc360c3b@t-online.de>

Thomas Meyer schrieb am 22.01.2024 um 13:04:
> 
> 
> Am 22.01.24 um 12:06 schrieb Henning Hraban Ramm:
>> Am 22.01.24 um 11:46 schrieb Thomas Meyer:
>>> I might get a bit impatient if I have the impression that others get 
>>> an answer faster. Sorry for that.
>>
>> It’s not unusual to get that impression. It depends on the current 
>> attention, capacity and mood of the few who can answer your questions.
>>
>>> So the problem is still \hfill that the last paragraph is not on grid 
>>> in the new and the old version (and comma).
>>
>> Grid is not as easy as it looks first. Low level tricks like fills or 
>> skips can mess it up.
>>
>>
>> Maybe \startlinecorrection helps… (No, it doesn’t.)
>>
>> It also doesn’t help to add a \blank or \par after \vfill.
> 
> I know it, i tried it. And I tried \snaptogrid \vbox {}, it doesn't work 
> too.
> 
> Only counting empty rows and set the number in \blank[ *big] works!


You need a fixed space (multiple of the line distance) between the text 
blocks and \vfill is a variable space which isn't what you want here.

TO get the desired space between the blocks you have to measure the 
height of the text at the bottom and calculate the number of lines which 
have to be added in the gap. Below is a simple solution which adds the 
required number of \blank lines.

\def\PlaceAtBottom
   {\par
    \dowithnextbox
       {\scratchdimen\dimexpr\pagegoal-\pagetotal\relax
        \ifdim\nextboxht>\scratchdimen
          \page
          \getnoflines{\dimexpr\textheight-\nextboxht\relax}%
          \dontleavehmode\blank[\number\numexpr\noflines-2\relax*line]%
          \unvbox\nextbox
        \else
          \getnoflines{\dimexpr\scratchdimen-\nextboxht\relax}%
          \blank[\number\numexpr\noflines-1\relax*line]%
          \unvbox\nextbox
        \fi}
       \vbox}

\let\stopPlaceAtBottom\egroup

\def\startPlaceAtBottom
   {\PlaceAtBottom\bgroup}

\mainlanguage[de]
\setupbodyfont[libertinus, 12pt]

\setuppagenumbering
   [location={footer,middle}]

\setuplayout
   [grid=yes]

\showgrid

\starttext

\samplefile{lorem}

\startPlaceAtBottom
{\sl\samplefile{lorem}}
\stopPlaceAtBottom

\page

\dorecurse{4}{\samplefile{lorem}}

\startPlaceAtBottom
{\sl\samplefile{lorem}}
\stopPlaceAtBottom

\stoptext

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

maillist : ntg-context@ntg.nl / 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	other threads:[~2024-01-22 19:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-14  9:30 [NTG-context] "Registerhaltigkeit" Thomas Meyer
2024-01-14  9:59 ` [NTG-context] "Registerhaltigkeit" Wolfgang Schuster
2024-01-14 10:02 ` Henning Hraban Ramm
2024-01-14 10:21   ` Thomas Meyer
2024-01-14 12:53     ` Wolfgang Schuster
2024-01-14 16:36       ` Thomas Meyer
2024-01-17 19:57         ` Thomas Meyer
2024-01-18 11:59           ` [NTG-context] context version 20240118 (was: "Registerhaltigkeit") Thomas Meyer
2024-01-18 12:06             ` [NTG-context] Re: context version 20240118 Hans Hagen via ntg-context
2024-01-18 12:30               ` Thomas Meyer
2024-01-22  9:47               ` [NTG-context] Re: context version 20240118 ("Registerhaltigkeit") Thomas Meyer
2024-01-22  9:56                 ` Hans Hagen via ntg-context
2024-01-22 10:46                   ` Thomas Meyer
2024-01-22 11:06                     ` Henning Hraban Ramm
2024-01-22 12:04                       ` Thomas Meyer
2024-01-22 19:24                         ` Wolfgang Schuster [this message]
2024-01-23 10:39                           ` Thomas Meyer
2024-01-18 12:51             ` [NTG-context] Re: context version 20240118 (was: "Registerhaltigkeit") luigi scarso
2024-01-18 14:01               ` [NTG-context] Re: context version 20240118 Thomas Meyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ffc74ad8-710b-536e-f6bb-2022fadc7df4@gmail.com \
    --to=wolfgang.schuster.lists@gmail.com \
    --cc=ntg-context@ntg.nl \
    --cc=thomasgmeyer@t-online.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).