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 would like to make a command in LaTeX that can be used like this:

\zoneaxis{1 2 -3}
\zoneaxis{2 -1 -1 10}

and would produce this:


That is, the three or four numbers are set into brackets, any minus signs are set as overlines, and there is a little space between the numbers.

It seems like I would have to get into character-by-character parsing, but I have no idea where to look for how to do that.

Does something like this already exist? If not, where could I find out how to do this?

share|improve this question
up vote 7 down vote accepted

The miller package is probably what you are looking for. Makes typesetting Miller indices quite easy.

share|improve this answer
Thanks, that is exactly what I was looking for. I made a little extension for specifying reflexes (without any brackets): \makeatletter \def\reflex#1{\ensuremath{\@millerno#1 \@empty}} \makeatother. – Svante Apr 15 '11 at 13:23

I suggest the use of xstring, which makes the parsing easier:

        \def\remain@arg{#1 }%


\zoneaxis{2 -1 -1 10}
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.