Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
Wa\quad Wä\quad „W“
\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)?

share|improve this question
    
@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
add comment

2 Answers

up vote 6 down vote accepted

In the same way:

\XeTeXcharclass `ä \mycharclassae

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

share|improve this answer
    
That works fine. Thanks! ps. what’s the difference between using W and \W after the ` –  Tobi May 6 '11 at 16:12
add comment
\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).

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.