I want to redefine \' for a few characters (e.g., so that \'t maps to t’). I once did this with \DeclareTextComposite (I think), which requires me to specify the encoding (T1, OT1, etc.). What is the encoding if I'm using XeLaTeX with Brill fonts. (I've ruled out T1, OT1, and a few others by trial and error.)

More generally, does XeLaTeX provide better ways to go about this reassignment of accent commands? will this approach be flexible enough to map a two character input (like \'{ky}) to a multicharacter output (like kʸ’).


MWE shell:

% !TEX encoding = UTF-8 Unicode
\setmainfont{Brill Roman}
  • Shouldn't it be \v{t}? – egreg Jun 5 '20 at 13:35
  • \v behaves differently for t and p, c, k (it adds a hacek for the latter). – Daniel Harbour Jun 5 '20 at 14:00
  • (Also, even with \v{t}, I still need other accents to do other work. But let me know if there's something to \v that I'm missing.) – Daniel Harbour Jun 5 '20 at 14:01
  • It would be better if you specify what's precisely your aim. – egreg Jun 5 '20 at 14:18
  • Ulrike's answer below is enough for me to figure the rest out. Thanks for being willing, but I don't want to waste your time! – Daniel Harbour Jun 5 '20 at 15:05

The encoding is TU, but the last argument of \DeclareTextComposite is a number (for the glyph/char position), so you can't it to get some combination. For this you can use \DeclareTextCompositeCommand (I don't have your font so I faked something). It only works for single chars as input.

%\DeclareTextComposite{\'}{TU}{t}{65} % gives A

enter image description here

  • Works with the Brill font too. – Daniel Harbour Jun 5 '20 at 14:02

The command accepts Unicode arguments.

Very handy. Another way of mapping.


And the last argument can take arbitrary code.

Note that Brill font contains spacing modifier letters and combining diacritical marks, so kʸʼ can be entered directly.


\DeclareTextCompositeCommand{\'}{TU}{z}{\fmanat 𔐀𔐳𔑺𔓒}
\DeclareTextCompositeCommand{\'}{TU}{अ}{{\fmhiero 𓀀𓋖𓃨\textcolor{red}{𓇨}𓅽}}

\setmainfont{Brill Roman}
\newfontface\fmcyr{Noto Serif}
\newfontface\fmdev{Noto Sans Devanagari}
\newfontface\fmhiero{Noto Sans Egyptian Hieroglyphs}
\newfontface\fmjav{Noto Sans Javanese}
\newfontface\fmanat{Noto Sans Anatolian Hieroglyphs}
\newfontface\fmzh{Noto Serif SC}

\verb|\'t| & \verb|\'u| & \verb|\'x| & \verb|\'y| & \verb|\'Δ| & \verb|z| \\
\'t & \'u & \'x & \'y & \'Δ & z \\
    &  &  &  &  &  \\
\verb|\'|{\fmcyr ѭ} & \verb|\'|{\fmdev अ} & \verb|\'|{\fmjav ꦓ} & \tikz\node[circle,draw,fill=green!15,yshift=-1em](a){kʸʼ}; & \verb|\'v| &  \verb|\'z| \\
\'ѭ & \'अ & \'ꦓ & kʸʼ & {\fmzh\large \'v} & \'z \\

Not an answer, of course; just a kitten playing with string.

Fortunately, the question was asked. And answered. Much appreciated to both.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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