diff options
author | Karl Berry <karl@freefriends.org> | 2007-05-22 17:41:52 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-05-22 17:41:52 +0000 |
commit | 14af3f447439750920f754792b89f113d019076a (patch) | |
tree | d49286b2215d2211333ae7b9a890e2f6ea120b84 /Master/texmf-dist/tex/latex/texpower/tplists.sty | |
parent | 9619856eb2ef82ce64ea935233a8a8c64791c616 (diff) |
texpower update
git-svn-id: svn://tug.org/texlive/trunk@4334 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/texpower/tplists.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/texpower/tplists.sty | 213 |
1 files changed, 71 insertions, 142 deletions
diff --git a/Master/texmf-dist/tex/latex/texpower/tplists.sty b/Master/texmf-dist/tex/latex/texpower/tplists.sty index 8b9212b7102..b27c575d933 100644 --- a/Master/texmf-dist/tex/latex/texpower/tplists.sty +++ b/Master/texmf-dist/tex/latex/texpower/tplists.sty @@ -4,11 +4,12 @@ %% %% The original source files were: %% -%% texpower-addons.dtx (with options: `tplists') +%% tplists.dtx (with options: `tplists') %% %% -------------------------------------------------------------- %% TeXPower bundle - dynamic online presentations with LaTeX %% Copyright (C) 1999-2004 Stephan Lehmke +%% Copyright (C) 2003-2005 Hans Fredrik Nordhaug %% %% This program is free software; you can redistribute it and/or %% modify it under the terms of the GNU General Public License @@ -24,111 +25,38 @@ %% The list of all files belonging to the TeXPower bundle is %% given in the file `00readme.txt'. %% -% =============================================================================== -% File: tplists.sty -% -% Function: The package provides dynamic lists. The following -% environments/lists are available -% 1) 'stepenum', 'stepitem', 'stepeqlist', 'stepcompactenum' -% 'stepcompactitem' and 'stepcompacteqlist'. -% 2) 'flipenum', 'flipitem', 'flipeqlist', 'flipcompactenum', -% 'flipcompactitem', and 'flipcompacteqlist' -% 3) 'dimenum', 'dimitem', 'dimeqlist', 'dimcompactenum', -% 'dimcompactitem', and 'dimcompacteqlist' -% where 'step' is short for stepped, 'flip' for flipped and -% 'dim' for dimmed. The packages 'paralist' and 'eqlist' -% must be loaded before this package to use the *eqlist and -% *compact* lists. -% -% Usage: The package is loaded in the normal fashion, eg: -% \usepackage{tplists} -% The following options exist: -% pausestep - makes step* lists use \pause -% The package works better (the lists look better) if TeXPower -% uses colors. -% -% All lists (except *eqlist) takes an optional parameter -% adding to the indent of the list. Note that dim* and -% flip* lists do not nest, and that step* lists inside -% dim*/flip* will behave as a dim*/flip* list respectively. -% -% Example: -% -% \documentclass[a4paper]{article} -% \usepackage[darkbackground,display]{texpower} -% \usepackage{tplists} -% \begin{document} -% \begin{flipitem}[2cm] -% \item Before -% \begin{enumerate}[1cm] -% \item An item -% \item Another item -% \end{enumerate} -% \item After -% \end{flipitem} -% \end{document} -% -% (The normal 'itemize' and 'enumerate' lists are modified -% so they accept the optional parameter and work nested -% with the new lists.) -% -% Issues: The step* lists use \vstep (as default) which give weird results with -% structured backgrounds. Using the pausestep option fixes this, but then -% you can't nest step* lists inside dim* or flip* lists. -% There are also some unresolved problems when using french babel. -% -% History: 2003/10/03 v0.1: -% * first public release -% 2003/10/04 v0.1a: -% * removed redefinition of eqlist (since it doesn't work) -% 2003/10/07 v0.1b: -% * corrected some typos in this documentation -% * added option pausestep -% * made dim* (and all variants of flip*) lists work without -% colors by using boldface for active items. -% - +%% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{tplists}% - [2003/10/07 v0.1b Dynamic Lists using TeXPower] - -%% Packages +\ProvidesPackage{tplists} + [2005/04/07 v0.2 Easy Dynamic Lists using TeXPower] \RequirePackage{texpower} -% Compact enum/item. \newboolean{tpl@paralist} \@ifpackageloaded{paralist}{\setboolean{tpl@paralist}{true}}{} -% Lists with equal indentation. \newboolean{tpl@eqlist} \@ifpackageloaded{eqlist}{\setboolean{tpl@eqlist}{true}}{} - -%% Options -% Use \pause for steplists (too avoid problems with structured backgrounds). \newboolean{tpl@pausestep} \DeclareOption{pausestep}{\setboolean{tpl@pausestep}{true}} +\newboolean{tpl@noflipendstep} +\DeclareOption{noflipendstep}{\setboolean{tpl@noflipendstep}{true}} \ProcessOptions - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% Flipped/dimmed/stepped itemize/enumerate/eqlist environment. % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% '\iftpl@instepenv' indicates if we are in some kind of stepped list -% environment. '\iftpl@indimenv' / '\tpl@inflipenv' indicates that we are -% using one of the stepwise environments from texpower (that doesn't -% nest). '\iftpl@inpausestepenv' indicates that we are in a stepped -% list that uses \pause. - -% using 'tpl@' as prefix for internals. +\define@key{tpl}{pausestep}[true]{% + \setboolean{tpl@pausestep}{#1} +} +\define@key{tpl}{noflipendstep}[true]{% + \setboolean{tpl@noflipendstep}{#1} +} +\newcommand*{\tplsetup}{\setkeys{tpl}} \newif\iftpl@instepenv \tpl@instepenvfalse \newif\iftpl@inpausestepenv \tpl@inpausestepenvfalse \newif\iftpl@indimenv \tpl@indimenvfalse \newif\iftpl@inflipenv \tpl@inflipenvfalse \let\oldenumerate=\enumerate \let\olditemize=\itemize +\let\olddescription=\description \let\endoldenumerate=\endenumerate \let\endolditemize=\enditemize +\let\endolddescription=\enddescription \ifthenelse{\boolean{tpl@eqlist}}{% \let\oldeqlist=\eqlist \let\endoldeqlist=\endeqlist @@ -139,10 +67,6 @@ \let\endoldcompactenum=\endcompactenum \let\endoldcompactitem=\endcompactitem }{} - -%%% Defining \tpl@collect@body - command used to scan the list -%%% environments. Definition borrowed from 'amsmath.sty' - slightly -%%% modified to allow for 'long' arguments \let\tpl@nx\noexpand \let\tpl@xp\expandafter \newtoks\tpl@emptytoks @@ -171,56 +95,57 @@ \fi \tpl@process@envbody } - -%%% Defining command '\tpl@addmargin' used to add a length to -%%% the leftmargin of the current level in a list. \def\tpl@addmargin#1{% \advance\@listdepth 1 \addtolength{\csname leftmargin\romannumeral\@listdepth\endcsname}{#1} \advance\@listdepth -1 } -%%% Defining a flipped step command. +\ifthenelse{\boolean{display}}{% \ifthenelse{\boolean{TPcolor}}% Can we use colors? {% Yes. In this case highlighting is implemented by switching color. - \def\tpl@flipstep% Note that \tpl@flipstep takes no argument. - {% + \def\tpl@flipstep{% \step{\ifthenelse{\boolean{firstactivation}}% {\color{textcolor}}% {\color{inactivecolor}}% }% - }% + }% } {% No. In this case highlighting is implemented by putting the item in boldface. - \def\tpl@flipstep - {% - \step{\ifthenelse{\boolean{firstactivation}}% - {\bfseries}{\mdseries}} - }% - } - -%%% Defining a dimmed step command. + \def\tpl@flipstep{% + \step{\ifthenelse{\boolean{firstactivation}}{\bfseries}{\mdseries}} + }% +} \ifthenelse{\boolean{TPcolor}}% Can we use colors? {% Yes. In this case highlighting is implemented by using \dstep - \def\tpl@dimstep% Note that \tpl@flipstep takes no argument. - {% - \dstep - }% + \def\tpl@dimstep{\dstep}% } {% No. In this case highlighting is implemented by putting the item in boldface. - \def\tpl@dimstep - {% - \step{\bfseries} + \def\tpl@dimstep{% + \step{\bfseries}% \ifthenelse{\boolean{active}}{}{\mdseries}% - }% - } - -%%% Defining flipped stepped - itemize / enumerate / eqlist -%%% compact itemize / compact enumerate / compact eqlist - environments. + }% +} +\ifthenelse{\boolean{TPcolor}}% Can we use colors? +{% Yes. In this case stepping is implemented by using \vstep + \def\tpl@step{\vstep}% +} +{% No. In this case stepping is implemented using \pause + \def\tpl@step{\pause}% +} +}{% \boolean{display} is false +\def\tpl@flipstep{\relax}% +\def\tpl@dimstep{\relax}% +\def\tpl@step{\relax}% +} \newenvironment{flipitem}[1][0cm]{% \tpl@addmargin{#1} \tpl@collect@body\@flipitem}% {\global\@ignoretrue} +\newenvironment{flipdesc}[1][0cm]{% + \tpl@addmargin{#1} + \tpl@collect@body\@flipdesc}% + {\global\@ignoretrue} \newenvironment{flipenum}[1][0cm]{% \tpl@addmargin{#1} \tpl@collect@body\@flipenum}% @@ -267,13 +192,15 @@ \tpl@inflipenvtrue \renewcommand{\item}{\tpl@flipstep\tpl@origitem}% #2 - \step{} + \ifthenelse{\boolean{tpl@noflipendstep}}{}{\step{}}% \end{#1}} \fi\fi } \newcommand\@flipitem[1]{% \@fliplist{olditemize}{#1}} +\newcommand\@flipdesc[1]{% + \@fliplist{olddescription}{#1}} \newcommand\@flipenum[1]{% \@fliplist{oldenumerate}{#1}} \ifthenelse{\boolean{tpl@eqlist}}{% @@ -288,13 +215,14 @@ \newcommand\@flipcompactenum[1]{% \@fliplist{oldcompactenum}{#1}} }{} - -%%% Defining dimmed stepped - itemize / enumerate / eqlist / -%%% compact itemize / compact enumerate / compact eqlist - environments. \newenvironment{dimitem}[1][0cm]{% \tpl@addmargin{#1} \tpl@collect@body\@dimitem}% {\global\@ignoretrue} +\newenvironment{dimdesc}[1][0cm]{% + \tpl@addmargin{#1} + \tpl@collect@body\@dimdesc}% + {\global\@ignoretrue} \newenvironment{dimenum}[1][0cm]{% \tpl@addmargin{#1} \tpl@collect@body\@dimenum}% @@ -346,6 +274,8 @@ \newcommand\@dimitem[1]{% \@dimlist{olditemize}{#1}} +\newcommand\@dimdesc[1]{% + \@dimlist{olddescription}{#1}} \newcommand\@dimenum[1]{% \@dimlist{oldenumerate}{#1}} \ifthenelse{\boolean{tpl@eqlist}}{% @@ -360,13 +290,14 @@ \newcommand\@dimcompactenum[1]{% \@dimlist{oldcompactenum}{#1}} }{} - -%%% Defining stepped - itemize / enumerate / eqlist / -%%% compact itemize / compact enumerate / compact eqlist - environments. \newenvironment{stepitem}[1][0cm]{% \tpl@addmargin{#1} \tpl@collect@body\@stepitem}% {\global\@ignoretrue} +\newenvironment{stepdesc}[1][0cm]{% + \tpl@addmargin{#1} + \tpl@collect@body\@stepdesc}% + {\global\@ignoretrue} \newenvironment{stepenum}[1][0cm]{% \tpl@addmargin{#1} \tpl@collect@body\@stepenum}% @@ -389,10 +320,8 @@ \tpl@collect@body\@stepcompactenum}% {\global\@ignoretrue} }{} - -\ifthenelse{\boolean{tpl@pausestep}}{% -% Using \pause for step* lists \newcommand\@steplist[2]{% +\ifthenelse{\boolean{tpl@pausestep}}{% \iftpl@inflipenv \PackageError{tplists}{% flip* followed by step* environment does NOT work \MessageBreak @@ -413,10 +342,7 @@ #2 \end{#1} \fi\fi -} }{ -% Using \liststepwise for step* lists -\newcommand\@steplist[2]{% \iftpl@inflipenv \begin{#1} \renewcommand{\item}{\tpl@flipstep\tpl@origitem} @@ -429,7 +355,7 @@ \end{#1}% \else\iftpl@instepenv \begin{#1} - \renewcommand{\item}{\vstep\tpl@origitem}% + \renewcommand{\item}{\tpl@step\tpl@origitem}% #2 \end{#1}% \else @@ -437,7 +363,7 @@ \begin{#1} \iftpl@instepenv\else\let\tpl@origitem=\item\fi \tpl@instepenvtrue - \renewcommand{\item}{\vstep\tpl@origitem}% + \renewcommand{\item}{\tpl@step\tpl@origitem}% #2 \end{#1}} \fi\fi\fi @@ -446,6 +372,8 @@ \newcommand\@stepitem[1]{% \@steplist{olditemize}{#1}} +\newcommand\@stepdesc[1]{% + \@steplist{olddescription}{#1}} \newcommand\@stepenum[1]{% \@steplist{oldenumerate}{#1}} \ifthenelse{\boolean{tpl@eqlist}}{% @@ -460,16 +388,10 @@ \newcommand\@stepcompactenum[1]{% \@steplist{oldcompactenum}{#1}} }{} - -%%% Defining compact eqlist \newenvironment{compacteqlist}[1][0cm]{% % \tpl@addmargin{#1} \begin{eqlist}[\parsep0pt\itemsep0pt]}% {\end{eqlist}} - - -%%% Redefining enumerate and itemize to handle changes made by -%%% introducing steps and leftmargini-option. \renewenvironment{enumerate}[1][0cm]{% \tpl@addmargin{#1} \begin{oldenumerate} @@ -488,8 +410,14 @@ }% {\end{olditemize}} -%%% Redefining compactenum and compactitem to handle changes made by -%%% introducing steps and leftmargini-option. +\renewenvironment{description}[1][0cm]{% + % \tpl@addmargin{#1} % Has no effect - FIXME + \begin{olddescription} + \iftpl@instepenv + \renewcommand{\item}{\tpl@origitem}% + \fi + }% + {\end{olddescription}} \ifthenelse{\boolean{tpl@paralist}}{% \renewenvironment{compactenum}[1][0cm]{% \tpl@addmargin{#1} @@ -509,6 +437,7 @@ }% {\end{oldcompactitem}} }{} + \endinput %% %% End of file `tplists.sty'. |