prevent a kind of heading at the bottom of the page

Hi folks, once again I have a problem - I'm sure it's not one for you experts! I've set up a diary that basically looks like this: \mainlanguage[de] \definebodyfontenvironment[12pt][interlinespace=15pt] \setuppagenumbering[location={footer,middle}, alternative=onesided] \setuplayout[ lines=44, grid=yes, ] \showgrid \startluacode function userdata.Ddate(str) local year = string.sub(str,1,4) local month = string.sub(str,5,6) local day = string.sub(str,7,8) context.date({d=day,m=month,y=year},{"weekday,{, },day,{. },month,space,year"}) end \stopluacode \def\DDate#1{\blank\noindentation{\bf\ss\ctxlua{userdata.Ddate("#1")}}\\ } \starttext \DDate{20250101} \samplefile{knuth} \DDate{20250102} \samplefile{knuth} \DDate{20250103} \samplefile{knuth} ... \stoptext But if the DDate line is moved to the bottom of the page, it is not moved to the next page above the text like a heading. The date line should therefore function like a heading. If I move it via \subject{\DDate{20250101}} the font size is of course no longer correct and I have blank lines underneath. Please help me with this. Greetings Thomas

On 2/13/2025 10:58 AM, Thomas Meyer wrote:
\startluacode function userdata.Ddate(str) local year = string.sub(str,1,4) local month = string.sub(str,5,6) local day = string.sub(str,7,8) context.date({d=day,m=month,y=year},{"weekday,{, },day, {. },month,space,year"}) end \stopluacode
\def\DDate#1{\blank\noindentation{\bf\ss\ctxlua{userdata.Ddate("#1")}}\\ }
Don't use these \\ shortcuts ... just \par will do. Anyway, yopu can try this: \def\DDate#1% {\blank \noindentation{\bf\ss\ctxlua{userdata.Ddate("#1")}} \blank[samepage]} Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------

/Don't use these \\ shortcuts ... just \par will do. /Okay! / Anyway, yopu can try this: / / \def\DDate#1% {\blank \noindentation{\bf\ss\ctxlua{userdata.Ddate("#1")}} \blank[samepage]} /That works! *Thank you Hans!* Greetings Thomas Am 13.02.25 um 13:10 schrieb Hans Hagen via ntg-context:
On 2/13/2025 10:58 AM, Thomas Meyer wrote:
\startluacode function userdata.Ddate(str) local year = string.sub(str,1,4) local month = string.sub(str,5,6) local day = string.sub(str,7,8) context.date({d=day,m=month,y=year},{"weekday,{, },day, {. },month,space,year"}) end \stopluacode
\def\DDate#1{\blank\noindentation{\bf\ss\ctxlua{userdata.Ddate("#1")}}\\ }
Don't use these \\ shortcuts ... just \par will do. Anyway, yopu can try this:
\def\DDate#1% {\blank \noindentation{\bf\ss\ctxlua{userdata.Ddate("#1")}} \blank[samepage]}
Hans
----------------------------------------------------------------- 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 : 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 ___________________________________________________________________________________

Am 13.02.2025 um 10:58 schrieb Thomas Meyer:
Hi folks,
once again I have a problem - I'm sure it's not one for you experts! I've set up a diary that basically looks like this:
\mainlanguage[de]
\definebodyfontenvironment[12pt][interlinespace=15pt] \setuppagenumbering[location={footer,middle}, alternative=onesided]
onesided isn't a valid keyword for the alternative key, only singlesided and doublesided can be used.
\setuplayout[ lines=44, grid=yes, ]
\showgrid
\startluacode function userdata.Ddate(str) local year = string.sub(str,1,4) local month = string.sub(str,5,6) local day = string.sub(str,7,8) context.date({d=day,m=month,y=year},{"weekday,{, },day, {. },month,space,year"}) end \stopluacode
\def\DDate#1{\blank\noindentation{\bf\ss\ctxlua{userdata.Ddate("#1")}}\\ }
You can use \testpage to force a page break when not enough space is available for the following content. \starttexdefinition protected DDate #1 \blank \testpage[3] \noindentation\style[sansbold]{\ctxlua{userdata.Ddate("#1")}} \par \stoptexdefinition Wolfgang

Am 13.02.25 um 16:35 schrieb Wolfgang Schuster:
\setuppagenumbering[location={footer,middle}, alternative=onesided]
onesided isn't a valid keyword for the alternative key, only singlesided and doublesided can be used.
Okay! It seems better. I never got an error message.
\startluacode function userdata.Ddate(str) local year = string.sub(str,1,4) local month = string.sub(str,5,6) local day = string.sub(str,7,8) context.date({d=day,m=month,y=year},{"weekday,{, },day, {. },month,space,year"}) end \stopluacode
\def\DDate#1{\blank\noindentation{\bf\ss\ctxlua{userdata.Ddate("#1")}}\\ }
You can use \testpage to force a page break when not enough space is available for the following content.
\starttexdefinition protected DDate #1 \blank \testpage[3] \noindentation\style[sansbold]{\ctxlua{userdata.Ddate("#1")}} \par \stoptexdefinition
Okaay! Thank you Wolfgang! Greetings Thomas
participants (3)
-
Hans Hagen
-
Thomas Meyer
-
Wolfgang Schuster