File: boxes.tex

package info (click to toggle)
hevea 2.36-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,780 kB
  • sloc: ml: 19,453; sh: 503; makefile: 311; ansic: 132
file content (116 lines) | stat: -rw-r--r-- 3,882 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
\documentclass{article}
\title{Boxes, boxes, \dots}
\author{Chris Spiel}
\date{}

\newenvironment{markerbar}{\begingroup$|$}{$|$\endgroup}

\begin{document}\maketitle

\section{Text Mode}

\begin{itemize}
\item \texttt{\textbackslash mbox}:
  \mbox{typeset text in LR-mode};

\item \texttt{\textbackslash makebox}
  \begin{itemize}
  \item without optional arguments:
    \begin{markerbar}\makebox{text in LR-mode}\end{markerbar};
  \item with fixed width:
    \begin{markerbar}\makebox[12em]{text in LR-mode}\end{markerbar};
    \begin{markerbar}\makebox[12em][c]{text in LR-mode}\end{markerbar};
  \item fixed width, left-aligned:
    \begin{markerbar}\makebox[12em][l]{text in LR-mode}\end{markerbar};
  \item fixed width, right-aligned:
    \begin{markerbar}\makebox[12em][r]{text in LR-mode}\end{markerbar};
  \item fixed width, too wide:
    \begin{markerbar}\makebox[1em]{CENTERED}\end{markerbar};
  \item fixed width, too wide, left-aligned:
    \begin{markerbar}\makebox[1em][l]{LEFT-ALIGNED}\end{markerbar};
  \item fixed width, too wide, right-aligned:
    \begin{markerbar}\makebox[1em][r]{RIGHT-ALIGNED}\end{markerbar};
  \end{itemize}

\item \texttt{\textbackslash fbox}:
  \fbox{typeset text in LR-mode and frame it};

\item \texttt{\textbackslash framebox}
  \begin{itemize}
  \item without optional arguments: \framebox{text in LR-mode};
  \item with fixed width: \framebox[12em]{text in LR-mode};  \framebox[12em][c]{text in LR-mode};
  \item fixed width, left-aligned: \framebox[12em][l]{text in LR-mode};
  \item fixed width, right-aligned: \framebox[12em][r]{text in LR-mode};
  \item fixed width, too wide: \framebox[1em]{CENTERED};
  \item fixed width, too wide, left-aligned: \framebox[1em][l]{LEFT-ALIGNED};
  \item fixed width, too wide, right-aligned: \framebox[1em][r]{RIGHT-ALIGNED};
  \end{itemize}
\end{itemize}


\section{Framebox Nesting}

\begin{itemize}
\item \texttt{\textbackslash fbox}:
  \fbox{E\fbox{F\fbox{G\fbox{H\fbox{I\fbox{J\fbox{K\fbox{L\fbox{M}N}O}P}Q}R}S}T}U}

\item \texttt{\textbackslash framebox}:
  \framebox{E\framebox{F\framebox{%
        G\framebox{H\framebox{I\framebox{%
              J\framebox[9em][l]{K\framebox[5em][r]{L\framebox[2em][c]{M}N}O}P%
            }Q}R}S%
      }T}U}
\end{itemize}


\section{Math Mode}

Check whether \texttt{\textbackslash normalfont} works inside of a
math environment:
$r_{\mathrm{s}} c^2 = 2 G M\textnormal{ with Schwarzschild radius}~r_{\mathrm{s}}$.

\begin{equation}
    E = \hbar \omega\quad\makebox{de~Broglie}\ \mbox{I}
\end{equation}

\[
    p = \hbar k\quad\framebox{de~Broglie}\ \fbox{II}
\]

\begin{eqnarray}
  E  &  =  &
  \frac{p^2}{2m}  \\
  E  &  \rightarrow  &
  i \hbar \frac{\partial}{\partial{}t}\ \framebox{N.~Bohr}, \makebox{M.~Planck: $\hbar$}  \\
  p  &  \rightarrow  &
  -i \hbar \frac{\partial}{\partial{}x}\ \framebox{N.~Bohr}, \makebox{M.~Planck: $\hbar$}  \\
  -\frac{1}{2m} \frac{\partial^2}{\partial{}x^2} \Psi(x, t)  &  =  &
  i \frac{\partial}{\partial{}t}\Psi(x, t)\quad\makebox{Schr\"odinger Equ.}
\end{eqnarray}

\newcommand*{\samplephrase}{The quick brown fox jumps over the lazy
  dog.  Heavy boxes per\-form quick waltzes and jigs.  Sphinx of black
  quartz, judge my vow!}

\section{Raised and Lowered Boxes}

\begin{itemize}
\item Some \raisebox{0.25em}{raised} text
\item and also some \raisebox{-0.125em}{lowered} text.
\item Again \raisebox{1.5em}[1pt]{raised (ht)} text, but with
  artificial height
\item and \raisebox{-0.25em}[2pt][0pt]{lowered (ht, dp)} text
  with artificial height and depth.
\end{itemize}

\section{Parboxes}

Parbox w/o optional parameter.\quad\parbox{14em}{\samplephrase}

\noindent Bottom-aligned parbox.\quad\parbox[b]{14em}{\samplephrase}

\noindent Top-aligned parbox.\quad\parbox[t]{14em}{\samplephrase}

\noindent \parbox{10em}{\samplephrase}\quad
Some funny stuff.\quad\parbox{10em}{\samplephrase}
\end{document}