[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:

	\usepackage{color}

to:

	\usepackage[xetex]{color}

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 
~/texmf/tex/xetex/config/color.cfg):

% Select an appropriate default driver
\begingroup
   \chardef\x=0 %
   % check pdfTeX
   \@ifundefined{pdfoutput}{}{%
     \ifcase\pdfoutput
     \else
       \chardef\x=1 %
     \fi
   }%
   % check VTeX
   \@ifundefined{OpMode}{}{%
     \chardef\x=2 %
   }%
   % check XeTeX
   \@ifundefined{XeTeXversion}{}{%
     \chardef\x=3 %
   }%
\expandafter\endgroup
\ifcase\x
   % default case
   \ExecuteOptions{dvips}%
\or
   % pdfTeX is running in pdf mode
   \ExecuteOptions{pdftex}%
\or
   % VTeX is running
   \ExecuteOptions{vtex}%
\else
   % XeTeX is running
   \ExecuteOptions{xetex}%
\fi

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:

\usepackage[normalem]{ulem}
\usepackage{amstext}
\usepackage{url}
\usepackage[colorlinks=true,
             raiselinks=true,
             bookmarks=true,
             pdfstartview=FitH,
             dvipdfm]{hyperref}

\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}}

\hypersetup{urlcolor=ocean,
             linkcolor=moss}

\makeatletter
\renewcommand{\Url at do}{%
   
\def\UrlBreaks{\do\.\do\@\do\/\do\!\do\%\do\;\do\]\do\)\do\,\do\?\do\+%
     \do\=\do\#}\def\UrlBigBreaks{\do\:\do at url@hyp}%
   \def\UrlNoBreaks{\do\(\do\[\do\{}%
   \def\UrlSpecials{\do\<{\langle}\do\>{\mathbin{\rangle}}\do\_{\_%
     \penalty\@m}\do\|{\mid}\do\{{\lbrace}\do\}{\mathbin{\rbrace}}\do
     \\{\mathbin{\backslash}}\do\~{\text{\textasciitilde}}\do
     \ {\ }}%
   \def\UrlOrds{\do\'\do\"\do\-}}
\urlstyle{same}
\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}}}}
\renewcommand{\contentsline}[4]
   {\ifthenelse{\equal{\\#4}{\\}}
      {\csname l@#1\endcsname{#2}{#3}}
      {\ifthenelse{\boolean{Hy at linktocpage}}
         {\csname l@#1\endcsname
            {{#2}}
            {\hyper at linkstart{link}{#4}{\uline{#3}}\hyper at linkend}}
         {\csname l@#1\endcsname
            {\hyper at linkstart{link}{#4}{\uline{#2}}\hyper at linkend}
            {#3}}}}
\makeatother

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!

Bruno



More information about the XeTeX mailing list