[XeTeX] Use of Unicode fonts in LaTeX

Ross Moore ross at ics.mq.edu.au
Thu Feb 17 13:24:17 CET 2005


Hi Bruno,

On 17/02/2005, at 8:33 PM, Bruno Voisin wrote:

> 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?


> If however you take care of redefining \textasciitilde to use the 
> corresponding Unicode character slot, by writing:
>
> 	\DeclareTextSymbol{\textasciitilde}{U}{"007E}

> 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?


utf8accents.sty  already does this; viz.

[GlenLivet:~/Documents/TeX_Documents] rossmoor% grep textascii 
test/utf8accents.sty
%\DeclareUTFcharacter[\UTFencname]{x005E}{\textasciicircum}% see x02C6
%\DeclareUTFcharacter[\UTFencname]{x0060}{\textasciigrave}% see x02CB
%\DeclareUTFcharacter[\UTFencname]{x007E}{\textasciitilde}% see x02DC
\DeclareUTFcharacter[\UTFencname]{x00A8}{\textasciidieresis}
%\DeclareUTFcharacter[\UTFencname]{x00AF}{\textasciimacron}% see x02C9
%\DeclareUTFcharacter[\UTFencname]{x00B4}{\textasciiacute}% see x02CA
%\DeclareUTFcharacter[\UTFencname]{x00B8}{\textasciicedilla}% see x02DB
\DeclareUTFcharacter[\UTFencname]{x02C6}{\textasciicircum}
\DeclareUTFcharacter[\UTFencname]{x02C7}{\textasciicaron}
\DeclareUTFcharacter[\UTFencname]{x02C9}{\textasciimacron}
\DeclareUTFcharacter[\UTFencname]{x02CA}{\textasciiacute}
\DeclareUTFcharacter[\UTFencname]{x02CB}{\textasciigrave}
\DeclareUTFcharacter[\UTFencname]{x02D8}{\textasciibreve}
\DeclareUTFcharacter[\UTFencname]{x02DB}{\textasciicedilla}
\DeclareUTFcharacter[\UTFencname]{x02DC}{\textasciitilde}
%\DeclareUTFcharacter[\UTFencname]{x????}{\textasciidieresis}% see x00A8


So you should get the right characters automatically.
However, if you have loaded  textcomp.sty  *after* utf8accents,
then this may shadow the above declarations.
(Best is to not load the textcomp  package.
With  utf8accents  you shouldn't need it.
Similarly do not load other packages, such as  inputenc .)

However...

  ... the Ux02DC code-point for  \textasciitilde  may be wrong.
It's correct for the tilde-accent character, but you seem to
want a non-accent tilde.

You can get this with:

\DeclareUTFcharacter[\UTFencname]{x007E}{\textasciitilde}% see x02DC

Similarly for the other characters:
   ...circum  ...grave  ...acute  ...macron  ...cedilla


Should the  \textascii...  macros for these be in the  Ux00..  range ?
Or should they be the accent characters in the  Ux02..  range ?


Cheers,

	Ross


>
> Bruno Voisin_______________________________________________
> XeTeX mailing list
> postmaster at tug.org
> http://tug.org/mailman/listinfo/xetex
>
------------------------------------------------------------------------
Ross Moore                                         ross at maths.mq.edu.au
Mathematics Department                             office: E7A-419
Macquarie University                               tel: +61 +2 9850 8955
Sydney, Australia                                  fax: +61 +2 9850 8114
------------------------------------------------------------------------



More information about the XeTeX mailing list