[tex-eplain] \href

Oleg Katsitadze olegkat at gmail.com
Thu Apr 13 20:49:04 CEST 2006


OK, the \href macro is now in CVS.  If anybody wants to test
it, you are more than welcome:

  http://tug.org/eplain/src/eplain.tex

(If you don't want to install it, just put it in the same
directory with your document, then `\include eplain' should
find it.)

The doc for \href is not ready yet, but its straightforward:

  \href{URL}{TEXT}

typesets TEXT as a link to URL.  Any # or ~ in URL do not
need to be escaped.  If URL starts with #, it is considered
a `local' link.  For example,

  \href{#label}{Link to label}

typesets `Link to label' as an internal link to anchor
`label'.

As it would be nice to be able to customize link options for
\href, I decided to create two new linkgroups -- one for
\href's with `internal' labels (those starting with #) and
another for `external' labels (not starting with #).  I
named them `hrefint' and `hrefext' respectively.  If someone
dislikes these names and has a better proposal, let's
discuss it.

To customize the links, do something like this:

  \hlopts[hrefext,hrefint]{bstyle=U}
  \hlopts[hrefext]{bcolor=.5 .2 .3,bwidth=2}

BTW, one consequence of this external/internal duality is
that it can be easily customized for something other than
URLs vs internal anchors.  For example, if a document has
many links to anchors within another local document, you can
set appropriate type and options for the `hrefext' group,
and all \href's with labels without the leading # will
create a link to the other file.

Best,
Oleg


More information about the tex-eplain mailing list