[tex-eplain] Hyperlinks in Eplain

geolsoft at mail.ru geolsoft at mail.ru
Thu Jul 21 13:27:23 CEST 2005


On Wed, Jul 20, 2005 at 07:38:29PM -0400, Karl Berry wrote:
> The code should just adapt to whatever is being run.
> Like \usepackage{graphicx} -- if pdf output, pdftex is selected as the
> driver, if dvi output, dvips.  Am I misunderstanding?

[...]

> In fact, I think eplain.tex should include ifpdf.sty (it works in plain
> TeX).  I'll try to arrange for that, in some future day when I actually
> have 20 minutes to upload the Eplain sources.  And then your code should
> just use \ifpdf

Ok, then for now I guess this patch will do, and later it
can easily be switched to \ifpdf.

By the way, does anybody know why ifpdf.sty does the
checking this way:

  [...]
    \ifcase\pdfoutput
    \else
      \pdftrue
    \fi
  [...]

If \pdfoutput is negative this code will set \pdftrue, while
pdfTeX will output .dvi.  Shouldn't the check be like in my
patch:

  [...]
    \ifnum\pdfoutput<1
    \else
      \pdftrue
    \fi
  [...]

-- 
Best regards,
Oleg Katsitadze
-------------- next part --------------
--- eplain2.8.4.patched/xeplain.tex	2005-07-20 13:33:32.000000000 +0300
+++ eplain2.8.4/xeplain.tex	2005-07-21 13:56:08.000000000 +0300
@@ -3235,9 +3235,10 @@
   \expandafter\ifx\csname hldriver@#1\endcsname \relax
     \errmessage{No hyperlink driver `#1' available}%
   \fi
-  % Free memory taken up by unneeded drivers.
+  % Free memory taken up by unneeded drivers (don't free `nolink',
+  % some drivers may fall back on it).
   \edef\temp{#1}%
-  \for\@hldriver:=nolinks,pdftex,dvipdfm\do{%
+  \for\@hldriver:=pdftex,dvipdfm\do{%
     \ifx\@hldriver\temp \else
       \expandafter\let\csname hldriver@\@hldriver\endcsname\undefined
     \fi
@@ -3309,9 +3310,14 @@
   \def\hl at raw@word{raw}%
   % Check that pdftex is running.
   \ifx\pdfoutput\undefined
-    \message{\linenumber Warning: hyperlink driver `pdftex' requested
-                         but pdftex does not seem to be running.}%
-  \fi
+    \hldriver at nolinks
+  \else
+    \ifx\pdfoutput\relax
+      \hldriver at nolinks
+    \else
+      \ifnum\pdfoutput<1
+        \hldriver at nolinks
+      \else % \pdfoutput > 0 (whatch out for the identation).
   %
   % Hyperlink destinations.
   %
@@ -3465,6 +3471,10 @@
   }%
   %
   \let\@hlend\pdfendlink
+  % Close the \if's at the beginning of \hldriver at pdftex.
+      \fi % end of \pdfoutput ? 0
+    \fi   % end of \pdfoutput ? \relax
+  \fi     % end of \pdfoutput ? \undefined
 }%
 %
 % Driver `dvipdfm'.


More information about the tex-eplain mailing list