ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: How to implement a changing navigation bar?
  2004-08-16 16:12 How to implement a changing navigation bar? Stefan Wachter
@ 2004-08-16 15:58 ` Vit Zyka
  2004-08-16 17:40   ` Stefan Wachter
  2004-08-17 15:53   ` Hans Hagen
  2004-08-16 21:33 ` Hans Hagen
  1 sibling, 2 replies; 7+ messages in thread
From: Vit Zyka @ 2004-08-16 15:58 UTC (permalink / raw)




Stefan Wachter wrote:

> Hi all,
> 
> I use an overlay to implement a navigation bar in the left margin of a 
> document. It seems to me that the processing of the overlay is done only 
> once and not for every page again. In addition, the \lastpage is not 
> available.
> 
> Does anyone know a solution? Maybe headers/footers are a solution. But 
> how is absolute positioning accomplished with them?

Hi Stefan, header/footer is a solution but I use another

   \def\PageNavig{\setlayer[navbar][x=0cm,y=10cm]{\the\pageno}}

   \appendtoks
     \PageNavig
   \to \everypagebody

for this task.

Vit Zyka

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

* How to implement a changing navigation bar?
@ 2004-08-16 16:12 Stefan Wachter
  2004-08-16 15:58 ` Vit Zyka
  2004-08-16 21:33 ` Hans Hagen
  0 siblings, 2 replies; 7+ messages in thread
From: Stefan Wachter @ 2004-08-16 16:12 UTC (permalink / raw)


Hi all,

I use an overlay to implement a navigation bar in the left margin of a 
document. It seems to me that the processing of the overlay is done only 
once and not for every page again. In addition, the \lastpage is not 
available.

Does anyone know a solution? Maybe headers/footers are a solution. But 
how is absolute positioning accomplished with them?

Thanks for your attention,
--Stefan

PS: Here is my current implementation:

\definelayer[navbar]
\setupbackgrounds[text][leftmargin][background=navbar]
\setlayer[navbar][x=0cm,y=10cm]{\the\pageno}

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

* Re: How to implement a changing navigation bar?
  2004-08-16 15:58 ` Vit Zyka
@ 2004-08-16 17:40   ` Stefan Wachter
  2004-08-16 17:46     ` Vit Zyka
  2004-08-17 15:53   ` Hans Hagen
  1 sibling, 1 reply; 7+ messages in thread
From: Stefan Wachter @ 2004-08-16 17:40 UTC (permalink / raw)


Hi Vit,

thanks for the quick help. It works!

--Stefan

PS: Is there some documentation about \appendtoks around?

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

* Re: Re: How to implement a changing navigation bar?
  2004-08-16 17:40   ` Stefan Wachter
@ 2004-08-16 17:46     ` Vit Zyka
  0 siblings, 0 replies; 7+ messages in thread
From: Vit Zyka @ 2004-08-16 17:46 UTC (permalink / raw)


> --Stefan
> 
> PS: Is there some documentation about \appendtoks around?

