"Fossies" - the Fresh Open Source Software Archive

Member "hevea-2.35/examples/boxes.tex" (16 Jan 2021, 3882 Bytes) of package /linux/www/hevea-2.35.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) TeX and LaTeX source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 \documentclass{article}
    2 \title{Boxes, boxes, \dots}
    3 \author{Chris Spiel}
    4 \date{}
    5 
    6 \newenvironment{markerbar}{\begingroup$|$}{$|$\endgroup}
    7 
    8 \begin{document}\maketitle
    9 
   10 \section{Text Mode}
   11 
   12 \begin{itemize}
   13 \item \texttt{\textbackslash mbox}:
   14   \mbox{typeset text in LR-mode};
   15 
   16 \item \texttt{\textbackslash makebox}
   17   \begin{itemize}
   18   \item without optional arguments:
   19     \begin{markerbar}\makebox{text in LR-mode}\end{markerbar};
   20   \item with fixed width:
   21     \begin{markerbar}\makebox[12em]{text in LR-mode}\end{markerbar};
   22     \begin{markerbar}\makebox[12em][c]{text in LR-mode}\end{markerbar};
   23   \item fixed width, left-aligned:
   24     \begin{markerbar}\makebox[12em][l]{text in LR-mode}\end{markerbar};
   25   \item fixed width, right-aligned:
   26     \begin{markerbar}\makebox[12em][r]{text in LR-mode}\end{markerbar};
   27   \item fixed width, too wide:
   28     \begin{markerbar}\makebox[1em]{CENTERED}\end{markerbar};
   29   \item fixed width, too wide, left-aligned:
   30     \begin{markerbar}\makebox[1em][l]{LEFT-ALIGNED}\end{markerbar};
   31   \item fixed width, too wide, right-aligned:
   32     \begin{markerbar}\makebox[1em][r]{RIGHT-ALIGNED}\end{markerbar};
   33   \end{itemize}
   34 
   35 \item \texttt{\textbackslash fbox}:
   36   \fbox{typeset text in LR-mode and frame it};
   37 
   38 \item \texttt{\textbackslash framebox}
   39   \begin{itemize}
   40   \item without optional arguments: \framebox{text in LR-mode};
   41   \item with fixed width: \framebox[12em]{text in LR-mode};  \framebox[12em][c]{text in LR-mode};
   42   \item fixed width, left-aligned: \framebox[12em][l]{text in LR-mode};
   43   \item fixed width, right-aligned: \framebox[12em][r]{text in LR-mode};
   44   \item fixed width, too wide: \framebox[1em]{CENTERED};
   45   \item fixed width, too wide, left-aligned: \framebox[1em][l]{LEFT-ALIGNED};
   46   \item fixed width, too wide, right-aligned: \framebox[1em][r]{RIGHT-ALIGNED};
   47   \end{itemize}
   48 \end{itemize}
   49 
   50 
   51 \section{Framebox Nesting}
   52 
   53 \begin{itemize}
   54 \item \texttt{\textbackslash fbox}:
   55   \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}
   56 
   57 \item \texttt{\textbackslash framebox}:
   58   \framebox{E\framebox{F\framebox{%
   59         G\framebox{H\framebox{I\framebox{%
   60               J\framebox[9em][l]{K\framebox[5em][r]{L\framebox[2em][c]{M}N}O}P%
   61             }Q}R}S%
   62       }T}U}
   63 \end{itemize}
   64 
   65 
   66 \section{Math Mode}
   67 
   68 Check whether \texttt{\textbackslash normalfont} works inside of a
   69 math environment:
   70 $r_{\mathrm{s}} c^2 = 2 G M\textnormal{ with Schwarzschild radius}~r_{\mathrm{s}}$.
   71 
   72 \begin{equation}
   73     E = \hbar \omega\quad\makebox{de~Broglie}\ \mbox{I}
   74 \end{equation}
   75 
   76 \[
   77     p = \hbar k\quad\framebox{de~Broglie}\ \fbox{II}
   78 \]
   79 
   80 \begin{eqnarray}
   81   E  &  =  &
   82   \frac{p^2}{2m}  \\
   83   E  &  \rightarrow  &
   84   i \hbar \frac{\partial}{\partial{}t}\ \framebox{N.~Bohr}, \makebox{M.~Planck: $\hbar$}  \\
   85   p  &  \rightarrow  &
   86   -i \hbar \frac{\partial}{\partial{}x}\ \framebox{N.~Bohr}, \makebox{M.~Planck: $\hbar$}  \\
   87   -\frac{1}{2m} \frac{\partial^2}{\partial{}x^2} \Psi(x, t)  &  =  &
   88   i \frac{\partial}{\partial{}t}\Psi(x, t)\quad\makebox{Schr\"odinger Equ.}
   89 \end{eqnarray}
   90 
   91 \newcommand*{\samplephrase}{The quick brown fox jumps over the lazy
   92   dog.  Heavy boxes per\-form quick waltzes and jigs.  Sphinx of black
   93   quartz, judge my vow!}
   94 
   95 \section{Raised and Lowered Boxes}
   96 
   97 \begin{itemize}
   98 \item Some \raisebox{0.25em}{raised} text
   99 \item and also some \raisebox{-0.125em}{lowered} text.
  100 \item Again \raisebox{1.5em}[1pt]{raised (ht)} text, but with
  101   artificial height
  102 \item and \raisebox{-0.25em}[2pt][0pt]{lowered (ht, dp)} text
  103   with artificial height and depth.
  104 \end{itemize}
  105 
  106 \section{Parboxes}
  107 
  108 Parbox w/o optional parameter.\quad\parbox{14em}{\samplephrase}
  109 
  110 \noindent Bottom-aligned parbox.\quad\parbox[b]{14em}{\samplephrase}
  111 
  112 \noindent Top-aligned parbox.\quad\parbox[t]{14em}{\samplephrase}
  113 
  114 \noindent \parbox{10em}{\samplephrase}\quad
  115 Some funny stuff.\quad\parbox{10em}{\samplephrase}
  116 \end{document}