[tex-eplain] Hyperlinks in Eplain

geolsoft at mail.ru geolsoft at mail.ru
Wed Jul 20 12:49:04 CEST 2005


On Wed, Jul 20, 2005 at 10:54:21AM +0200, Stepan Kasal wrote:
> Perhaps you should not only warn the user, but also fall back to
> \hldriver at nolinks.  (Of course this means you may not free the memory
> occupied by \hldriver at nolinks, but it doesn't matter.)
> 
> And than it would be important that with \pdfoutput=0 you'd also fall
> back to nolinks.

This patch seems to do this.  I am not sure whether that
check `\ifx\pdfoutput\relax' is really necessary --
\pdfoutput could be many bad things to break nice error
reporting, not just \relax.  Anyway, I just copied it as is
from what Hartmut suggested.  Won't hurt, I guess.

Thanks everyone.

-- 
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-20 13:29:12.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,24 @@
   \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
+    \message{\linenumber Warning: hyperlink driver `pdftex' requested but^^J
+             \space\space pdftex does not seem to be running; falling back^^J
+             \space\space to `nolinks' driver.^^J}%
+    \hldriver at nolinks
+  \else
+    \ifx\pdfoutput\relax
+      % What is this anyway?
+      \message{\linenumber Warning: hyperlink driver `pdftex' requested but^^J
+               \space\space \string\pdfoutput\space = \string\relax; falling
+                            back to `nolinks' driver.^^J}%
+      \hldriver at nolinks
+    \else
+      \ifnum\pdfoutput<1
+        \message{\linenumber Warning: hyperlink driver `pdftex' requested but^^J
+                 \space\space \string\pdfoutput\space <= 0; falling back to
+                             `nolinks' driver.^^J}%
+        \hldriver at nolinks
+      \else % \pdfoutput > 0 (whatch out for the identation).
   %
   % Hyperlink destinations.
   %
@@ -3465,6 +3481,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