Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

trying to let tex know postscript coordinates

17 views
Skip to first unread message

me

unread,
Mar 25, 2012, 5:05:37 PM3/25/12
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.

Oliver Corff

unread,
Mar 28, 2012, 4:30:04 PM3/28/12
to
me <ecost...@gmail.com> wrote:
: Hi guys,
Have a look at TikZ - there are functions for inline (read: in-text)
graphics which you can use to link different words on the same page.
You can place anchors with words which are used for attaching links
from words elsewhere on the page - so the system has to be able to
find out about the coordinates of a given word.

Oliver.

--
Dr. Oliver Corff e-mail: co...@zedat.fu-berlin.de
0 new messages