ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Struggling with cld document...
@ 2011-12-22 21:31 Willi Egger
  2011-12-22 21:38 ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Willi Egger @ 2011-12-22 21:31 UTC (permalink / raw)
  To: NTG-Context ConTeXt users

Hello all,

While preparing a cld-document I need to setup the headertexts on each new page. I tried to do this with the following code:

\setuplayout
	[topspace=2.5cm,
	backspace=1.5cm,
	header=40pt,
	footer=20ptpt,
	height=middle,
	width=middle]

\setuppagenumbering[location=footer]
%\showframe
\startluacode
  function myheadertext(s)
     context.setupheadertexts{context(s)} --context.labeltext(s)
  end   
\stopluacode

\starttext
\ctxluamyheadertext{"Headertext"}}
\input knuth
\stoptext

Hm, what I get is a right-square-bracket in front of the text and no header. - What do I miss?


Kind regards

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Struggling with cld document...
  2011-12-22 21:31 Struggling with cld document Willi Egger
@ 2011-12-22 21:38 ` Wolfgang Schuster
  2011-12-22 22:23   ` Willi Egger
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2011-12-22 21:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 22.12.2011 um 22:31 schrieb Willi Egger:

> Hello all,
> 
> While preparing a cld-document I need to setup the headertexts on each new page. I tried to do this with the following code:
> 
> \setuplayout
> 	[topspace=2.5cm,
> 	backspace=1.5cm,
> 	header=40pt,
> 	footer=20ptpt,
> 	height=middle,
> 	width=middle]
> 
> \setuppagenumbering[location=footer]
> %\showframe
> \startluacode
>  function myheadertext(s)
>     context.setupheadertexts{context(s)} --context.labeltext(s)
>  end   
> \stopluacode

\startluacode
function documentdata.myheadertext(s)
    context.setupheadertexts{s}
end   
\stopluacode

> \starttext
> \ctxluamyheadertext{"Headertext"}}

String are passed with braces.

\ctxlua{documentdata.myheadertext("Headertext")}

Wolfgang

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Struggling with cld document...
  2011-12-22 21:38 ` Wolfgang Schuster
@ 2011-12-22 22:23   ` Willi Egger
  2011-12-22 22:36     ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Willi Egger @ 2011-12-22 22:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Wolfgang,


thank you very much for your reply. 

This works but I am still not there. I need to use this construct with context.labeltext()
So do you know how to achieve the context.setupheadertext with the context.labeltext() as its argument?

Thank you

Willi
On 22 Dec 2011, at 22:38, Wolfgang Schuster wrote:

> 
> Am 22.12.2011 um 22:31 schrieb Willi Egger:
> 
>> Hello all,
>> 
>> While preparing a cld-document I need to setup the headertexts on each new page. I tried to do this with the following code:
>> 
>> \setuplayout
>> 	[topspace=2.5cm,
>> 	backspace=1.5cm,
>> 	header=40pt,
>> 	footer=20ptpt,
>> 	height=middle,
>> 	width=middle]
>> 
>> \setuppagenumbering[location=footer]
>> %\showframe
>> \startluacode
>> function myheadertext(s)
>>    context.setupheadertexts{context(s)} --context.labeltext(s)
>> end   
>> \stopluacode
> 
> \startluacode
> function documentdata.myheadertext(s)
>    context.setupheadertexts{s}
> end   
> \stopluacode
> 
>> \starttext
>> \ctxluamyheadertext{"Headertext"}}
> 
> String are passed with braces.
> 
> \ctxlua{documentdata.myheadertext("Headertext")}
> 
> Wolfgang
> 
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Struggling with cld document...
  2011-12-22 22:23   ` Willi Egger
@ 2011-12-22 22:36     ` Wolfgang Schuster
  2011-12-23 21:05       ` Willi Egger
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2011-12-22 22:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 22.12.2011 um 23:23 schrieb Willi Egger:

> Hi Wolfgang,
> 
> 
> thank you very much for your reply. 
> 
> This works but I am still not there. I need to use this construct with context.labeltext()
> So do you know how to achieve the context.setupheadertext with the context.labeltext() as its argument?


You need “function() … end” around the inner content, it’s explained in the cld manual.

\setuppagenumbering[location=footer]

\setuplabeltext[en][willi=Willi Egger]
\startluacode
function documentdata.myheadertext(s)
    context.setupheadertexts{ function()
        context.labeltext("willi")
--      context.space()
        context(": ")
        context(s)
    end }
end   
\stopluacode

\ctxlua{documentdata.myheadertext("Headertext")}

\starttext
\input knuth
\stoptext

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Struggling with cld document...
  2011-12-22 22:36     ` Wolfgang Schuster
@ 2011-12-23 21:05       ` Willi Egger
  0 siblings, 0 replies; 5+ messages in thread
From: Willi Egger @ 2011-12-23 21:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello Wolfgang,

Thank you for your answer. Indeed now it works. Yes it is in the cld-manual and I was looking at it, but there was no bell ringing then :-(

Willi
On 22 Dec 2011, at 23:36, Wolfgang Schuster wrote:

> 
> Am 22.12.2011 um 23:23 schrieb Willi Egger:
> 
>> Hi Wolfgang,
>> 
>> 
>> thank you very much for your reply. 
>> 
>> This works but I am still not there. I need to use this construct with context.labeltext()
>> So do you know how to achieve the context.setupheadertext with the context.labeltext() as its argument?
> 
> 
> You need “function() … end” around the inner content, it’s explained in the cld manual.
> 
> \setuppagenumbering[location=footer]
> 
> \setuplabeltext[en][willi=Willi Egger]
> \startluacode
> function documentdata.myheadertext(s)
>    context.setupheadertexts{ function()
>        context.labeltext("willi")
> --      context.space()
>        context(": ")
>        context(s)
>    end }
> end   
> \stopluacode
> 
> \ctxlua{documentdata.myheadertext("Headertext")}
> 
> \starttext
> \input knuth
> \stoptext
> 
> Wolfgang
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-12-23 21:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-22 21:31 Struggling with cld document Willi Egger
2011-12-22 21:38 ` Wolfgang Schuster
2011-12-22 22:23   ` Willi Egger
2011-12-22 22:36     ` Wolfgang Schuster
2011-12-23 21:05       ` Willi Egger

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).