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 have some text, and a corresponding tikzpicture, both of which are to be part of a test question, and which are thus included as part of an \item in an enumerate environment.

Like this:

    description of question  
    question diagram  

What I want is for the text to be vertically aligned as it would be without a minipage environment, and for the top of the tikzpicture to be aligned with the top of the text.

I can obtain this alignment with the option "baseline=4cm" in tikzpicture, but this has the result of putting in a large amount of vertical white space before the item, which then has to be countered with \vspace*{-2cm}.

Is there a better, automatic, way rather than fiddling with vertical space?

share|improve this question
Hi Alasdair, you can use ` to format inline code and package/environment names. Code listings needs to be indented with 4 spaces to get syntax highlighted. You can use 101010 button on top of the edit window to do this automatically. – Martin Scharrer Feb 19 '11 at 22:44
it would be great if you would post a small compilable example with a real TikZ diagram showing what you mean and which we could test. – Stefan Kottwitz Feb 19 '11 at 23:12
The answers to another question might be helpful. – Thorsten Donig Feb 20 '11 at 14:26
up vote 7 down vote accepted

It is a generic trick, to add a \vspace{0pt} at the beginning of the minipage environment. For example:

    description of question  
    \draw circle (1cm);
share|improve this answer
Thanks! This helped me for some quite different problem with a badly aligned graphic in a minipage as well. – matheburg Jul 15 '13 at 13:36
Does anybody know why this trick is working? – Sebastien Nov 4 '14 at 21:50

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.