TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to define


as commands like this one would sometimes be easier to use.

share|improve this question
Which engine do you use? This is awkward in pdfTeX, but easy enough with a UTF-8 engine. – Joseph Wright Sep 10 '11 at 14:21
i guess you mean something like luatex with a utf-8 engine, i'm using pdflatex. – epsilonhalbe Sep 10 '11 at 15:06
up vote 16 down vote accepted

If there were no argument to the macro, this would be just a matter of loading the newunicodechar package or using the \DeclareUnicodeCharacter macro. For the "character" to accept arguments, a slightly different approach is needed.

If you use XeTeX or LuaTeX, you can use either of




(The second approach is more robust.)

With pdfTeX the \√ syntax will not work because of the way pdfTeX handles input (it is theoretically possible to achieve this, though). This leaves the only way (taken and modified from newunicodechar documentation):



\expandafter\newcommand\csname u8:\detokenize{√}\endcsname[1]{%



share|improve this answer
thanks - curiously with luatex characters like '⟨','⟩' don't work well but otherwise - it is great. Definitely something i should have a look at. till now i've worked with pdflatex – epsilonhalbe Sep 10 '11 at 15:04
@epsilonhalbe: \newunicodechar{⟨}{\langle} \newunicodechar{⟩}{\rangle} works for me in LuaTeX and TeX Live 2011. – Andrey Vihrov Sep 10 '11 at 15:13
ah thanks - most definitely should look at LuaTeX - should i watch something when migrating from pdfTeX, are there any complications/breaking points - looking through 20 pages for errors would be gruesome. – epsilonhalbe Sep 10 '11 at 15:28
@epsilonhalbe: See these questions: one two three – Andrey Vihrov Sep 10 '11 at 16:08
the move to LuaLaTeX was the best thing TeXrelated I did in the last few months - thanks again. – epsilonhalbe Dec 21 '11 at 0:56

Your Answer


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.