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

Put a framebox around an algorithm ...

654 views
Skip to first unread message

Jose Luis Neves

unread,
Oct 9, 1992, 8:58:53 AM10/9/92
to
I have an algorithm I want to include in a report. I was able to tab the
algorithm using the tabbing environment. My next step was to frame the
algorithm and use it as a figure, which I was unable to do with the
Latex command \fbox. If any one has a sugestion or know a .sty file
setup for this purpose please contact me at ne...@ee.rochester.edu

--Jose

Thomas Sheffler

unread,
Oct 13, 1992, 4:23:36 PM10/13/92
to

I like to put boxes around all of my figures and algorithms in
reports, and finally came up with my 'bigbox' environment. It makes a
box as wide as the current text and sets the stuff inside with a
narrower width. The contents of 'bigbox.sty' are below.

USAGE:

\begin{figure}
\begin{bigbox}
\begin{tabbing}
(stuff in the tabular environment)

\end{tabbing}
\end{bigbox}

\caption{XXX}
\end{figure}

================================================================
%%% BIGBOX - environment
%%%
%%% TOM SHEFFLER
%%% Carnegie Mellon, Aug 1990
%%%
%%% Make an environment for boxing a figure and setting it in
%%% a narrower width.
\newdimen\boxfigwidth % width of figure box

\def\bigbox{\begingroup
% Figure out how wide to set the box in
\boxfigwidth=\hsize
\advance\boxfigwidth by -2\fboxrule
\advance\boxfigwidth by -2\fboxsep
\setbox4=\vbox\bgroup\hsize\boxfigwidth
% Make an invisible hrule so that the box is exactly this wide
\hrule height0pt width\boxfigwidth\smallskip
% Some environments like TABBING and other LIST environments
% use this measure of line size - \LINEWIDTH=\HSIZE-\LEFTMARGIN-\RIGHTMARGIN?
\linewidth=\boxfigwidth
}

\def\endbigbox{\smallskip\egroup\fbox{\box4}\endgroup}

Glenn Paulley

unread,
Oct 15, 1992, 10:01:02 AM10/15/92
to
In article <SHEFFLER.92...@colt.CS.CMU.EDU> shef...@colt.CS.CMU.EDU (Thomas Sheffler) writes:

I like to put boxes around all of my figures and algorithms in
reports, and finally came up with my 'bigbox' environment. It makes a
box as wide as the current text and sets the stuff inside with a
narrower width. The contents of 'bigbox.sty' are below.

USAGE:

\begin{figure}
\begin{bigbox}

[rest deleted.]

The FLOAT package allows you to create new types of floats (like "algorithm"
or "program") in addition to the standard Latex ones. In addition,
the package can "boxify" the contents of the float, put a header at the
top (see the tables in Graham, Knuth, and Patashnik's CONCRETE MATHEMATICS),
or plain. It also numbers the new floats and contains the macros for
listing the new floats in a table of contents. Very useful.

The FLOAT package (requires doc.sty and docstrip from Mainz) can be
retrieved by sending mail to file...@shsu.edu, and placing the words

SENDME FLOAT

in the message body.

Also available from other archives.

--
-- G. N. (Glenn) Paulley | Computer Science Department
-- USENET: gnpa...@bluebox.uwaterloo.ca | University of Waterloo
-- Phone: (519) 885-1211 x3490 | 200 University Avenue
-- Fax: (519) 885-1208 Office: DC3142 | Waterloo, Ontario, Canada N2L 3G1

0 new messages