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.

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

1 Answer 1

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.