ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Absolute positioning
@ 2003-12-01 17:19 Gilles Pérez-Lambert
  2003-12-01 17:39 ` Martin Moncrieffe
  2003-12-02 16:27 ` Hans Hagen
  0 siblings, 2 replies; 3+ messages in thread
From: Gilles Pérez-Lambert @ 2003-12-01 17:19 UTC (permalink / raw)


Hello,

I didn't find a way to put text at specific locations on the page. It 
must be something obvious! :-)

I try to design a screen document where every notes are, say, typeset 
on the lower half of the page and appear only when clicking on their 
number in the text (with layers I think).

Thnaks in advance,

Gilles.

PS for Hans: I didn't forget the note problem we've discussed in Mâcon. 
I'll build a test file.

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

* Re: Absolute positioning
  2003-12-01 17:19 Absolute positioning Gilles Pérez-Lambert
@ 2003-12-01 17:39 ` Martin Moncrieffe
  2003-12-02 16:27 ` Hans Hagen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin Moncrieffe @ 2003-12-01 17:39 UTC (permalink / raw)


Hi Francesca,

I'll be looking at your data tonight. Will send an email tomorrow.

__martin
On 1 Dec 2003, at 17:19, Gilles Pérez-Lambert wrote:

> Hello,
>
> I didn't find a way to put text at specific locations on the page. It
> must be something obvious! :-)
>
> I try to design a screen document where every notes are, say, typeset
> on the lower half of the page and appear only when clicking on their
> number in the text (with layers I think).
>
> Thnaks in advance,

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

* Re: Absolute positioning
  2003-12-01 17:19 Absolute positioning Gilles Pérez-Lambert
  2003-12-01 17:39 ` Martin Moncrieffe
@ 2003-12-02 16:27 ` Hans Hagen
  1 sibling, 0 replies; 3+ messages in thread
From: Hans Hagen @ 2003-12-02 16:27 UTC (permalink / raw)


At 18:19 01/12/2003, you wrote:
>Hello,
>
>I didn't find a way to put text at specific locations on the page. It
>must be something obvious! :-)
>
>I try to design a screen document where every notes are, say, typeset
>on the lower half of the page and appear only when clicking on their
>number in the text (with layers I think).
>
>Thnaks in advance,
>
>Gilles.
>
>PS for Hans: I didn't forget the note problem we've discussed in Mâcon.
>I'll build a test file.

% interface=en

\setuppapersize[S6][S6]

\startJSpreamble {Notes} used now

   var lastNote = "" ;

   function Show_Note ( Name )
     { if (Name != lastNote)
         { Hide_Note () ;
           var v = this.getField(Name) ; if (v)
             { console.println("Show Note: " + Name) ;
               v.display = display.visible ;
               v.readonly = false ;
               this.dirty = false ;
               lastNote = Name } } }

   function Hide_Note ( )
     { if (lastNote != "")
         { var v = this.getField(lastNote) ; if (v)
             { console.println("Hide Note: " + lastNote) ;
               v.display = display.hidden ;
               v.readonly = true ;
               this.dirty = false } }
           lastNote = "" }

\stopJSpreamble

\newcounter\AnotherNote

\def\SomeNote#1#2%
   {\hbox
      {\doglobal\increment\AnotherNote
       \definesymbol[note:\AnotherNote:on][\WhatANote{#2}]%
       \setupfield[notes][offset=overlay,frame=off,option={readonly,hidden}]
     % this confuses acrobat, probably some interference bug, I spent too 
much time on that
     % 
\setupfield[notes][offset=overlay,frame=off,option={readonly,hidden},clickin=JS(Hide_Note)]
       \definefield[note:\AnotherNote][check][notes][note:\AnotherNote:on][note:\AnotherNote:on]%
       \doifreferencefoundelse{note:\AnotherNote}
         {\setlayer[notes][page=\currentrealreference]{\fitfield[note:\AnotherNote]}}
         {\setlayer[notes]{\fitfield[note:\AnotherNote]}}%
       \pagereference[note:\AnotherNote]\goto{#1}[JS(Show_Note{note:\AnotherNote})]}}

\setupinteraction
   [state=start,
    openpageaction=JS(Hide_Note),
    closepageaction=JS(Hide_Note)]

\definereference[CloseNote][JS(Hide_Note)]

\setupfootertexts[{\goto{Close Note}[CloseNote]}][]

\setupcolors
   [state=start]

\definecolor
   [notebackgroundcolor]
   [s=.85]

\defineframedtext
   [WhatANote]
   [background=color,
    backgroundcolor=notebackgroundcolor,
    width=.4\textwidth,
    height=fit,
    align=normal]

\definelayer
   [notes]
   [width=\paperwidth,
    height=\paperheight,
    preset=rightbottom,
    offset=1cm]

\setupbackgrounds
   [page]
   [background=notes]

\starttext

\startbuffer
\input ward   \SomeNote{[[ward]]}  {\input ward  \relax} \input ward   \blank
\input knuth  \SomeNote{[[knuth]]} {\input knuth \relax} \input knuth  \blank
\input tufte  \SomeNote{[[tufte]]} {\input tufte \relax} \input tufte  \blank
\input bryson \SomeNote{[[bryson]]}{\input bryson\relax} \input bryson \blank
\stopbuffer

\dorecurse{10}{\getbuffer}

\stoptext 

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

end of thread, other threads:[~2003-12-02 16:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-01 17:19 Absolute positioning Gilles Pérez-Lambert
2003-12-01 17:39 ` Martin Moncrieffe
2003-12-02 16:27 ` Hans Hagen

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