Graphics, Figures & TablesHeart around text

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
mrAnonymus
Posts: 3
Joined: Thu May 19, 2011 6:05 pm

Heart around text

Post by mrAnonymus »

Well, i am trying to help a friend. And my problem is pretty much as described in the title, is there any possibility to get a heart around some text? The text will typicaly be between 5 and 20 characters.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Re: Heart around text

Post by kaiserkarl13 »

You should be able to use the picture environment to draw a heart, though you'll have to get comfortable with how to draw quadratic splines. You can put text inside the picture environment as well, which will have the effect of putting the text inside a heart.
mrAnonymus
Posts: 3
Joined: Thu May 19, 2011 6:05 pm

Re: Heart around text

Post by mrAnonymus »

Thank you for the answer, I guess that would be a solution. Though I think it is maybe a little bit over my knowledge to do so :)

Is there anyone who has another solution, maybe a solution that is a bit easier? :)
kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Heart around text

Post by kaiserkarl13 »

Here's an example. It's not particularly elegant or pretty; if you want that, you'll have to spend more than five minutes generating the quadratic Bezier curves (and more than likely splice a few of them together).

Code: Select all

\documentclass{article}
\begin{document}

\setlength{\unitlength}{5mm}
\framebox{
  \begin{picture}(20,20)
    \qbezier(10,4)(5,15)(10,10)
    \qbezier(10,4)(15,15)(10,10)
    \put(9,8){Hello!}
   \end{picture}
}
\end{document}
"The Not-So-Short Introduction to LaTeX" by Oetiker, Partl, Hyna, and Schlegl (see the list of resources on the forums or search the Web for "Not-So-Short LaTeX") has a good section on how to draw Bezier curves.
Lumy
Posts: 24
Joined: Tue Jan 06, 2009 2:41 pm

Heart around text

Post by Lumy »

Here's another example using the shapepar package:

Code: Select all

\documentclass{article}
\usepackage{shapepar}
\begin{document}
\heartpar{mmmm mmmm mmm mmmm mmmm mmm mmmmm   mmmm mmm mmm mm 
mmmm mmmm mmm mmm mmm mmmm mmmm mmm mmmm mmmm mmm mmmmm   mmmm mmm mmm mm mmmm mmmm mmm mmmm mmmm mmm mmmmm   mmmm mmm mmm mm mmmm mmmm mmm mmmm mmmm mmm mmmmm   mmmm mmm mmm mm }
\end{document}
Post Reply