I'm new to creating new environments and even though I searched at the xparse*documentation I couldn't figured out how to solve my specific problem. I would like to create a new environment, say concept, and I would like it to take an optional argument (I don't know if it has to be a boolean or what). This optional argument will make the text to be in italics. If the argument is not declared, it will simply print normal font. It's as simple as that. So

\begin{concept}[i] % I just invented a option named "i"
  This text will be in italics

or without an option

  This text will be in normal font.

I thought that may be using the xparse package would make the task easier. Sorry to ask such a silly question but I couldn't come to a solution.

  • For simple usages see Peter's answer. For advanced stuff, try some of the keyval packages like kvoptions or pgfkeys, xkeyval, l3keys etc.
    – yo'
    Feb 20, 2013 at 13:31
  • Welcome to TeX.sx! Your post was migrated here from Stack Overflow site. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question.
    – Werner
    Feb 20, 2013 at 15:21

1 Answer 1


Normal LaTeX environments can do this without the need for the xparse package:

enter image description here


  • I have used the xstring package for string comparison as I prefer it's syntax, but this could be done without that package if needed.


Relevant for using \itshape:




\begin{concept}[i]% I just invented a option named "i"
  This text will be in italics

  This text will be in normal font.


You must log in to answer this question.

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