| 1 |
%% |
| 2 |
%% This is file `parexample.tex', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% texpower-doc.dtx (with options: `parexample,parexample-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{parexample.tex}% |
| 29 |
[2005/04/07 TeXPower example file] |
| 30 |
%----------------------------------------------------------------------------------------------------------------- |
| 31 |
% |
| 32 |
% Paragraph 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 paragraph example}} |
| 43 |
|
| 44 |
\usepackage{soul} |
| 45 |
|
| 46 |
|
| 47 |
%----------------------------------------------------------------------------------------------------------------- |
| 48 |
% Finally, everything is set up. Here we go... |
| 49 |
% |
| 50 |
\begin{document} |
| 51 |
\begin{slide} |
| 52 |
% |
| 53 |
%----------------------------------------------------------------------------------------------------------------- |
| 54 |
% |
| 55 |
\makeslidetitle{\macroname{stepwise} Example: Inside A Paragraph}\label{Sec:ExPar} |
| 56 |
|
| 57 |
% |
| 58 |
% We show that \stepwise can be used for highlighting words within a paragraph. |
| 59 |
% Furthermore, it is demonstrated how the order in which \step's are executed can be changed. |
| 60 |
% |
| 61 |
% We define a `placeholder' which will mark the place of missing words (instead of \displayphantom). |
| 62 |
% |
| 63 |
\newcommand{\placeholder}[1]{\leavevmode\phantom{#1}\llap{\rule{\widthof{\phantom{#1}}}{\fboxrule}}}% |
| 64 |
% |
| 65 |
% We use the custom command \parstepwise which not only wraps the whole argument of \stepwise into a minipage (because |
| 66 |
% otherwise vertical spacing goes haywire, don't ask me why), but also gives substance to steps. |
| 67 |
% |
| 68 |
% All variants of \stepwise take an optional argument the contents of which are executed inside a group before the |
| 69 |
% inner loop of starts. It can be used to set parameters locally. |
| 70 |
% Here, we redefine \activatestep (which has been explained in the equation example) to highlight the first |
| 71 |
% appearance of any word. |
| 72 |
% \hidestepcontents is used as a `wrapper' for those arguments of \step which should not appear yet. It either |
| 73 |
% displays nothing (this is the default for \stepwise and \liststepwise) or puts its argument into a \phantom |
| 74 |
% (the default for \parstepwise); this behaviour is also toggled by \boxedsteps and \nonboxedsteps. |
| 75 |
% Here, we redefine it to use our selfdefined \placeholder to mark `missing' words. |
| 76 |
% |
| 77 |
\parstepwise[\let\hidestepcontents=\placeholder\let\activatestep=\highlightboxed]% |
| 78 |
{% |
| 79 |
\begin{quote} |
| 80 |
\Huge We can \step{create} a \step{fill-in-the-blanks} |
| 81 |
% |
| 82 |
% \step takes an optional argument with which it can be specified _when_ its argument is to appear. This is |
| 83 |
% expressed in \ifthenelse syntax (see the documentation of the ifthen package). |
| 84 |
% Here, we refer to the counter step which is advanced by \stepwise and contains the number of the current step. |
| 85 |
% This way, steps can be made to appear in any order. |
| 86 |
\step[\value{step}=5]{text} which is then |
| 87 |
\step[\value{step}=4]{filled} in in |
| 88 |
\step[\value{step}=3]{\textbf{any}} order! |
| 89 |
\end{quote} |
| 90 |
}% |
| 91 |
|
| 92 |
\newslide |
| 93 |
|
| 94 |
% The \hidetext command hides its argument while respecting automatic line breaks and such. The command needs the soul |
| 95 |
% package to work. Read the documentation of soul for restrictions as to what can go in the argument of \hidetext. |
| 96 |
|
| 97 |
\stepwise[\let\hidestepcontents=\hidetext\let\activatestep=\highlighttext] |
| 98 |
{% |
| 99 |
\vspace*{\fill} |
| 100 |
\begin{minipage}{\linewidth} |
| 101 |
\begin{quote} |
| 102 |
\Huge We can step through a \step{paragraph} of \step{free text} |
| 103 |
\step{without disturbing} line breaks! |
| 104 |
\end{quote} |
| 105 |
\end{minipage} |
| 106 |
\vspace*{\fill}\vspace*{\fill} |
| 107 |
} |
| 108 |
\newslide |
| 109 |
\end{slide} |
| 110 |
\end{document} |
| 111 |
\endinput |
| 112 |
%% |
| 113 |
%% End of file `parexample.tex'. |