%%
%% This is file `count1to.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% count1to.dtx  (with options: `package')
%% 
%% Copyright (c) 1994..2009 by Martin Schroeder. All rights reserved.
%% 
%% This file is part of the Count1to package
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%% 
%% This work has the LPPL maintenance status `maintained'.
%% 
%% The Current Maintainer of this work is Martin Schroeder.
%% 
%% This work consists of the files count1to.dtx and count1to.ins
%% and the derived file count1to.sty.
%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{count1to}
        [2009/05/24 v2.1 Count1to9 Package (MS)]
%% \CharacterTable
%% {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%  Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%  Digits        \0\1\2\3\4\5\6\7\8\9
%%  Exclamation   \!     Double quote  \"     Hash (number) \#
%%  Dollar        \$     Percent       \%     Ampersand     \&
%%  Acute accent  \'     Left paren    \(     Right paren   \)
%%  Asterisk      \*     Plus          \+     Comma         \,
%%  Minus         \-     Point         \.     Solidus       \/
%%  Colon         \:     Semicolon     \;     Less than     \<
%%  Equals        \=     Greater than  \>     Question mark \?
%%  Commercial at \@     Left bracket  \[     Backslash     \\
%%  Right bracket \]     Circumflex    \^     Underscore    \_
%%  Grave accent  \`     Left brace    \{     Vertical bar  \|
%%  Right brace   \}     Tilde         \~}
%%
%% \iffalse meta-comment
%% ===================================================================
%%  @LaTeX-style-file{
%%     author          = {Martin Schr\"oder},
%%     version         = "2.1",
%%     date            = "24 May 2009",
%%     filename        = "count1to.sty",
%%     address         = {Martin Schr\"oder
%%                        Barmer Stra\"se 14
%%                        44137 Dortmund
%%                        Germany}
%%     telephone       = "+49-231-1206574",
%%     email           = "martin@oneiros.de",
%%     docstring       = "LaTeX package which sets count1 to count9,
%%                        which can be used to select certain pages
%%                        with a driver.
%%                        Also provides access to the number of pages
%%                        of the document.
%%                        Uses the everyshi package."
%%  }
%% ===================================================================
%% \fi
\RequirePackage{everyshi}[1994/12/09]
\newif\if@have@part
\newif\if@have@chapter
\newif\if@have@section
\newif\if@have@subsection
\newif\if@have@subsubsection
\newif\if@have@paragraph
\newif\if@have@subparagraph
\newcommand*{\@countItoIX@ifs}{
   \@ifundefined{c@part}           {}{\@have@parttrue}
   \@ifundefined{c@chapter}        {}{\@have@chaptertrue}
   \@ifundefined{c@section}        {}{\@have@sectiontrue}
   \@ifundefined{c@subsection}     {}{\@have@subsectiontrue}
   \@ifundefined{c@subsubsection}  {}{\@have@subsubsectiontrue}
   \@ifundefined{c@paragraph}      {}{\@have@paragraphtrue}
   \@ifundefined{c@subparagraph}   {}{\@have@subparagraphtrue}
   }
\newcommand*{\@countItoIX@bugfix}{
   \if@have@part
      \@addtoreset{section}      {part}
      \@addtoreset{subsection}   {part}
      \@addtoreset{subsubsection}{part}
      \@addtoreset{paragraph}    {part}
      \@addtoreset{subparagraph} {part}
   \fi
   \if@have@chapter
      \@addtoreset{subsection}   {chapter}
      \@addtoreset{subsubsection}{chapter}
      \@addtoreset{paragraph}    {chapter}
      \@addtoreset{subparagraph} {chapter}
   \fi
   \if@have@section
      \@addtoreset{subsubsection}{section}
      \@addtoreset{paragraph}    {section}
      \@addtoreset{subparagraph} {section}
   \fi
   \if@have@subsection
      \@addtoreset{paragraph}    {subsection}
      \@addtoreset{subparagraph} {subsection}
   \fi
   \if@have@subsubsection
      \@addtoreset{subparagraph} {subsubsection}
   \fi
   }
\newcommand*{\@countItoIX@init}{%
   \message{ABD: Count1to9 initializing macros}%
   \@countItoIX@ifs\let\@countItoIX@ifs\undefined
   \@countItoIX@bugfix\let\@countItoIX@bugfix\undefined
   }
\AtBeginDocument{\@countItoIX@init}
\newcommand*{\@countItoIX@shipout}{
   \global\advance \count1 by 1
   \if@have@part              \count2\value{part}           \fi
   \if@have@chapter           \count3\value{chapter}        \fi
   \if@have@section           \count4\value{section}        \fi
   \if@have@subsection        \count5\value{subsection}     \fi
   \if@have@subsubsection     \count6\value{subsubsection}  \fi
   \if@have@paragraph         \count7\value{paragraph}      \fi
   \if@have@subparagraph      \count8\value{subparagraph}   \fi
   \ifodd\count1\count9=1     \else\count9=0                \fi
   }
\EveryShipout{\@countItoIX@shipout}
\endinput
%%
%% End of file `count1to.sty'.