Of course:

   grep -i "\appendtoks" tex/context/base/*.tex

;-)

\every* are defined/decribed(?) in core-var.tex

Vit

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

* Re: How to implement a changing navigation bar?
  2004-08-16 16:12 How to implement a changing navigation bar? Stefan Wachter
  2004-08-16 15:58 ` Vit Zyka
@ 2004-08-16 21:33 ` Hans Hagen
  2004-09-23  9:57   ` problem with goto - was: " Stefan Wachter
  1 sibling, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2004-08-16 21:33 UTC (permalink / raw)


Stefan Wachter wrote:

> Hi all,
>
> I use an overlay to implement a navigation bar in the left margin of a 
> document. It seems to me that the processing of the overlay is done 
> only once and not for every page again. In addition, the \lastpage is 
> not available.

page, paper and text backgrounda are calculated each page, unless you 
say \setupbackgrounds[state=repeat], in which case all are recalculated; 
if you put something in a layer it happens directly (but the layer may 
be flushed later)

> Does anyone know a solution? Maybe headers/footers are a solution. But 
> how is absolute positioning accomplished with them?
>
you can put a layer in the background of the header area and that do 
something:

\startsetups whatever

  \setlayer[thatlayer][....positioning...]{\the\pageno}

\stopsetups

\setupheadertexts[\setups{whatever}]

> PS: Here is my current implementation:
>
> \definelayer[navbar]
> \setupbackgrounds[text][leftmargin][background=navbar]
> \setlayer[navbar][x=0cm,y=10cm]{\the\pageno}

lastpage etc only make sense in the output routine (during page building) since one does not know where tex will break the page. 

H 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

* Re: How to implement a changing navigation bar?
  2004-08-16 15:58 ` Vit Zyka
  2004-08-16 17:40   ` Stefan Wachter
@ 2004-08-17 15:53   ` Hans Hagen
  1 sibling, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2004-08-17 15:53 UTC (permalink / raw)


Vit Zyka wrote:

>
>
> Stefan Wachter wrote:
>
>> Hi all,
>>
>> I use an overlay to implement a navigation bar in the left margin of 
>> a document. It seems to me that the processing of the overlay is done 
>> only once and not for every page again. In addition, the \lastpage is 
>> not available.
>>
>> Does anyone know a solution? Maybe headers/footers are a solution. 
>> But how is absolute positioning accomplished with them?
>
>
> Hi Stefan, header/footer is a solution but I use another
>
>   \def\PageNavig{\setlayer[navbar][x=0cm,y=10cm]{\the\pageno}}
>
>   \appendtoks
>     \PageNavig
>   \to \everypagebody
>
> for this task.

hm, dirty tricks -) 

beware of interference, also, be careful not to introduce funny spaces then. 

(sometimes \prependtoks is better) 


Hans 


-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

* problem with goto - was: How to implement a changing navigation bar?
  2004-08-16 21:33 ` Hans Hagen
@ 2004-09-23  9:57   ` Stefan Wachter
  0 siblings, 0 replies; 7+ messages in thread
From: Stefan Wachter @ 2004-09-23  9:57 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 3364 bytes --]

Hi Hans,

I implemented my changing navigation bar like you proposed, i.e. using a 
layer that is "refreshed" by the footer text:

\definelayer[navbar]
\setupbackgrounds[text][leftmargin][background=navbar]
\startsetups NavBar
... some quite complicated code setting up the navigation bar layer ...
\stopsetups

\setupfootertexts[\setups{NavBar}]

Everything works now, but I was not able to use the \goto makro inside 
the navigation layer setup code. It seems that the \goto makro somehow 
interferes with the output routine. Therefore I had to replace the \goto 
makro in the setup code with my self written \PrevOrNextPage makro. This 
makro writes a "raw" pdftex link. (Sometime ago you hinted me to replace 
my \PrevOrNextPage makro by the \goto makro.)

Using the \goto makro I get the following error message:

! Missing } inserted.
<inserted text>
                 }
<to be read again>
                    \endgroup
\dosingletexts ...atetexts {#1#2#5}{#6{}{}{}}}}}}}
                                                   \egroup
<argument> ...tk \v!voet \v!tekst \c!middentekst }
                                                   \hss }\hskip 
-\zetbreedte ...

\dododoplacelayouttextline ...#2 #3}\hbox to #1{#4
                                                   }\stoplayoutcomponent 
\get...

\dodoplacelayouttextline ... \c!kantlijntekst }}}}
                                                   \fi \ifdim 
\rechtermargebr...
...
l.211 ...t\crlf{} Die Landesregierung\blank[small]

Can you please have a look on the example? I attach a file that when it 
is texexecuted produces the above error. When you comment out line 150 
in the file and use line 148 instead, then the example works fine.

Thanks,
--Stefan


Hans Hagen wrote:
> Stefan Wachter wrote:
> 
>> Hi all,
>>
>> I use an overlay to implement a navigation bar in the left margin of a 
>> document. It seems to me that the processing of the overlay is done 
>> only once and not for every page again. In addition, the \lastpage is 
>> not available.
> 
> 
> page, paper and text backgrounda are calculated each page, unless you 
> say \setupbackgrounds[state=repeat], in which case all are recalculated; 
> if you put something in a layer it happens directly (but the layer may 
> be flushed later)
> 
>> Does anyone know a solution? Maybe headers/footers are a solution. But 
>> how is absolute positioning accomplished with them?
>>
> you can put a layer in the background of the header area and that do 
> something:
> 
> \startsetups whatever
> 
>  \setlayer[thatlayer][....positioning...]{\the\pageno}
> 
> \stopsetups
> 
> \setupheadertexts[\setups{whatever}]
> 
>> PS: Here is my current implementation:
>>
>> \definelayer[navbar]
>> \setupbackgrounds[text][leftmargin][background=navbar]
>> \setlayer[navbar][x=0cm,y=10cm]{\the\pageno}
> 
> 
> lastpage etc only make sense in the output routine (during page 
> building) since one does not know where tex will break the page.
> H
> -----------------------------------------------------------------
>                                          Hans Hagen | PRAGMA ADE
>              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
>                                             | www.pragma-pod.nl
> -----------------------------------------------------------------


[-- Attachment #2: inhalt.tex --]
[-- Type: application/x-tex, Size: 29282 bytes --]

[-- Attachment #3: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

end of thread, other threads:[~2004-09-23  9:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-16 16:12 How to implement a changing navigation bar? Stefan Wachter
2004-08-16 15:58 ` Vit Zyka
2004-08-16 17:40   ` Stefan Wachter
2004-08-16 17:46     ` Vit Zyka
2004-08-17 15:53   ` Hans Hagen
2004-08-16 21:33 ` Hans Hagen
2004-09-23  9:57   ` problem with goto - was: " Stefan Wachter

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