\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{tesis}[2004/02/14  {C. Viviescas}]

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
\ProcessOptions
\LoadClass{book}

\renewcommand{\ps@headings}{%
  \renewcommand{\@oddfoot}{}
  \renewcommand{\@evenfoot}{}
  \renewcommand{\@oddhead}{\small{\hfil\rightmark\hspace{7mm}\thepage}}
  \renewcommand{\@evenhead}{\small{\thepage\hspace{7mm}\leftmark\hfil}}
  \let\@mkboth\markboth
    \def\chaptermark##1{%
      \markboth {%
        \ifnum \c@secnumdepth >\m@ne
          \if@mainmatter
            \thechapter. \ %
          \fi
        \fi
        ##1}{}}%
  \def\sectionmark##1{%
      \markright {%
        \ifnum \c@secnumdepth >\z@
          \thesection \ %
        \fi
        ##1}}
}

\pagestyle{headings}