[NTG-context] CLD setupheadertexts

Willi Egger w.egger at boede.nl
Thu Aug 25 19:56:11 CEST 2022


Hans! Thank you so much for your help and quick answer. Indeed now all header texts appear as expected :-)

I will wikify this of course!

Kind regards

Willi

> On 25 Aug 2022, at 19:45, Hans Hagen <j.hagen at freedom.nl> wrote:
> 
> On 8/25/2022 7:32 PM, Willi Egger via ntg-context wrote:
>> Hello!
>> I have a ConTeXt Lua Document where I need to have headertexts.
>> When running the enclosed file I get 6 pages where only page 1 and 2 have header texts and the others none. — Why is that?
>> Thanks for hints!
> you use a function but headertexts are not frozen which meand that you need to do this:
> 
> 	context.setupheadertexts(
>            {
>                function()
>                    context("\\bf")
>                    context(monthname)
>                    return true
>                end
>            },
>            {
>                function()
>                    context(year)
>                    return true
>                end
>            },
> 	  		{
>                function()
>                    context("\\bf")
>                    context(monthname)
>                    return true
>                end
>            },
>            {
>                function()
>                    context(year)
>                    return true
>                end
>            }
>        )
> 
> the "return true" makes sure that the function stays around
> 
> I'm sure that you will wikify this ...
> 
> 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
> -----------------------------------------------------------------



More information about the ntg-context mailing list