[tex-eplain] Colors with hyperlinks

geolsoft at mail.ru geolsoft at mail.ru
Mon Aug 22 20:32:34 CEST 2005


OK, here is the patch (it is against the current CVS at
sarovar.org), together with a test file.

It also covers the \makeatletter, \makeatother and
\resetatcatcode.  What I did was to have \makeat... define
\resetatcatcode to restore the @ catcode.  Is this right?

If it's OK, I will commit the changes.

-- 
Best regards,
Oleg Katsitadze
-------------- next part --------------
Index: xeplain.tex
===================================================================
RCS file: /cvsroot/eplain/eplain/xeplain.tex,v
retrieving revision 1.9
diff -u -p -r1.9 xeplain.tex
--- xeplain.tex	21 Aug 2005 12:43:43 -0000	1.9
+++ xeplain.tex	22 Aug 2005 18:22:25 -0000
@@ -56,6 +56,15 @@
 \def\makeactive#1{\catcode`#1 = \active \ignorespaces}%
 \chardef\letter = 11
 \chardef\other = 12
+% The following two macros were adopted from miniltx.tex of graphics.
+\def\makeatletter{%
+  \edef\resetatcatcode{\catcode`\noexpand\@\the\catcode`\@\relax}%
+  \catcode`\@11\relax
+}%
+\def\makeatother{%
+  \edef\resetatcatcode{\catcode`\noexpand\@\the\catcode`\@\relax}%
+  \catcode`\@12\relax
+}%
 % 
 % 
 % So we can have user-inaccessible control sequences.
@@ -3995,6 +4004,49 @@
     \xdef\hl at eqlabel{\phantomeqlabel}%
   \else
     \gdef\hl at eqlabel{#1}%
+  \fi
+}%
+%
+%
+%
+%  Color support.
+%
+% We use the color package of the graphics bundle (see
+% http://www.ctan.org/tex-archive/macros/latex/required/graphics/
+% and
+% http://www.ctan.org/tex-archive/macros/plain/graphics/).
+\def\enablecolors{\@getoptionalarg\@finenablecolors}%
+\def\@finenablecolors{%
+  % Save \@optionalarg.
+  \let\@enablecolorsoptarg\@optionalarg
+  % Make sure both miniltx.tex and color.sty are available.
+  \testfileexistence[miniltx]{tex}%
+  \iffileexists \else
+    \errmessage{miniltx.tex not found, cannot load color drivers}%
+  \fi
+  \testfileexistence[color]{sty}%
+  \iffileexists \else
+    \errmessage{color.sty not found, cannot load color drivers}%
+  \fi
+  % color.sty does not check for multiple \input's, so we check ourselves.
+  \ifx\definecolor\undefined
+    \let\Gin at driver\@enablecolorsoptarg
+    \ifx\Gin at driver\empty
+      % The user did not specify a driver, detect.
+      \ifpdf
+        \def\Gin at driver{pdftex.def}%
+      \else
+        \def\Gin at driver{dvips.def}%
+      \fi
+    \fi
+    % Load miniltx.tex.  It does the checking for multiple \input's internally.
+    \input miniltx.tex
+    % Load color.sty
+    \input color.sty
+    % The driver should not be changed later.
+    \def\@finenablecolor{\errmessage{Color driver `\Gin at driver' already selected}}%
+  \else
+    \message{^^J\linenumber color.sty already loaded, refusing to reload it}%
   \fi
 }%
 %
-------------- next part --------------
A non-text attachment was scrubbed...
Name: color.tex
Type: text/x-tex
Size: 2124 bytes
Desc: not available
Url : http://tug.org/pipermail/tex-eplain/attachments/20050822/4b7c40c1/color.bin


More information about the tex-eplain mailing list