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 am interested in defining a new environment in LaTeX that has a starred version. How is this done?

share|improve this question
up vote 19 down vote accepted

Since the \newenvironment command uses a \csname, you can define it directly.


You can have any combination of characters (with catcode 11 and 12) as you would in a \csname...\endcsname construct,


What you do with the starred command is up to you.

share|improve this answer
I thought it would be much more complicated than this :-) I should have tried it myself before I asked. – digital-Ink May 23 '12 at 18:14
@digital-Ink It's a sort of a hidden feature. – Yiannis Lazarides May 23 '12 at 18:15
If you were to define a command, xparse would allow to handle the starred and non-starred case in one definition. For environments, the solution however is less beautiful. – dgs May 23 '12 at 19:01
@Yiannis saying "any combination of characters" is perhaps a little misleading as one is only allowed to use characters with catcode 11 and 12, e.g. \newenvironment{foo$} isn't working. – Frank Mittelbach May 24 '12 at 10:40
Right, I have a solution for the starred environment business: if it works, it will be in the next xparse update – Joseph Wright May 24 '12 at 12:13

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.