[tex-eplain] Hyperlinks in Eplain

geolsoft at mail.ru geolsoft at mail.ru
Fri Jul 1 12:26:41 CEST 2005


On Thu, Jun 30, 2005 at 05:09:38PM -0400, Karl Berry wrote:
>     The idea is to develop infrastructure for producing
>     hyperlinked documents.
> 
> It sounds great.  I'm sure Steve agrees :).

OK, I'll start with it.


> I've never heard of DJVU, what is it?

Check out

  http://djvulibre.djvuzone.org/

This format is really great, especially with scanned books
(files made of images rather than text/fonts).  With such
books, file sizes are ridiculously small compared to PDF and
rendering is several times faster.


> In any case, it is also possible to create active hyperlinks through
> dvipdfmx, I'm pretty sure.  Maybe even dvips|gs, less sure about that.
> But pdftex is the most important.

I've heard of that but never tried it myself.  I will keep
this in mind.  In any case, I want to make it simple to add
new drivers---just define several low-level macros which
produce \special's needed by the engine, and you're all set.


> Won't this also imply color support?  (Let's not use the same default
> colors as hyperref, though.  Yuck.)  Well, I guess ignoring that and
> just printing in black is useful.

Sure, I am thinking to add colors/various types of hyperlink
borders.  Although it will be hard to decide on the
defaults---what seems pretty to me may seem ugly to someone
else.  So I guess some discussion will be necessary, when
the code is ready.

Another thing comes to mind.  Maybe some ps/pdf
transformations (like rotating text) could also be of use?
It is true there are packages like pstriks, but I am not
sure there is a package for PDF, and maybe common interface
for simple tasks like rotating text could be made for
various engines like pdftex, dvipdfm, etc.


> Yeah.  I did bookmarks for Texinfo, borrowing a little code from
> hyperref, and it was a huge pain to handle special characters.

Here was a major problem for me.  Since I needed bookmarks
in Russian, I had to use Unicode strings.  I wrote a small
Python script (tools/tounicode.py) which did the
translation.  I doubt this will be possible/wise to do the
translation from within TeX.  Maybe a similar script (or
maybe even a C program) will have to be added to Eplain?


Another problem with the bookmarks is the way bookmark entry
levels are handled.  In TeX, it is natural to specify the
entry's level in the bookmarks, for example:

  1 entry
    2 subentry
      3 subsubentry
    2 subentry
  1 entry

I understand this is also the way dvipdfm accepts
the entries.

However, pdftex requires different scheme---each entry
should specify count of _immediate_ subentries this entry has.
For example:

  2 entry
    1 subentry
      0 subsubentry
    0 subentry
  0 entry

To make things even more complicated, in PDF each entry
specifies count of not only immediate subentries, but also
subentries of those entries, and so on.  For example:

  3 entry
    1 subentry
      0 subsubentry
    0 subentry
  0 entry

So it is possible that some engine uses this scheme.

For pdftex, I wrote another script, tools/compilebm.py,
which takes a file written out from TeX and containing text
and level for each of the entries, and constructs a sequence
of PDF bookmark entries according to pdftex's requirements.
Once again, I am not sure could/should this be done from
within TeX, avoiding external utility.  But if an external
processor will have to be written, it should be able to
produce either of the three schemes.

Any ideas how these problems could be handled best?


> Your book looks very nice, and indeed, lots of hyperlinks :).

Thank you.  Just to avoid misunderstanding---I didn't write
the book, I just typeset it :)


-- 
Best regards,
Oleg Katsitadze



More information about the tex-eplain mailing list