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

Hello I have the following new command (a bit simplified for readability):


I'm expecting the following behavior:

$\xz$ outputs as $x_0$
$\xz{1}$ outputs as $x_1$

Though, the compiled result returns:

$\xz$ outputs as $x_0$ (ok!)
$\xz{1}$ outputs as $x_01$ (??)

What I'm missing there?

share|improve this question
up vote 11 down vote accepted

You declared an optional argument, so you need to use \xz[1]:






enter image description here

\xz{1} will be understood as \xz without the optional argument and then {1}.

share|improve this answer
I would accept immediately, but I can accept the answer in 10 minutes. It's obviously true. And I have to sleep!! Thanks :) – Emiliano Poggi Sep 1 '12 at 22:06

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.