home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / text / tex / 15312 < prev    next >
Encoding:
Internet Message Format  |  1993-01-22  |  2.7 KB

  1. Path: sparky!uunet!news.claremont.edu!ucivax!news.service.uci.edu!unogate!mvb.saic.com!info-tex
  2. From: Peter Schmitt <A8131DAL%AWIUNI11.BITNET@SHSU.edu>
  3. Newsgroups: comp.text.tex
  4. Subject: Re: Titled boxed text
  5. Message-ID: <10258298@MVB.SAIC.COM>
  6. Date: Fri, 22 Jan 93 14:30:41 MEZ
  7. Organization: Info-Tex<==>Comp.Text.Tex Gateway
  8. X-Gateway-Source-Info: Mailing List
  9. Lines: 72
  10.  
  11. I have not seen an answer on this, so maybe it is still open:
  12.  
  13. > From: stuart@coral.cs.jcu.edu.au (Stuart Kemp)
  14. > Subject: Need help with macro
  15. > Date: 17 Jan 93 07:12:59 GMT
  16. >
  17. > I would like to have a macro that can be given two parameters, a vbox and a
  18. > title, and I would like the macro to draw a "double-box" (i.e. 2 lines,
  19. > about 1mm apart) all around the vbox, and have the title appear on the lines
  20. > at the top (without the horizontal lines visible under the title). i.e.
  21. >
  22. >
  23. >                       === Title ===
  24. >                       || Some    ||
  25. >                       || Text    ||
  26. >                       || Here    ||
  27. >                       =============
  28. >
  29. > I can do it without the 'Title' (\boxit{\boxit{\vbox{...}}}) ... can anyone
  30. > help me out with this extra bit?
  31. >
  32.  
  33. The following definitions should work:
  34. (You may want to adapt the kern's to the values you prefer!)
  35.  
  36. \def\tboxit#1#2{{\setbox0=\hbox{\kern5pt#1\kern5pt}\edef\titlewidth{\the\wd0}%
  37.                 \setbox2=\vbox{#2}
  38.                 \setbox2=\vbox{%
  39.                     \vbox to1pt{\vss\hbox to\wd2{\strut\hfil#1\hfil}\vskip0pt}%
  40.                     \box2
  41.                     }
  42.                 \Tboxit{\titlewidth}{\Tboxit{\titlewidth}{\box2}}}}
  43. \def\Tboxit#1#2{\vbox{%
  44.     \setbox0=\hbox{\vrule\kern3pt\vbox{\kern3pt#2\kern3pt}\kern3pt\vrule}%
  45.     \hbox to\wd0{\hrulefill\kern#1\hrulefill}\nointerlineskip
  46.     \box0
  47.     \hrule
  48.     }}
  49.  
  50. %%% Tests:
  51.  
  52. \setbox2=\vbox{\hsize6cm
  53.    Test this boxing macro!
  54.    Test this boxing macro!
  55.    Test this boxing macro!
  56.    Test this boxing macro!
  57.    Test this boxing macro!
  58.    Test this boxing macro!
  59.               }
  60.  
  61. $$\tboxit{Title}{\box2}$$
  62.  
  63. \tboxit{New Title}{\vbox{\hsize7cm
  64.    Test this boxing macro!
  65.    Test this boxing macro!
  66.    Test this boxing macro!
  67.    Test this boxing macro!
  68.    Test this boxing macro!
  69.    Test this boxing macro!
  70.               }}
  71.  
  72. \end
  73.  
  74. Peter
  75.  
  76.  
  77. Peter Schmitt                             a8131dal@awiuni11.edvz.univie.ac.at
  78.                                                         schmitt@awirap.bitnet
  79. -----------------------------------------------------------------------------
  80. Institute of Mathematics                                     Strudlhofgasse 4
  81. University of Vienna                                              A-1090 Wien
  82.                                                                       Austria
  83.