me
unread,Mar 25, 2012, 5:05:37 PM3/25/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hi guys,
Is it possible at all to let tex know coordinates of a word in the
document?
It seems I need to add some custom graphics right after certain words
on a document, that can be linked with a pdfmark with the `/View'
attribute set accordingly, so when the user clicks on a link, such
word is seen at the top of the reader's screen.
This is much like what happens when a link on an html page takes you
to a different part of the same page.
I'm using dvips, and ghostscript for the final version of it, as I've
always done.
All I could find on the internet is a post in this very ng, where
someone asked something similar. The one which answered, though,
didn't give the bloke any example or explanation whatsoever.
So my initial though was finding out such position, write it to a
file, and then read it back in from tex on a second pass.
Right now I'm placing this after the "offending" word:
\special{ps:
/ypos 12 string def
/xpos 12 string def
currentpoint
10 ypos cvrs pop
10 xpos cvrs pop
ypos print
(\bl n) print
xpos print
(\bl n) print
}
Which basically gathers `currentpoint', converts it to a string, and
prints it to stdout.
I get, though, big numbers like 3866 and 5067, and a paragraph later
to this one, like -351 for X.
While I'm a little concerned about difference in tex and postscript
coordinate systems, I believe there's a bit more going on (such like
dvips doing scaling, or munging the coordinate system for it's own
benefit, etc)
Perhaps this might not even be possible wth other than pdftex or some
other, or people would do it, yet I couldn't see hyperref dealing with
the "/View" attribute at all for the time I skimmed through it's
source.
So, was just wondering if somebody can give me some clues, ideas,
comments?
Thanks.