[tex-eplain] Hyperlinks in Eplain
geolsoft at mail.ru
geolsoft at mail.ru
Sun Jul 17 22:32:58 CEST 2005
Dear list members,
I send the patch against eplain 2.8.4 for two hypertext link drivers,
`pdftex' and `dvipdfm'. I compressed the patch because it is quite
big. Hyperlinks are provided with all eplain's cross-reference
macros, namely:
\li
\xrdef
\definxref
* \xrefn / \refn
* \xref
* \ref
\refs
\eqdefn
\eqdef
\eqsubdefn
\eqsubdef
* \eqrefn
* \eqref
To the macros marked with `*' I added support for an optional argument
which becomes part of the hyperlink, as I discussed in one of my
previous posts.
Supported hyperlink types include:
links to named destinations (in current file and in another file);
links to pages (in current file and in another file);
URL links.
Hyperlink support is not yet provided for index and citations. Color
is not yet supported.
I also attach three test files I used which demonstrate the features
of the hyperlinks. The files `pdftex.tex' and `dvipdfm.tex'
demonstrate drivers with the same names; `hlink.tex' demonstrates
hyperlink support in the cross-reference macros. You can find the
commands I used to compile the files at the bottom of the files (the
lines starting with `% compile-command: '; for `hlink.tex' there are
two compile commands, one for `dvipdfm' driver and another for
`pdftex' driver). The first two files link to `hlink.pdf',
so it will be best if you compile them all before trying them out.
A few comments:
1) Older viewers may not support all the options used in the test
files, so try latest xpdf / Acrobat Reader.
2) Options supported by each of the drivers are documented
in the big comment in one of `dvipdfm.tex' and
`pdftex.tex' test files.
3) There is one more pseudo-driver `nolinks'. Read the comment to
this driver in `xeplain.tex' for motivation for this driver.
4) Note that currently all code which sets up each driver is stored
in a macro when eplain.tex is \input'd. If user selects one of
the drivers the memory used for the other drivers is freed by
setting the macros which define them to \undefined. However if
user never selects any driver all the code is just sitting there
hogging the memory. Below I provide statistics dumped by pdfTeX
with \tracingstats=1 for various inputs:
a) file which \input's original eplain 2.8.4:
Here is how much of TeX's memory you used:
737 strings out of 97594
9217 string characters out of 1216302
19284 words of memory out of 1000001
1720 multiletter control sequences out of 10000+50000
15043 words of font info for 53 fonts, out of 500000 for 1000
14 hyphenation exceptions out of 1000
9i,0n,17p,277b,521s stack positions out of 1500i,500n,5000p,200000b,5000s
0 PDF objects out of 300000
0 named destinations out of 131072
0 words of extra memory for PDF output out of 65536
b) file which \input's the patched eplain 2.8.4 and does not
select any driver:
Here is how much of TeX's memory you used:
872 strings out of 97594
10779 string characters out of 1216302
21368 words of memory out of 1000001
1855 multiletter control sequences out of 10000+50000
15043 words of font info for 53 fonts, out of 500000 for 1000
14 hyphenation exceptions out of 1000
9i,0n,17p,293b,521s stack positions out of 1500i,500n,5000p,200000b,5000s
0 PDF objects out of 300000
0 named destinations out of 131072
0 words of extra memory for PDF output out of 65536
c) file which \input's the patched eplain 2.8.4 and then selects
driver `pdftex':
Here is how much of TeX's memory you used:
872 strings out of 97594
10779 string characters out of 1216302
21461 words of memory out of 1000001
1855 multiletter control sequences out of 10000+50000
15043 words of font info for 53 fonts, out of 500000 for 1000
14 hyphenation exceptions out of 1000
9i,0n,17p,293b,521s stack positions out of 1500i,500n,5000p,200000b,5000s
0 PDF objects out of 300000
0 named destinations out of 131072
0 words of extra memory for PDF output out of 65536
d) file which \input's the patched eplain 2.8.4 with code that
frees memory commented out, and then selects driver `pdftex':
Here is how much of TeX's memory you used:
871 strings out of 97594
10770 string characters out of 1216302
21888 words of memory out of 1000001
1854 multiletter control sequences out of 10000+50000
15043 words of font info for 53 fonts, out of 500000 for 1000
14 hyphenation exceptions out of 1000
9i,0n,17p,293b,521s stack positions out of 1500i,500n,5000p,200000b,5000s
0 PDF objects out of 300000
0 named destinations out of 131072
0 words of extra memory for PDF output out of 65536
When new drivers will be added the memory consumption will only
grow. The only thing I can think of to avoid this is to place
each driver in a separate file and have \hldriver{...} input one
of the files depending on the requested driver. This way, of
course, when user makes a format file using eplain, the code for
the drivers will not be precompiled and just read from a .tex
file by \hldriver{...}. Should I do it this way? Any suggestions?
I will appreciate any comments or suggestions. Thank you for taking
so much trouble.
--
Best regards,
Oleg Katsitadze
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.gz
Type: application/octet-stream
Size: 8527 bytes
Desc: not available
Url : http://tug.org/pipermail/tex-eplain/attachments/20050717/2b27554a/patch.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pdftex.tex
Type: text/x-tex
Size: 7023 bytes
Desc: not available
Url : http://tug.org/pipermail/tex-eplain/attachments/20050717/2b27554a/pdftex.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dvipdfm.tex
Type: text/x-tex
Size: 7674 bytes
Desc: not available
Url : http://tug.org/pipermail/tex-eplain/attachments/20050717/2b27554a/dvipdfm.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hlink.tex
Type: text/x-tex
Size: 3883 bytes
Desc: not available
Url : http://tug.org/pipermail/tex-eplain/attachments/20050717/2b27554a/hlink.bin
More information about the tex-eplain
mailing list