[tex-eplain] Hyperlinks in Eplain

Daniel H. Luecking luecking at uark.edu
Thu Jul 21 22:26:35 CEST 2005


On Thu, 21 Jul 2005 geolsoft at mail.ru wrote:

> On Thu, Jul 21, 2005 at 12:33:40PM -0400, Karl Berry wrote:
>
> >     Imagine we do fall back on dvipdfm driver but instead of using
> >     dvipdfm, user will use some other .dvi converter which also issues
> >     warnings on unknown specials.  Won't it be annoying to have these
> >     warnings?
> >
> > I don't think so; instead, it will be informative, telling the user that
> > they should specify a different driver, since our guessed default was wrong.
> >
> > For this reason, I think nolinks is useful.  If a user has to use some
> > unsupported-by-us driver xyz which generates the warnings, it would
> > provide a way to turn the warnings off.
>
> Still this whole affair seems confusing to me.  The user
> _requests_ pdftex but we do not find it running, and on
> these grounds we fall back to _another_ driver dvipdfm
> (which could have been requested specifically if the user
> wanted it in the first place).  IMHO this is a little bit
> intrusive.  To me there seem to be only two logical options:
>
>  1) warn the user and do nothing, hoping the user knows
>     better, which he/she/it usually does not :) ;
>
>  2) [warn the user and] fall back to nolinks since we are
>     not sure that the links can be produced in the state we
>     are in (and let the user convince us to the contrary).

Some years ago a hyper-TeX standard was developed. Hyperref falls back
to that (except that a hyperref.cfg -- similar to graphics.cfg -- is
usually provided, and it ofter sets dvips as fallback). Some dvi
programs (including screen viewers) understand many of the hypertex
specials.

Even that is at best a weak solution (possibly worse than the two
above), but I can't think of anything more to suggest.

My personal choice would be the first one, then the second, but fall
back to dvips instead.


With regard to testing for pdftex: the test \ifx\pdfoutput\relax is used
because many packages in LaTeX (some of which also can be used in plain)
use \expandafter\ifx\csname xxx\endcsname\relax to test for the
existence of \xxx. But, by a quirk of TeX, using this on an undefined
\xxx causes it to become defined to be \relax.

It is impossible to test for an arbitray definition of \pdfoutput, since
it could, in principle, be \let equal to anything. One can test if it is
a macro that expands to something:
 \expandafter\def\expandafter\tempa\expandafter{\pdfoutput}
 \def\tempb{\pdfoutput}
 \ifx\tempa\tempb
   % either pdfoutput is unexpandable
   % (or expands to \pdfoutput!)
 \else
   % \pdfoutput is expandable
 \fi
Unfortunately, this test generates an error if \pdfoutput has been
\let to something like \the or \if.

Another quirk of TeX provides a test that won't raise an error:
  \expandafter\ifx\noexpand\pdfoutput\pdfoutput
    % \pdfoutput is a defined but nonexpandable command
    % (though it could be something other than the
    % original pdftex primitive).
  \else
    % \pdfoutput is either undefined or defined and expandable
  \fi


Dan

-- 
Dan Luecking
Dept. of Mathematical Sciences
University of Arkansas
Fayetteville, AR 72101



More information about the tex-eplain mailing list