%% %% This is file `examples.tex', %% Examples for the rotfloat package %% %% Copyright (c) 1995-2004 Axel Sommerfeldt (rotfloat@sommerfeldt.net) %% %% This file is part of the rotfloat package. %% ------------------------------------------ %% %% It may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.2 %% of this license or (at your option) any later version. %% The latest version of this license is in %% http://www.latex-project.org/lppl.txt %% and version 1.2 or later is part of all distributions of LaTeX %% version 1999/12/01 or later. %% \documentclass{article} \usepackage[figuresright]{rotfloat}[2004/01/04] \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} %\errorcontextlines9 %\tracingmacros=1\tracingcommands=1 \noindent First of all, here comes the original examples from the \textsf{float} package (just to see if they still work), the rotated versions of these will follow on the next pages (first without placement specifier, right afterwards with placement specifier \verb|[H]|): \begin{program}[H] \begin{verbatim} #include 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} \clearpage \begin{sidewaysprogram} \begin{verbatim} #include 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} % Here we try the star-form just for fun. % Note that this leads to an error is rotating < 2.10 is used! % \begin{sidewaysexample*} \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} \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} \clearpage \begin{sidewaysprogram}[H] \begin{verbatim} #include 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} \clearpage \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} \clearpage \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} % Finally a normal (not re-styled) sideways figure, again without and with [H] \begin{sidewaysfigure} THIS IS A FIGURE! \end{sidewaysfigure} \clearpage \begin{sidewaysfigure}[H] THIS IS A FIGURE! \end{sidewaysfigure} \end{document}