Plan 9 from Bell Labs’s /usr/web/sources/contrib/steve/root/sys/lib/texmf/doc/latex/rotfloat/examples.tex

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


% examples.tex - Examples for the rotfloat package
% (c) 1995 Harald Axel Sommerfeldt ([email protected])

\documentclass{article}
\usepackage[figuresright]{rotfloat}[1995/03/30]
\usepackage{shortvrb}

\floatstyle{ruled}
\floatname{program}{Program}
\newfloat{program}{tbp}{lof}[section]
\floatstyle{plain}
\floatname{example}{Example}
\newfloat{example}{t}{lof}[section]
\floatstyle{boxed}
\restylefloat{table}

\begin{document}
\noindent First of all, here comes the examples from the \textsf{float} package,
the rotated versions of these will follow on the next pages:

\begin{program}[H]
\begin{verbatim}
#include <stdio.h>

int main(int argc, char **argv)
{
       int i;
       for (i = 0; i < argc; ++i)
               printf("argv[%d] = %s\n", i, argv[i]);
       return 0;
}
\end{verbatim}
\caption{The first program. This hasn't got anything to do with the style
   but is included as an example. Note the \texttt{ruled} float style.%
   \label{prog1.1}}
\end{program}

\begin{example}[H]
\begin{verse}
\MakeShortVerb{\|}
|\floatstyle{ruled}|\\
|\newfloat{Program}{tbp}{lop}[section]|\\
\dots\ loads o' stuff \dots\\
|\begin{Program}|\\
|\begin{verbatim}|\\
\dots\ program text \dots\\
|\end{verbatim}|\\
|\caption{|\dots\ caption \dots|}|\\
|\end{Program}|
\DeleteShortVerb{\|}
\end{verse}
\caption{This is another silly floating Example.}
\end{example}

\begin{table}[H] \def\B#1{$\displaystyle{n\choose#1}$}
\begin{center} \begin{tabular}{c|cccccccc}
$n$&\B0&\B1&\B2&\B3&\B4&\B5&\B6&\B7\\ \hline
 0 & 1\\
 1 & 1&1\\
 2 & 1&2&1\\
 3 & 1&3&3&1\\
 4 & 1&4&6&4&1\\
 5 & 1&5&10&10&5&1\\
 6 & 1&6&15&20&15&6&1\\
 7 & 1&7&21&35&35&21&7&1
\end{tabular} \end{center}
\caption{Pascal's triangle. This is a re-styled \LaTeX\ \texttt{table}.%
  \label{table1}}
\end{table}

\begin{sidewaysprogram}[H]
\begin{verbatim}
#include <stdio.h>

int main(int argc, char **argv)
{
       int i;
       for (i = 0; i < argc; ++i)
               printf("argv[%d] = %s\n", i, argv[i]);
       return 0;
}
\end{verbatim}
\caption{The first program. This hasn't got anything to do with the style
   but is included as an example. Note the \texttt{ruled} float style.%
   \label{prog1.2}}
\end{sidewaysprogram}

\begin{sidewaysexample}[H]
\begin{verse}
\MakeShortVerb{\|}
|\floatstyle{ruled}|\\
|\newfloat{Program}{tbp}{lop}[section]|\\
\dots\ loads o' stuff \dots\\
|\begin{Program}|\\
|\begin{verbatim}|\\
\dots\ program text \dots\\
|\end{verbatim}|\\
|\caption{|\dots\ caption \dots|}|\\
|\end{Program}|
\DeleteShortVerb{\|}
\end{verse}
\caption{This is another silly floating Example.}
\end{sidewaysexample}

\begin{sidewaystable}[H] \def\B#1{$\displaystyle{n\choose#1}$}
\begin{center} \begin{tabular}{c|cccccccc}
$n$&\B0&\B1&\B2&\B3&\B4&\B5&\B6&\B7\\ \hline
 0 & 1\\
 1 & 1&1\\
 2 & 1&2&1\\
 3 & 1&3&3&1\\
 4 & 1&4&6&4&1\\
 5 & 1&5&10&10&5&1\\
 6 & 1&6&15&20&15&6&1\\
 7 & 1&7&21&35&35&21&7&1
\end{tabular} \end{center}
\caption{Pascal's triangle. This is a re-styled \LaTeX\ \texttt{table}.%
  \label{table2}}
\end{sidewaystable}

\end{document}


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].