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

___________________________________________________________________________________
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