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'm using the beamer class and this code:

\includegraphics[scale=0.4]{2_1} &  hey ho \\ \hline 
s & ho  hey \\ \hline

and I get this output:


How can I make the "hey ho" text stay on top of it's cell? I'd like for it to stay attached to the top horizontal line, not the bottom one.

I tried substituting it with \vtop{\hbox{hey ho}} (only hint I could google up) but the result is the same.

share|improve this question
up vote 9 down vote accepted

While \vtop goes into the right direction applying it to "hey ho" doesn't help because the image causes the cell to be very high while the baseline (the logical line where the text sits on) is at the bottom of the image. This places the text in the other cell of the same row at the bottom. A way to fix this is to lower the image below the baseline, which will effectively raise the baseline and so the text sitting on it.

You can use the \raisebox{<length>}{<content>} macro to raise or lower the image. I would say lower it to the \height of the image minus the height of the text (given by \ht\strutbox):

(The demo mode is used here so the image is not required to compile the file. A black box is shown instead. Just remove the stuff for your file.)


    \raisebox{\dimexpr\ht\strutbox-\height\relax}{\includegraphics[draft,height=2cm,width=5cm,scale=0.4]{2_1}} & hey ho \\ \hline 
s & ho  hey \\ \hline


share|improve this answer
good explanation and example code! I'll remove my similar \raisebox answer since I prefer yours. – Stefan Kottwitz Mar 19 '11 at 22:31

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.