### Text Frame

\fbox{hello}

\fbox{However long the sentence is, it will not break into separate lines.}

\framebox{same as \texttt{\textbackslash fbox}, but more controls}

### Inline Math Frame

\boxed{e^{i\pi}+1=0} \fbox{$e^{i\pi}+1=0$}

### Displayed Math Frame

$\boxed{A=U\Sigma V^T}$

$\boxed{\delta_{ij}=\begin{cases}1&i=j\&i\ne j\end{cases}}$

### Object Frame

\centering \fbox{ \begin{minipage}{.6\linewidth} Put non-floating objects inside the \texttt{\textbackslash fbox}, e.g., minipages, tabulars, etc. \end{minipage} }

\centering \fbox{ \begin{tabular}{c|cc} $+$ & 0 & 1 \\ \hline 0 & 0 & 1 \\ 1 & 1 & 0 \end{tabular} \hspace{.5cm} \begin{tabular}{c|cc} $\cdot$ & 0 & 1 \\ \hline 0 & 0 & 0 \\ 1 & 0 & 1 \end{tabular} } 

#### 4 Responses to “Frames”

1. 1 zeynep July 27, 2009 at 4:23 am

you saved my day with the \fbox one. thanks!

2. 2 francesco May 22, 2011 at 10:47 am

Hi, thanks, it was very clear!
I just have a quick question. How can I have a box, say 50% of the text width, have it flushed to the left, and have the main text flowing in the second half?

the following code produces a nice box, BUT, to its right I have an ugly white space, that I would like to have filled with the main text. Any suggestions?
\fbox{
\begin{minipage}{0.5\textwidth}
TEXT OF THE BOX HERE
\end{minipage}
}

thanks!

• 3 Jie May 22, 2011 at 2:17 pm

francesco,

To put the main text right after the box, you have to treat the box and the main text as one paragraph, which means that there should not be an empty line between your \fbox{} command and the main text. Try out the following three code snippets and see the difference.

CODE 1:

\fbox{
\begin{minipage}{0.5\textwidth}
TEXT OF THE BOX HERE
\end{minipage}
}

Here goes the main text. Here goes the main text. Here goes the main text. Here goes the main text. Here goes the main text. Here goes the main text. Here goes the main text. Here goes the main text.

CODE 2:

\fbox{
\begin{minipage}{0.5\textwidth}
TEXT OF THE BOX HERE
\end{minipage}
}
Here goes the main text. Here goes the main text. Here goes the main text. Here goes the main text. Here goes the main text. Here goes the main text. Here goes the main text. Here goes the main text.

CODE 3:

\fbox{
\begin{minipage}{0.5\textwidth}
TEXT OF THE BOX HERE
\end{minipage}
}%
%
Here goes the main text. Here goes the main text. Here goes the main text. Here goes the main text. Here goes the main text. Here goes the main text. Here goes the main text. Here goes the main text.

• 4 francesco May 22, 2011 at 3:23 pm

thanks a lot, it seems trivial, once you told me! I feel rather stupid…

thank you again!

• 254,469 hits