Debian Codegraph @

texmf-dist/doc/latex/rotfloat/examples.tex

raw
1 %%
2 %% This is file `examples.tex',
3 %% Examples for the rotfloat package
4 %%
5 %% Copyright (c) 1995-2004 Axel Sommerfeldt ([email protected])
6 %%
7 %% This file is part of the rotfloat package.
8 %% ------------------------------------------
9 %%
10 %% It may be distributed and/or modified under the
11 %% conditions of the LaTeX Project Public License, either version 1.2
12 %% of this license or (at your option) any later version.
13 %% The latest version of this license is in
14 %% http://www.latex-project.org/lppl.txt
15 %% and version 1.2 or later is part of all distributions of LaTeX
16 %% version 1999/12/01 or later.
17 %%
18 \documentclass{article}
19 \usepackage[figuresright]{rotfloat}[2004/01/04]
20 \usepackage{shortvrb}
21
22 \floatstyle{ruled}
23 \floatname{program}{Program}
24 \newfloat{program}{tbp}{lof}[section]
25 \floatstyle{plain}
26 \floatname{example}{Example}
27 \newfloat{example}{t}{lof}[section]
28 \floatstyle{boxed}
29 \restylefloat{table}
30
31 \begin{document}
32 %\errorcontextlines9
33 %\tracingmacros=1\tracingcommands=1
34
35 \noindent First of all, here comes the original examples from the
36 \textsf{float} package (just to see if they still work), the rotated
37 versions of these will follow on the next pages (first without placement
38 specifier, right afterwards with placement specifier \verb|[H]|):
39
40 \begin{program}[H]
41 \begin{verbatim}
42 #include <stdio.h>
43
44 int main(int argc, char **argv)
45 {
46 int i;
47 for (i = 0; i < argc; ++i)
48 printf("argv[%d] = %s\n", i, argv[i]);
49 return 0;
50 }
51 \end{verbatim}
52 \caption{The first program. This hasn't got anything to do with the style
53 but is included as an example. Note the \texttt{ruled} float style.%
54 \label{prog1.1}}
55 \end{program}
56
57 \begin{example}[H]
58 \begin{verse}
59 \MakeShortVerb{\|}
60 |\floatstyle{ruled}|\\
61 |\newfloat{Program}{tbp}{lop}[section]|\\
62 \dots\ loads o' stuff \dots\\
63 |\begin{Program}|\\
64 |\begin{verbatim}|\\
65 \dots\ program text \dots\\
66 |\end{verbatim}|\\
67 |\caption{|\dots\ caption \dots|}|\\
68 |\end{Program}|
69 \DeleteShortVerb{\|}
70 \end{verse}
71 \caption{This is another silly floating Example.}
72 \end{example}
73
74 \begin{table}[H] \def\B#1{$\displaystyle{n\choose#1}$}
75 \begin{center} \begin{tabular}{c|cccccccc}
76 $n$&\B0&\B1&\B2&\B3&\B4&\B5&\B6&\B7\\ \hline
77 0 & 1\\
78 1 & 1&1\\
79 2 & 1&2&1\\
80 3 & 1&3&3&1\\
81 4 & 1&4&6&4&1\\
82 5 & 1&5&10&10&5&1\\
83 6 & 1&6&15&20&15&6&1\\
84 7 & 1&7&21&35&35&21&7&1
85 \end{tabular} \end{center}
86 \caption{Pascal's triangle. This is a re-styled \LaTeX\ \texttt{table}.%
87 \label{table1}}
88 \end{table}
89
90 \clearpage
91
92 \begin{sidewaysprogram}
93 \begin{verbatim}
94 #include <stdio.h>
95
96 int main(int argc, char **argv)
97 {
98 int i;
99 for (i = 0; i < argc; ++i)
100 printf("argv[%d] = %s\n", i, argv[i]);
101 return 0;
102 }
103 \end{verbatim}
104 \caption{The first program. This hasn't got anything to do with the style
105 but is included as an example. Note the \texttt{ruled} float style.%
106 \label{prog1.2}}
107 \end{sidewaysprogram}
108
109 % Here we try the star-form just for fun.
110 % Note that this leads to an error is rotating < 2.10 is used!
111 %
112 \begin{sidewaysexample*}
113 \begin{verse}
114 \MakeShortVerb{\|}
115 |\floatstyle{ruled}|\\
116 |\newfloat{Program}{tbp}{lop}[section]|\\
117 \dots\ loads o' stuff \dots\\
118 |\begin{Program}|\\
119 |\begin{verbatim}|\\
120 \dots\ program text \dots\\
121 |\end{verbatim}|\\
122 |\caption{|\dots\ caption \dots|}|\\
123 |\end{Program}|
124 \DeleteShortVerb{\|}
125 \end{verse}
126 \caption{This is another silly floating Example.}
127 \end{sidewaysexample*}
128
129 \begin{sidewaystable} \def\B#1{$\displaystyle{n\choose#1}$}
130 \begin{center} \begin{tabular}{c|cccccccc}
131 $n$&\B0&\B1&\B2&\B3&\B4&\B5&\B6&\B7\\ \hline
132 0 & 1\\
133 1 & 1&1\\
134 2 & 1&2&1\\
135 3 & 1&3&3&1\\
136 4 & 1&4&6&4&1\\
137 5 & 1&5&10&10&5&1\\
138 6 & 1&6&15&20&15&6&1\\
139 7 & 1&7&21&35&35&21&7&1
140 \end{tabular} \end{center}
141 \caption{Pascal's triangle. This is a re-styled \LaTeX\ \texttt{table}.%
142 \label{table2}}
143 \end{sidewaystable}
144
145 \clearpage
146 \begin{sidewaysprogram}[H]
147 \begin{verbatim}
148 #include <stdio.h>
149
150 int main(int argc, char **argv)
151 {
152 int i;
153 for (i = 0; i < argc; ++i)
154 printf("argv[%d] = %s\n", i, argv[i]);
155 return 0;
156 }
157 \end{verbatim}
158 \caption{The first program. This hasn't got anything to do with the style
159 but is included as an example. Note the \texttt{ruled} float style.%
160 \label{prog1.2}}
161 \end{sidewaysprogram}
162
163 \clearpage
164 \begin{sidewaysexample}[H]
165 \begin{verse}
166 \MakeShortVerb{\|}
167 |\floatstyle{ruled}|\\
168 |\newfloat{Program}{tbp}{lop}[section]|\\
169 \dots\ loads o' stuff \dots\\
170 |\begin{Program}|\\
171 |\begin{verbatim}|\\
172 \dots\ program text \dots\\
173 |\end{verbatim}|\\
174 |\caption{|\dots\ caption \dots|}|\\
175 |\end{Program}|
176 \DeleteShortVerb{\|}
177 \end{verse}
178 \caption{This is another silly floating Example.}
179 \end{sidewaysexample}
180
181 \clearpage
182 \begin{sidewaystable}[H] \def\B#1{$\displaystyle{n\choose#1}$}
183 \begin{center} \begin{tabular}{c|cccccccc}
184 $n$&\B0&\B1&\B2&\B3&\B4&\B5&\B6&\B7\\ \hline
185 0 & 1\\
186 1 & 1&1\\
187 2 & 1&2&1\\
188 3 & 1&3&3&1\\
189 4 & 1&4&6&4&1\\
190 5 & 1&5&10&10&5&1\\
191 6 & 1&6&15&20&15&6&1\\
192 7 & 1&7&21&35&35&21&7&1
193 \end{tabular} \end{center}
194 \caption{Pascal's triangle. This is a re-styled \LaTeX\ \texttt{table}.%
195 \label{table2}}
196 \end{sidewaystable}
197
198 % Finally a normal (not re-styled) sideways figure, again without and with [H]
199
200 \begin{sidewaysfigure}
201 THIS IS A FIGURE!
202 \end{sidewaysfigure}
203
204 \clearpage
205 \begin{sidewaysfigure}[H]
206 THIS IS A FIGURE!
207 \end{sidewaysfigure}
208
209 \end{document}