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.

How do I confine text within a shape such as a circle or triangle? I don't want text along the perimeter, I would like it to break appropriately at all the inner edges.

share|improve this question

2 Answers 2

Look at shapepar (manual) for how to do it.

share|improve this answer
    
Neat! Looks much better than trying to use \parshape. –  TH. Oct 28 '10 at 6:15
3  
Also, the shapepatch package could be useful, if one finds defining shapes complicated. It allows using xfig shapes to describe the boundaries, if that's your thing. –  Martin Tapankov Oct 28 '10 at 7:00
    
@Martin: make this an answer instead of a comment and you can receive some upvotes for it. –  Matthew Leingang Oct 29 '10 at 15:07
    
@Mattew: one can still upvote a comment...if you think it is deserving. This should be devorced from Martin's decision on writing his own answer, ofcourse. –  Yossi Farjoun Oct 30 '10 at 10:19
    
@Yossi @Matthew I decided to add a comment here because it felt wrong to post essentially what Yossi said with little additional information. I squeezed in some minutes just today to write an answer with an example, which I believe is a significant improvement. I couldn't care less for some "easy" 20-30 rep, I try to make my answers informative and useful instead. –  Martin Tapankov Oct 30 '10 at 13:31

As @Yossi mentioned before, shapepar is your friend. The full documentation is at its usual place in CTAN. Here's an example how to use it:

\documentclass{article}
\usepackage{shapepar}
\begin{document}

\def\triangledownshape{%
{0}%
{0}b{0}\\%
{0}t{-10}{20}\\%
{8.66}t{-5}{10}\\%
{17.32}e{0}%
}
\def\triangledownpar#1{\Shapepar\triangledownshape #1\unskip\ $\bigtriangledown$\par}

\triangledownpar{This is an example of a shape created with 
   \texttt{shapepar}. Other predefined possibilities include \textbf{circle},     
   \textbf{donut}, \textbf{heart}, \textbf{star}, \textbf{star}, \textbf{nut}, 
   \textbf{rectangle}. Also, there are other definitions currently not included 
   by default, which you'd find in the \texttt{*shapes.def} files in the
   \texttt{shapepar} directory~--- \textbf{drops}, \textbf{triangles} (facing all 
   directions), \textbf{\TeX logo}, \textbf{candle}, \textbf{Canadian flag}. 
   Your result may or may not look weird, depending on the size of the shape
   and the word distribution.}

\end{document}

Cutouts with custom shapes are also possible, but I haven't tried that in this particular example.

Personally, I find defining new shapes not very straight-forward, but YMMV. Also, if you're into xfig (I'm not), you could try the shapepatch package which basically patches (duh!) the xfig package so that you could use your masterpiece as a boundary for shapepar. I can't comment how well this works, though -- I've never used it.

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.