🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.tex
Article #1883

Re: LaTeX question: frames with round corners

#1883
From: Nico Verwer
Date: Mon, 31 Aug 1992 10:12
41 lines
2168 bytes
In <1992Aug27.123632.26858@cs.ruu.nl> nico@cs.ruu.nl (Nico Verwer) writes:

>Yesterday, I wrote:
>>I would like to have a macro similar to \fbox, but with rounded corners.
>
>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.

Since then, I have received more reactions, and a bug report.
Some people pointed me to pstricks, which can do this, but it needs a
postscript printer.

The macro I posted did not work when you put an ovalfbox around a parbox
or minipage. That has now been solved, and the (hopefully correct) macro
is:

\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}%
    \hbox to\@ovxx{\hss\rm #1\hss}%
    \endgroup}}
Technical Details
Message-ID: <1992Aug31.101253.18366@cs.ruu.nl>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!alchemy!nico
References: <1992Aug26.151111.19898@cs.ruu.nl> <1992Aug27.123632.26858@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: <1992Aug31.101253.18366@cs.ruu.nl>
Date: Mon, 31 Aug 1992 10:12:53 GMT
References: <1992Aug26.151111.19898@cs.ruu.nl> <1992Aug27.123632.26858@cs.ruu.nl>
Organization: Utrecht University, Dept. of Computer Science
Lines: 41