Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LaTeX \includegraphics and textline

Tags:

latex

graphics

Ok, I am beat. I tried a few things but I am unable to make this happen. I need some help now. I want to be able to have some text and picture side by side (only one line, thus no need for wrapping or other fun. The picture is small enough to fit in a text line):

This is a text <temp.jpg placed center to the textline>

Problem is, when I use

This is a text \includegraphics{temp.jpg} 

the pictures baseline is alligned with the text baseline. I want the picture (vertical) center to be aligned with the text baseline. How can I make this possible?

like image 522
Jose Avatar asked Jun 30 '10 08:06

Jose


2 Answers

This is a text $\vcenter{\hbox{\includegraphics{temp.jpg}}}$
like image 76
Alexey Malistov Avatar answered Oct 13 '22 01:10

Alexey Malistov


It sounds like you want \raisebox (see the raisebox section of the LaTeX wikibook), with a negative argument. Use dimensions ex (the notional height of an 'x' in the current font) or \baselineskip (the size between text baselines) as your units.

If you want to do more complicated things, such as move the graphics box down by half its height, you can, but it gets fiddly. If the graphic size isn't unpredictable, you're probably better off tuning this by hand anyway.

like image 44
Norman Gray Avatar answered Oct 13 '22 00:10

Norman Gray