[XeTeX] url.sty and xelatex

Ross Moore ross at ics.mq.edu.au
Tue Feb 10 02:20:31 CET 2009


Hi Sven, Pete, and others.

On 10/02/2009, at 9:25 AM, Sven Willert wrote:

> Hi Pete,
>
> loading <url.sty> and <unicode-math.sty> leads to strange
> characters in the resulting pdf. Just loading <url.sty> works
> perfectly.

Here's an explanation of what happens, and why.

First check the .log file, where you should see something like:

Missing character: There is no character number "1D461 in font Latin  
Modern Mon
o 10 Regular/ICU!
Missing character: There is no character number "1D45D in font Latin  
Modern Mon
o 10 Regular/ICU!
Missing character: There is no character number "1D464 in font Latin  
Modern Mon
o 10 Regular/ICU!

Those character numbers are all up in the Unicode Plane-1
math-alphanumerics range.

To get the URls able to break at desirable places,  url.sty
sets the math-code to '8000; viz.

% You can do arbitrarily complex things with characters by making them
% active in math mode (mathcode hex-8000) and specifying the  
definition(s)
% in "\UrlSpecials".

Accordingly, the URLs are actually set in math-mode, rather than text,
so  unicode-math's settings now kick in, expecting to be setting
the URL using proper math-italic characters (i.e. in Plane-1).

But Latin Modern Mono doesn't have these characters.


If you have a math font, such as Code2001 or Cambria Math
or Asana Math,  then change the font for mono-spaced text:

   \setmonofont{Cambria Math}

-------------- next part --------------
A non-text attachment was scrubbed...
Name: texshop_image.jpeg
Type: image/jpeg
Size: 28162 bytes
Desc: not available
Url : http://tug.org/pipermail/xetex/attachments/20090210/fd0b21f9/attachment-0001.jpeg 
-------------- next part --------------


Now you should be able to see the URL, and it should
still work, as there's no translation from the ASCII range
for the hyperlink target, only for the visual appearance
of the anchor-text.


>
> Here is the example:
>
> \documentclass{scrreprt}
> \usepackage[]{fontspec}
> \usepackage[math-style=tex]{unicode-math}
> \usepackage{url}
>
> \begin{document}
> 	\url{http://www.nature.com/news/2009/090205/full/news.2009.79.html}
> \end{document}
>
> Have a nice day,
> Sven


Hope this helps,

	Ross


------------------------------------------------------------------------
Ross Moore                                       ross at maths.mq.edu.au
Mathematics Department                           office: E7A-419
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114
------------------------------------------------------------------------





More information about the XeTeX mailing list