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 want to create a new environment which depend if a parameter exists or not. The basic definition, which works fine, is:

\newrgbcolor{bcolor}{1. 1. 1.}%

In some cases I need to specify the height of the minipage, there for I tried

\newrgbcolor{bcolor}{1. 1. 1.}%

which does not.

In most cases I want to use the pbox without the extra argument to detect the right size automatilly. Only when I specifiy the additional parameter the box should be fixed to this size.


 This is a normal pbox which height is depending on the content. 
 This is a pbox which is at least 10cm height

How can this be done in a correct way?

share|improve this question
First of all, start by posting a full MWE (minimal example), e.g. where does \newrgbcolor come from? Also I do not think it is a good idea to declare a new color each time the environment is used. – daleif Feb 1 '12 at 15:10
The color comes from the original version which I try to modify. The pbox is used on a poster with non-white background. That's why I fixed the color which was originally an optional parameter. – Grisu Feb 1 '12 at 15:17
That still does not help the rest of us, why should we debug irrelevant parts of your code? The color part is irrelevant for the problem at hand. – daleif Feb 1 '12 at 15:19
up vote 3 down vote accepted

This works (etoolbox can do much more than ifthen)

   sdfsdfsd asdfasdf



share|improve this answer
That's exactly what I need. Thanks – Grisu Feb 1 '12 at 15:28

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.