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

Let's say I have the following text (a part of a paragraph):

hello world

I want to be able to typeset a small star/smiley/whatever graphic in between these two words. This graphic should of course be treated like a regular word, in the sense that we get proper spacing around it, just like for regular words.

The graphic should preferably be written right there in some MetaPost/PSTricks-like code, but I can also accept that I have to include it through an external PDF file.

How can I do this?

Edit: Come to think about it, I guess what I may be asking for is a way to create a new character, without actually having to mess with font-related stuff.

share|improve this question
\includegraphics can be used anywhere. – egreg Sep 3 '12 at 12:45
up vote 7 down vote accepted

Simply draw the graphic or include a graphic. Pstricks should work fine, or tikz:

       \fill[fill=yellow,draw=black] (0,0) circle (2ex);
       \draw (210:1.3ex) arc (210:330:1.3ex);
       \draw (210:1.1ex)--(210:1.5ex);
       \draw (330:1.1ex)--(330:1.5ex);
       \draw (135:1.1ex) circle (0.2ex);
       \draw (45:1.1ex) circle (0.2ex);

Hello \smiley\  World

\Huge Hello \smiley\ World



share|improve this answer
Do you know how to use a "pencircle" when drawing the lines? (So the ends are circular, not rectangular.) – MayGodBlessKnuth Sep 3 '12 at 13:21
See 15.3.1 Graphic Parameters: Line Width, Line Cap, and Line Join of pgfmanual.pdf. – Ulrike Fischer Sep 3 '12 at 13: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.