Scrolling Within a Page to Show Linked-To Text

Clicking on a same-page link currently has no effect. And when traversing a link to another page, the top of the page is shown even if the link target is at the bottom.

Here are some thoughts on solving this problem:

  1. The class idvi.DVIOnePageApplet translates URLs of the form pageNN.dvi into URLs of the form pageNNscaleNN.html or index.html. The current version simply removes any #name portion. This will need to be preserved.

  2. The browser needs to be told where every named anchor in the dvi page is located. This could probably be handled by putting the applet inside of a table with two columns and many rows. The first column has width 0, and the second column is entirely taken up by the applet (spanning all rows).

    The first column contains tags at locations corresponding to html: specials in the dvi file. To get precise vertical spacing, you could use the single-pixel GIF trick.

  3. The class idvi.split.PageInfo will have to be extended to keep a list of anchor positions, instead of just keeping anchor names. (They are kept now in order to translate links of the form #name into links of the form pageNN.dvi#name).

  4. The table can be generated as a string, and added to the hashtable of computed parameters for the page. In idvi.split.HTMLParameters, change the default value of the $applet variable to use the table, and have the table refer to $realApplet. This avoids breaking any template.html files people have written which refer to $applet.