%%
%% This is file `renditions.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% renditions.dtx  (with options: `copyright,package')
%% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Renditions.sty package,            2010-1-29         %%
%% Copyright (C) 1999-2002  D. P. Story                 %%
%%   dpstory@uakron.edu                                 %%
%%                                                      %%
%% This program can redistributed and/or modified under %%
%% the terms of the LaTeX Project Public License        %%
%% Distributed from CTAN archives in directory          %%
%% macros/latex/base/lppl.txt; either version 1 of the  %%
%% License, or (at your option) any later version.      %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% History: Noel Vaillant began developing a better renditions.sty
%%   based on my earlier published renditions.sty. Many thanks
%%   to him for starting me off.
%%---------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}[1997/12/01]
\ProvidesPackage{rendition}
 [2010/01/29 v0.1 rendition: Package for creating multiple renditions from the same source (dps)]
\RequirePackage{xkeyval}
\DeclareOptionX{max}{\def\ren@numberOf{#1}}
\def\ren@numberOf{3}
\DeclareOptionX{rendition}{\def\thisrendition{#1}}
\def\thisrendition{1}
\InputIfFileExists{rendition.cfg}{}{}
\ProcessOptionsX
\RequirePackage{comment}
\let\save@message\message\let\message\@gobble
\@tempcnta=0
\@whilenum\@tempcnta<\ren@numberOf\do{%
    \@tempcntb=\@tempcnta\advance\@tempcntb1
    \edef\temp@exp{\noexpand\excludecomment{rendition\the\@tempcntb}}%
    \temp@exp
    \expandafter\let\csname Afterver\the\@tempcntb Comment\endcsname\relax
    \advance\@tempcnta1
}\let\message\save@message
\AtBeginDocument{\includecomment{rendition\thisrendition}}
\def\rendition#1{\def\thisrendition{#1}%
    \ifnum\thisrendition>\ren@numberOf
        \@tempcnta=\thisrendition
        \@tempcntb=\@tempcnta
        \advance\@tempcnta-1 \divide\@tempcnta\ren@numberOf
             \multiply\@tempcnta\ren@numberOf
             \advance\@tempcntb-\@tempcnta
        \edef\thisrendition{\the\@tempcntb}%
        \typeout{Modular arithmetic applied: ren=\thisrendition}%
    \fi
}
\@onlypreamble{\rendition}
\expandafter\rendition\expandafter{\thisrendition}
\endinput
%%
%% End of file `renditions.sty'.
