Frames

所向无敌的两个命令是 \fbox 和 \boxed

Text Frame

\fbox{hello}

text1.png

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

text2.png

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

text3.png

Inline Math Frame

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

imath.png

Displayed Math Frame

\[ \boxed{A=U\Sigma V^T} \]

dmath1.png

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

dmath2.png

Object Frame

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

obj1.png

\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}
}

obj21.png

Advertisements

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!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Categories

Blog Stats

  • 247,882 hits

%d bloggers like this: