[XeTeX] Use of Unicode fonts in LaTeX
Bruno Voisin
bvoisin at mac.com
Thu Feb 17 10:33:55 CET 2005
Is anybody here aware of a standard way (hopefully an already existing
package) for redefining some LaTeX internal commands such that they
will make optimal use of all the character set in a Unicode font?
More specifically: if you try to insert some non-alphabetic characters
in LaTeX, by default LaTeX will often take these characters from
Computer Modern instead of using the Unicode font specified (in XeTeX)
by the user as the text font (like Lucida grande). For example, if you
try to write \textasciitilde for inserting a tilde in a URL, the
default LaTeX definition is used, namely:
\DeclareTextAccentDefault{\~}{OT1} (from latex.ltx)
\DeclareTextAccent{\~}{OT1}{126} (from ot1enc.def)
\DeclareTextCommandDefault{\textasciitilde}{\~{}} (from latex.ltx)
and you end up with the tilde being the corresponding tilde accent from
Computer Modern, and hence above the surrounding alphabetic characters,
like:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Image 1.pdf
Type: application/pdf
Size: 8622 bytes
Desc: not available
Url : http://tug.org/pipermail/xetex/attachments/20050217/b5ea7945/Image1.pdf
-------------- next part --------------
If however you take care of redefining \textasciitilde to use the
corresponding Unicode character slot, by writing:
\DeclareTextSymbol{\textasciitilde}{U}{"007E}
then the output looks noticeably better:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Image 2.pdf
Type: application/pdf
Size: 8517 bytes
Desc: not available
Url : http://tug.org/pipermail/xetex/attachments/20050217/b5ea7945/Image2.pdf
-------------- next part --------------
The same kind of thing would occur for many characters, like
\textasciicircum, \textcopyright, etc.
Does it need to be done manually in each case, as above, or are there
existing packages that already do this?
Bruno Voisin
More information about the XeTeX
mailing list