# Charclass/Interchartokes for Umlauts and „“

How can I define a charclass for umlauts, german quotes „“ (and other special characters which are not A–Z/a–z)?
I’d like to use this for extra kerning in some cases.

\documentclass{minimal}
\XeTeXinterchartokenstate=1

% char class for W
\newXeTeXintercharclass \mycharclassW
\XeTeXcharclass \W \mycharclassW
% char class for german ä (a umlaut)
\newXeTeXintercharclass \mycharclassae
\XeTeXcharclass a \mycharclassae
% char class for german opening quote „
\newXeTeXintercharclass \mycharclassOQ
% charclass for german closing quote “
\newXeTeXintercharclass \mycharclassCQ

% def interchartokes
\XeTeXinterchartoks \mycharclassW \mycharclassae = {\kern0.5pt}

\begin{document}
\end{document}


How can I add more than one char to a new class, e.g., making C, O, U and Q available in one class (\mycharclassCOQU)?

-
@xport: I'd keep XeTeX in the title. –  egreg May 28 '11 at 8:51
@egreg: I think it is unnecessary because we already have tag system. –  xport May 28 '11 at 9:15
@xport: Thanks for correcting :-). I thought it would be better to have “XeTeX” in title, cause it is more visible than a tag. but you’re right it is redundant so I’d agree with you, removing it from title … –  Tobi May 28 '11 at 9:59
several months ago, other users also edited my title when I put unnecessary words as you did above. –  xport May 28 '11 at 12:23

In the same way:

\XeTeXcharclass ä \mycharclassae


You should naturally load fontspec so that the char is printed. And the file should be in utf8.

-
That works fine. Thanks! ps. what’s the difference between using W and \W after the  –  Tobi May 6 '11 at 16:12
\newXeTeXintercharclass \mycharclassCOQU
\XeTeXcharclass \C \mycharclassCOQU
\XeTeXcharclass \O \mycharclassCOQU
\XeTeXcharclass \Q \mycharclassCOQU
\XeTeXcharclass \U \mycharclassCOQU


You can assign as many characters as you want to any class; however, a character may belong to only one class (the last specification wins).

-
Thank you! (Unfortunately it isn’t possible to vote two answers as “accepted“ so I voted Ulrike’s answer because it is the one which answers the question in the title.But I voted both as “useful”) –  Tobi May 6 '11 at 16:07