Article View: comp.text.tex
Article #2044Re: LaTeX question: frames with round corners
From: Nico Verwer
Date: Thu, 03 Sep 1992 15:02
Date: Thu, 03 Sep 1992 15:02
50 lines
2773 bytes
2773 bytes
In <1992Aug31.101253.18366@cs.ruu.nl> nico@cs.ruu.nl (Nico Verwer) writes:
>>>I would like to have a macro similar to \fbox, but with rounded corners.
Apparently there is some interest, judging from the mail I got.
So here is the latest-and-greatest version. There are two improvements:
- Previously, \ovalfbox generated overfull \hboxes. This is now fixed.
- When a \parbox or \minipage, or something else which is big, is put in
a \ovalfbox, things inside stick beyond the frame, which is extremely
ugly. To solve this, there is an extra \Ovalfbox macro. (Thanks to
Mauro Orlandini.)
The macros should be put in a style file. Since some questions I got
were related to this, I have included a ready-for-use style file here.
---------------8<-------------------------
% THIS IS OVALFBOX.STY of August, 3, 1992.
% Unfortunately, \fboxrule (LaTeX book p.195) does not work,
% since we use ovals (circle font).
% Instead, use \thinlines and \thicklines.
% However, \fboxsep does work!
\def\ovalfbox#1{%
\mbox{% mbox, leaves vertical mode!
\begingroup \newdimen\@ovdp
\boxmaxdepth\maxdimen
\@ovttrue \@ovbtrue \@ovltrue \@ovrtrue
\setbox\@tempboxa\hbox{#1}%
\@ovxx\wd\@tempboxa \advance\@ovxx2\fboxsep
\@ovdp\dp\@tempboxa \advance\@ovdp\fboxsep
\@ovyy\ht\@tempboxa \advance\@ovyy\@ovdp \advance\@ovyy\fboxsep
\@tempdimb \ifdim \@ovyy >\@ovxx \@ovxx\else \@ovyy \fi
\advance \@tempdimb -2\p@
\@getcirc \@tempdimb % sets \@tempboxa en \@tempdima
\@ovro \ht\@tempboxa \@ovri \dp\@tempboxa
\@ovdx\@ovxx \advance\@ovdx -\@tempdima \divide\@ovdx \tw@
\@ovdy\@ovyy \advance\@ovdy -\@tempdima \divide\@ovdy \tw@
\@circlefnt
\setbox\@tempboxa
\hbox{\if@ovr \@ovvert32\kern -\@tempdima \fi
\if@ovl \kern \@ovxx \@ovvert01\kern -\@tempdima \kern -\@ovxx \fi
\if@ovt \@ovhorz \kern -\@ovxx \fi
\if@ovb \raise \@ovyy \@ovhorz \fi}%
\ht\@tempboxa\z@ \dp\@tempboxa\z@
\raise-\@ovdp\hbox to\z@{\box\@tempboxa\hss}%
\hbox to\@ovxx{\hss\rm #1\hss}%
\endgroup}}
\def\Ovalfbox#1{{\advance\fboxsep 1em \ovalfbox{#1}}}
% ^^^
% Change this if you want less/more space
\endinput
---------------8<-------------------------
Technical Details
Message-ID:
<1992Sep3.150246.9195@cs.ruu.nl>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!alchemy!nicoReferences:
<1992Aug26.151111.19898@cs.ruu.nl> <1992Aug27.123632.26858@cs.ruu.nl> <1992Aug31.101253.18366@cs.ruu.nl>Show Full Headers
Complete Article Headers
Newsgroups: comp.text.tex Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!alchemy!nico From: nico@cs.ruu.nl (Nico Verwer) Subject: Re: LaTeX question: frames with round corners Sender: network-news@cs.ruu.nl Message-ID: <1992Sep3.150246.9195@cs.ruu.nl> Date: Thu, 3 Sep 1992 15:02:46 GMT References: <1992Aug26.151111.19898@cs.ruu.nl> <1992Aug27.123632.26858@cs.ruu.nl> <1992Aug31.101253.18366@cs.ruu.nl> Organization: Utrecht University, Dept. of Computer Science Lines: 50