Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to draw oval (or ellipse) around text

1,399 views
Skip to first unread message

jlco...@gmail.com

unread,
Oct 3, 2005, 2:21:14 PM10/3/05
to
I would like to be able to make LaTeX draw an oval (or ellipse) around
some text. For example, I would like to issue a command like:

\encircle{My text}

and have "My text" encircled by a sweeping ellipse. How can I do this?
I almost always use pdflatex. What packages do I need to have? If I
can't do it with one command as described, how can it be done? What I
am trying to avoid is specifying the position and size of an oval
around my text or other object I want to encircle.
Thanks for your help,
Jeremy

Oliver Corff

unread,
Oct 3, 2005, 3:29:48 PM10/3/05
to
jlco...@gmail.com wrote:

: \encircle{My text}

: am trying to avoid is specifying the position and size of an oval


: around my text or other object I want to encircle.

Use pstricks, (consult www.pstricks.de for a full overview)

O絛iver.

--
Dr. Oliver Corff e-mail: co...@zedat.fu-berlin.de

jlco...@gmail.com

unread,
Oct 3, 2005, 3:37:19 PM10/3/05
to
I can't use pstricks with pdflatex. I have seen the package pdftricks,
but it requires many other things that make it not an attractive
option.
Thanks,
Jeremy

Oliver Corff

unread,
Oct 3, 2005, 3:52:42 PM10/3/05
to
jlco...@gmail.com wrote:
: I can't use pstricks with pdflatex.

Sorry, I didn't pay attention to your mentioning of pdflatex,

Oliver.

Bob Tennent

unread,
Oct 3, 2005, 4:49:01 PM10/3/05
to
On 3 Oct 2005 11:21:14 -0700, jlco...@gmail.com wrote:

> I would like to be able to make LaTeX draw an oval (or ellipse) around
> some text. For example, I would like to issue a command like:
>
> \encircle{My text}
>
> and have "My text" encircled by a sweeping ellipse. How can I do this?

\input{diagmac}
\begin{document}
\begin{center}
% circle:
\diagram{\vertex 0,0:{\mbox{My text}}
{\border{3pt}{4pt}\rorect{6pt}11\outline}}
% rounded-corner rectangle:
\diagram{\vertex 0,0:{\mbox{My text}}
{\border{3pt}{4pt}\rorect{6pt}00\outline}}
% oval:
\diagram{\vertex 0,0:{\mbox{My text}}
{\border{3pt}{4pt}\rorect{6pt}01\outline}}
\end{center}

where diagmac.tex (and the documentation diagmac.doc, a text file) are
available here:

ftp://ftp.cs.cmu.edu/user/jcr/

This will work with either LaTeX or pdfLaTeX. You can define a single
command encircle to use whichever of these styles you might prefer.
If you find the LaTeX picture constraints on line slopes and circle
diameters too severe, there is an version of diagmac adapted to pict2e
available; send me e-mail (Reply-To address).

Bob T.

Piet van Oostrum

unread,
Oct 4, 2005, 5:24:09 AM10/4/05
to
>>>>> jlco...@gmail.com (j) wrote:

>j> I would like to be able to make LaTeX draw an oval (or ellipse) around
>j> some text. For example, I would like to issue a command like:

>j> \encircle{My text}

>j> and have "My text" encircled by a sweeping ellipse. How can I do this?
>j> I almost always use pdflatex. What packages do I need to have? If I
>j> can't do it with one command as described, how can it be done? What I
>j> am trying to avoid is specifying the position and size of an oval
>j> around my text or other object I want to encircle.

With the pict2e package you can draw a circle (\circle) with any diameter.
You can calculate the diameter from the widt of the text. pict2e doesn't
have real ellipses, but only rectangle with rounded corners as ovals.

The pgf packages has both circles and ellipses.

Both packages work with pdflatex (and also with latex/dvips).
--
Piet van Oostrum <pi...@cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: pi...@vanoostrum.org

Pieter Rautenbach

unread,
Oct 4, 2005, 9:57:39 AM10/4/05
to

Hi Jeremy,

You can indeed use pstricks to compile to pdf, using dvipdfm, but I
believe Piet's suggestion(s) are just fine.

Pieter Rautenbach

Bob Tennent

unread,
Oct 4, 2005, 12:34:06 PM10/4/05
to
On 4 Oct 2005 06:57:39 -0700, Pieter Rautenbach wrote:

> You can indeed use pstricks to compile to pdf, using dvipdfm

How does one use pstricks with dvipdfm, which bypasses Postscript?

Bob T.

Dan

unread,
Oct 4, 2005, 1:38:17 PM10/4/05
to

You can't. I'm sure Pieter meant dvipdf, not dvipdfm.


Dan

Pieter Rautenbach

unread,
Oct 5, 2005, 2:58:07 AM10/5/05
to

Thanks for pointing that out. Please correct me if I'm wrong, Dan:
dvipdf is a bash script that uses a combination of dvips and ps2pdf,
right? dvipdfm will ignore the PostScript specials introduced by some
packages.

A quick glance of the Makefile I used to compile my thesis refreshed my
memory: I actually used the latex (dvi) -> ps (dvips) -> pdf (ps2pdf)
route. To Bob: make sure that you use the correct driver for hyperref
(ps2pdf in this case).

Pieter Rautenbach

Gianluca Pignalberi

unread,
Oct 5, 2005, 7:45:31 AM10/5/05
to
Hi,
maybe it isn't siutable for you, but did you try fancybox's \ovalbox or
\Ovalbox? Bye.
Gianluca

jlco...@gmail.com

unread,
Oct 6, 2005, 12:25:40 PM10/6/05
to
\ovalbox or \Ovalbox is the easiest way to do this. But I was looking
for more of a "sweeping" ellipse, something that looks almost hand
drawn. I know it can be done by drawing four bezier curves, but that
can become tedious to calculate all their parameters every time you
want to encircle something.
Thanks,
Jeremy

0 new messages