home *** CD-ROM | disk | FTP | other *** search
/ PD Collection CD 1 / PD Collection CD 1.iso / textual / tex / files / !tex / latexsty1 / BOXEDMIN / STY
Encoding:
Text File  |  1991-02-10  |  1.8 KB  |  57 lines

  1. %    boxedminipage.sty
  2. %
  3. % adds the boxedminipage environment---just like minipage, but has a
  4. % box round it!
  5. %
  6. % The thickneess of the rules around the box is controlled by
  7. % \fboxrule, and the distance between the rules and the edges of the
  8. % inner box is governed by \fboxsep.
  9. %
  10. % This code is based on Lamport's minipage code.
  11. %
  12. % Mario Wolczko
  13. % Dept. of Computer Science    Internet:   mario@ux.cs.man.ac.uk
  14. % The University               USENET: mcvax!ukc!man.cs.ux!mario
  15. % Manchester M13 9PL           JANET:      mario@uk.ac.man.cs.ux
  16. % U.K.                         Tel: +44-61-275 6146  (FAX: 6280)
  17. %
  18. % Fixed, 7 Jun 89 by Jerry Leichter
  19. %    Leave \fboxsep worth of separation at top and bottom, not just at
  20. %    the sides!
  21. %
  22. \def\boxedminipage{\@ifnextchar [{\@iboxedminipage}{\@iboxedminipage[c]}}
  23.  
  24. \def\@iboxedminipage[#1]#2{\leavevmode \@pboxswfalse
  25.   \if #1b\vbox 
  26.     \else \if #1t\vtop 
  27.          \else \ifmmode \vcenter 
  28.                \else \@pboxswtrue $\vcenter
  29.             \fi
  30.       \fi
  31.   \fi\bgroup % start of outermost vbox/vtop/vcenter
  32.     \hsize #2
  33.     \hrule\@height\fboxrule
  34.     \hbox\bgroup % inner hbox
  35.       \vrule\@width\fboxrule \hskip\fboxsep \vbox\bgroup % innermost vbox
  36.     \vskip\fboxsep
  37.     \advance\hsize -2\fboxrule \advance\hsize-2\fboxsep
  38.     \textwidth\hsize \columnwidth\hsize
  39.     \@parboxrestore 
  40.     \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@
  41.     \let\@footnotetext\@mpfootnotetext
  42.     \let\@listdepth\@mplistdepth \@mplistdepth\z@
  43.     \@minipagerestore\@minipagetrue 
  44.     \everypar{\global\@minipagefalse\everypar{}}}
  45.  
  46. \def\endboxedminipage{%
  47.     \par\vskip-\lastskip
  48.     \ifvoid\@mpfootins\else
  49.       \vskip\skip\@mpfootins\footnoterule\unvbox\@mpfootins\fi
  50.     \vskip\fboxsep
  51.       \egroup % ends the innermost \vbox
  52.       \hskip\fboxsep \vrule\@width\fboxrule
  53.     \egroup % ends the \hbox
  54.     \hrule\@height\fboxrule
  55.   \egroup% ends the vbox/vtop/vcenter
  56.   \if@pboxsw $\fi}
  57.