Debian Codegraph @

texmf-dist/doc/latex/texpower/tabexample.tex

raw
1 %%
2 %% This is file `tabexample.tex',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% texpower-doc.dtx (with options: `tabexample,tabexample-src,end')
8 %%
9 %% --------------------------------------------------------------
10 %% TeXPower bundle - dynamic online presentations with LaTeX
11 %% Copyright (C) 1999-2004 Stephan Lehmke
12 %% Copyright (C) 2003-2005 Hans Fredrik Nordhaug
13 %%
14 %% This program is free software; you can redistribute it and/or
15 %% modify it under the terms of the GNU General Public License
16 %% as published by the Free Software Foundation; either version 2
17 %% of the License, or (at your option) any later version.
18 %%
19 %% This program is distributed in the hope that it will be useful,
20 %% but WITHOUT ANY WARRANTY; without even the implied warranty of
21 %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 %% GNU General Public License for more details.
23 %% --------------------------------------------------------------
24 %%
25 %% The list of all files belonging to the TeXPower bundle is
26 %% given in the file `00readme.txt'.
27 %%
28 \ProvidesFile{tabexample.tex}%
29 [2005/04/07 TeXPower example file]
30 %-----------------------------------------------------------------------------------------------------------------
31 %
32 % Tabular example for the package texpower.sty.
33 %
34 %-----------------------------------------------------------------------------------------------------------------
35 % Use slifonts.
36
37 \RequirePackage{tpslifonts}
38
39 % Input the generic preamble.
40
41 \input{__TPpreamble}
42 \hypersetup{pdftitle={texpower tabular example}}
43
44
45 %-----------------------------------------------------------------------------------------------------------------
46 % Finally, everything is set up. Here we go...
47 %
48 \begin{document}
49 \begin{slide}
50
51
52 %-----------------------------------------------------------------------------------------------------------------
53 %
54 \makeslidetitle{\macroname{stepwise} Example: A Tabular}
55
56 % In the following, a tabular object is built incrementally.
57 % Observe how & and \\ are placed inside the following step to avoid `opening' empty cells.
58 % The macro \tabend is redefined to `replace' the final \hline by \cline's when a line is not yet complete.
59 %
60 \newcommand{\tabend}{\\\hline}%
61
62 \liststepwise{%
63 \begin{center}
64 \step{%
65 \begin{tabular}{|l|l|l|}
66 \hline
67 They can & be built & line by line%
68 \step{\\\hline or cell\renewcommand{\tabend}{\\\cline{1-1}}}%
69 \step{& by\renewcommand{\tabend}{\\\cline{1-2}}}%
70 \step{& cell\renewcommand{\tabend}{\\\hline}}%
71 \step
72 {%
73 \\\hline
74 %
75 % Again, \step's are nested inside each other...
76 %
77 \step{or}&\step{like}&\step{this.}%
78 }%
79 \step{\\\hline But\renewcommand{\tabend}{\\\cline{1-1}}}%
80 \step{& beware\renewcommand{\tabend}{\\\cline{1-2}}}%
81 \step{& of cells growing horizontally!\renewcommand{\tabend}{\\\hline}}%
82 \tabend
83 \end{tabular}%
84 }%
85 \end{center}%
86 }%
87 \newslide
88 \end{slide}
89 \end{document}
90 \endinput
91 %%
92 %% End of file `tabexample.tex'.