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

I want to insert formatting text with a single command (I know the text beforehand):


How do I "bind" it to a macro? I tried:

 \def\sol#0 {{\addfontfeature{LetterSpace=20.0}Решение}}
 \let\sol {{\addfontfeature{LetterSpace=20.0}Решение}}

Both give errors. I'm sure I'm missing something trivial.

share|improve this question
up vote 5 down vote accepted

Don't use \def for these kinds of things, just use \newcommand when using LaTeX:


\def and \let are pure TeX commands, it is recommended to use the LaTeX equivalent. In your case the proper way to use \def would be:


\let lets you copy a command, for example:


Now you could change \sol with \renewcommand.

Also see:

share|improve this answer

Both your invocations of \def and \let are flawed. For the first, to define a macro with no arguments, you just write \def\sol{...}, without #0: the terms #n don't mean "this macro has this many arguments", but rather, "this is the n'th argument". So with one argument you would use \def\sol#1{...}, with two \def\sol#1#2{...}, and so on. It is also possible to intersperse other stuff between the arguments to create a context for the macro, but that's not relevant here.

For the second, \let defines a macro name to be equal to one other token, not a brace group. So what you wrote,

\let\sol {{\addfontfeature{LetterSpace=20.0}Решение}}

is the same as writing something with the following more obvious intent:

\let\sol {

meaning that \sol becomes a left brace and then TeX tries to process the rest, which has an excess right brace (since the other member of its pair just got eaten by \let). And that's your error.

That said, as Silex wrote, it's best to just use \newcommand; \def and \let are too primitive for a high-level document. So:


As a side note, you should omit the space you put after \def and \let; although it's harmless here, unnecessary spaces in TeX will lead to problems (see this one).

share|improve this answer

Oh, I found it:

share|improve this answer

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.