[XeTeX] New installer (0.87c) posted

Bruno Voisin bvoisin at mac.com
Fri Sep 24 15:28:54 CEST 2004

Le 24 sept. 04, à 12:46, Jonathan Kew a écrit :

> Re the display of the links, I assume you must be using customizations 
> that my script doesn't know how to support. If you'd care to send me a 
> small example file that uses such options, I may be able to get more 
> things working eventually.

Looking at the file more carefully, it turns out I had been using the 
package color.sty incompetently: I had forgotten to specify the [xetex] 
option explicitly. Changing:




did the trick.

More exactly, I had recently modified 
/usr/local/teTeX/share/texmf.tetex/tex/latex/config/graphics.cfg, so 
that the use of XeTeX is detected automatically (by checking whether 
\XeTeXversion is defined) and [xetex] selected then automatically for 
graphics.sty; but I had forgotten to do the same modification for 
/usr/local/teTeX/share/texmf.tetex/tex/latex/config/color.cfg. For 
what's worth, here's the modified part (that I put in 
~/texmf/tex/xetex/config/graphics.cfg and 

% Select an appropriate default driver
   \chardef\x=0 %
   % check pdfTeX
       \chardef\x=1 %
   % check VTeX
     \chardef\x=2 %
   % check XeTeX
     \chardef\x=3 %
   % default case
   % pdfTeX is running in pdf mode
   % VTeX is running
   % XeTeX is running

As to the customizations, which however played no part in the problems, 
here are those related with hyperref. Things start pretty soft, then 
get increasingly hardcore:


\definecolor{ocean}   {rgb}{0.  ,0.25,0.50}
\definecolor{moss}    {rgb}{0.  ,0.50,0.25}
\definecolor{fern}    {rgb}{0.25,0.50,0.  }
\definecolor{teal}    {rgb}{0.  ,0.50,0.50}
\definecolor{bordeaux}{rgb}{0.50,0.  ,0.25}
\definecolor{clover}  {rgb}{0.  ,0.50,0.  }
\definecolor{mocha}   {rgb}{0.50,0.25,0.  }
\definecolor{mandarin}{rgb}{1.  ,0.25,0.  }
\definecolor{nickel}  {rgb}{0.50,0.50,0.50}
\definecolor{salmon}  {rgb}{1.  ,0.40,0.40}
\definecolor{orchid}  {rgb}{0.40,0.40,1.00}
\definecolor{lemon}   {rgb}{1.  ,1.  ,0.  }

\newcommand{\link}  [1]{\textcolor{bordeaux}{#1}}
\newcommand{\field} [1]{\textcolor{mocha}   {#1}}
\newcommand{\choice}[1]{\textcolor{nickel}  {#1}}


\renewcommand{\Url at do}{%
     \do\=\do\#}\def\UrlBigBreaks{\do\:\do at url@hyp}%
     \ {\ }}%
\renewcommand{\url@}[1]{\hyper at linkurl{\uline{\Hurl{#1}}}{#1}}
\renewcommand{\hyper at link@}[4][]
   {\protected at edef\Hy at tempa{#2}%
    \ifthenelse{\equal{\Hy at tempa}{\@empty}}
      {\hyper at link{#1}{#3}{\uline{#4}}}
      {\expandafter\hyper at readexternallink#2\\{#1}{#3}{\uline{#4}}}}
      {\csname l@#1\endcsname{#2}{#3}}
      {\ifthenelse{\boolean{Hy at linktocpage}}
         {\csname l@#1\endcsname
            {\hyper at linkstart{link}{#4}{\uline{#3}}\hyper at linkend}}
         {\csname l@#1\endcsname
            {\hyper at linkstart{link}{#4}{\uline{#2}}\hyper at linkend}

First the hyperref.sty and related url.sty packages are invoked, 
together with ulem.sty (for text underlining) and amsmath.sty (for use 
of text in math). A few colors are defined, taken out of Apple's 
watercolor color panel. Three command are defined for highlighting text 
based on color rather then character shape, then hyperlink color is 
redefined, and then the fun begins:

- \Url at do, from 
/usr/local/teTeX/share/texmf.tetex/tex/latex/misc/url.sty, is redefined 
so as to take the ~ from the text font rather than the default math 
construct from url.sty. This redefinition was done with Lucida fonts in 
mind, it would need modification for XeTeX and, say, MS Trebuchet.

- \url@, \hyper at link@ and \contentsline, all from 
/usr/local/teTeX/share/texmf.tetex/tex/latex/hyperref/hyperref.sty, are 
redefined to produce underlined hyperlinks both in the text and in the 
table of contents (by inserting \uline, defined in ulem.sty, at 
appropriate places).

As you can guess, a lot of trial-and-error had been involved in getting 
this to work originally!


More information about the XeTeX mailing list