Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

Snapshot

share|improve this question
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

2 Answers 2

up vote 8 down vote accepted

Use \includegraphics from graphicx:

\documentclass{article}
\usepackage{lipsum}
\usepackage{graphicx}
\begin{document}
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
rutrum.\includegraphics[scale=0.02]{example-image}
\end{document}

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.

share|improve this answer
    
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. –  Charles Staats 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} –  barbara beeton 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:

\documentclass{article}
\usepackage{lipsum}
\usepackage{graphicx}
\newcommand*\imge{\raisebox{-0.17\baselineskip}{\includegraphics[height=0.81\baselineskip]{image.jpg}}}
\begin{document}
This is your custom image-based glyph shown inline and typeset however best fits the image: \imge !!!
\end{document}
share|improve this answer

Your Answer

 
discard

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.