[texhax] (no subject)

doug waud douglas.waud at umassmed.edu
Fri Jun 20 08:08:49 CEST 2003


Hi

Tzipmyster at aol.com wrote:
> I'm new to TeX and would like to pose the following question: How would 
> I put a frame around some text {in this case, mathematical text} with a 
> rule of .5pt? Is it possible to do this with plain TeX without using any 
> additional packages?

Here, I believe, is an example which does what you want:

% test file to put a box around text
\vbox{%
\hrule height 0.5 pt
\hbox{\vrule width 0.5 pt\hfill $A=B+C^2$\hfill\vrule width 0.5pt}
\hrule height 0.5 pt}

And a nicer version with some extra space

\noindent (notice that you have to
nest h and v boxes to get it right!):

\vbox{%
\hrule height 0.5 pt
\hbox{\vrule width 0.5 pt
\vbox{\vskip 1pt\hbox{\hfill\hskip 1pt
$A=B+C^2$\hskip 1pt\hfill}
\vskip 1pt}\vrule width 0.5pt}
\hrule height 0.5 pt}
\end

doug



More information about the texhax mailing list