Article View: comp.text.tex
Article #1792Re: LaTeX question: frames with round corners
From: Nico Verwer
Date: Thu, 27 Aug 1992 12:36
Date: Thu, 27 Aug 1992 12:36
39 lines
2127 bytes
2127 bytes
Yesterday, I wrote:
>I would like to have a macro similar to \fbox, but with rounded corners.
All I got was one ``me-too''. :-(
So I continued hacking myself :-) and finally succeeded.
Although there was only one me-too, I'll post my code here, just to
contribute to comp.text.tex. This is largely borrowed from LaTeX.TeX.
By the way --- My problem with tabular was that I didn't leave vertical
mode, which is now solved by an \mbox.
%%% put this in a .sty file
\def\ovalfbox#1{%
\mbox{% mbox leaves vertical mode!
\begingroup \boxmaxdepth\maxdimen
\@ovttrue \@ovbtrue \@ovltrue \@ovrtrue
\setbox\@tempboxa\hbox{#1}%
\@ovxx\wd\@tempboxa \advance\@ovxx2\fboxsep
\@ovyy\ht\@tempboxa \advance\@ovyy\dp\@tempboxa \advance\@ovyy2\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@
\@ovdx\z@ %\advance\@ovdx.5\@ovro
\@ovdy\@ovyy \advance\@ovdy -\@tempdima \divide\@ovdy\tw@
\advance\@ovdy\fboxsep
\raise -\@ovdy \hbox to\z@{\hskip-\@ovdx\box\@tempboxa}%
\@ovdx\@ovxx \advance\@ovdx.5\@ovro \advance\@ovdx-\fboxsep
\hbox to\@ovxx{\hss\rm #1\hss}%
\endgroup}}
Technical Details
Message-ID:
<1992Aug27.123632.26858@cs.ruu.nl>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!alchemy!nicoReferences:
<1992Aug26.151111.19898@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: <1992Aug27.123632.26858@cs.ruu.nl> Date: Thu, 27 Aug 1992 12:36:32 GMT References: <1992Aug26.151111.19898@cs.ruu.nl> Organization: Utrecht University, Dept. of Computer Science Lines: 40