I'd like to insert a small image inside a paragraph, aligning it with the text. The following snapshot depicts what I have in mind. Notice the image at the end of the last line.


  • 3
    Nothing prevents you from using \includegraphics in a paragraph. There is no need to insert it in a figure environment: for TeX it's just like a letter (almost, but the details don't concern this application).
    – egreg
    Nov 21 '12 at 13:01

Use \includegraphics from graphicx:

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus
et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra
metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus
eu tellus sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium
quis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aenean
faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Cur-
abitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue
eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim

enter image description here

I have used scale here just to reduce the image (I don't have a small image right now). You may opt not to use it.

  • As an alternative to scale, you could also use the width and/or height key to make sure the image comes out the right size in the text. This way, the code does not depend so much on specifics of the image. Nov 21 '12 at 13:17
  • depending on the shape of the image relative to the text, you may want to apply (negative) \raisebox to the image to improve the positioning. if the image is being used more than once, it's efficient to pack it into a \savebox and then use it later. for example, \newsavebox{\mybox} \savebox{\mybox}{\raisebox{-.5ex}{\includegraphics[scale=.03]{example-image}}} and then \usebox{\mybox} Nov 21 '12 at 14:32

You can alternatively define and use a new command for your custom glyph. This is especially useful if you will want to use it more than once.

If you want to fine-tune your output so that your glyph is properly displayed relative to your line of text you can use the [height] argument and \raisebox{} container:

This is your custom image-based glyph shown inline and typeset however best fits the image: \imge !!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.