I'm using LaTeX to write manuscripts for plays, I've been looking a bit into conditional expressions. The reason is that I want comments in the manus, and I currently have two different commands for this: One for when in an itemize, and one for when not.

Is it possible to have an if/else, so that I don't need two commands?

1 Answer 1


You can check for the value of \@currenvir:




  \item Now we are \ifinitemize{in an itemize environment}{somewhere else}

Now we are \ifinitemize{in an itemize environment}{somewhere else}


enter image description here

I created a conditional command that executes the first or the second braced argument depending on the value of \@currenvir. This will not work, for example, if you nest some other environment inside the itemize because the value of \@currenvir will be updated.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .