<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">%%
%% This is file `schooldocs.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% schooldocs.dtx  (with options: `package')
%% 
%% This is a generated file.
%% 
%% Copyright (C) 2020-2025 by Antoine Missier &lt;antoine.missier@ac-toulouse.fr&gt;
%% 
%% This file 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.
%% 
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesPackage{schooldocs}
    [2025/01/15 v1.6 Layout styles for school documents]
\@ifpackageloaded{geometry}{}{\RequirePackage{geometry}}
\let\footruleskip\relax % because the memoir class uses it
\RequirePackage{fancyhdr}
\RequirePackage{ifthen}
\RequirePackage{totpages} % lastpage nowadays incompatible with hyperref
\RequirePackage{fancybox}
\RequirePackage{xcolor}
\RequirePackage{translations}

\geometry{scale=0.75,vmarginratio=3:4,heightrounded}

\DeclareTranslationFallback{schooldocs-pagename}{page}
\DeclareTranslationFallback{schooldocs-correct}{Correct version}
\DeclareTranslationFallback{schooldocs-name}{Name:}

\DeclareTranslation{english}{schooldocs-pagename}{page}
\DeclareTranslation{english}{schooldocs-correct}{Correct version}
\DeclareTranslation{english}{schooldocs-name}{Name:}

\DeclareTranslation{french}{schooldocs-pagename}{page}
\DeclareTranslation{french}{schooldocs-correct}{Corrigé}
\DeclareTranslation{french}{schooldocs-name}{Nom :}

\DeclareTranslation{german}{schooldocs-pagename}{Seite}
\DeclareTranslation{german}{schooldocs-correct}{Musterlösung}
\DeclareTranslation{german}{schooldocs-name}{Name:}

\DeclareTranslation{spanish}{schooldocs-pagename}{página}
\DeclareTranslation{spanish}{schooldocs-correct}{Correccion}
\DeclareTranslation{spanish}{schooldocs-name}{Apellido:}

\DeclareTranslation{italian}{schooldocs-pagename}{pagina}
\DeclareTranslation{italian}{schooldocs-correct}{Corretto}
\DeclareTranslation{italian}{schooldocs-name}{Nome:}

\DeclareTranslation{portuges}{schooldocs-pagename}{página}
\DeclareTranslation{portuges}{schooldocs-correct}{Corrigiu}
\DeclareTranslation{portuges}{schooldocs-name}{Nome:}

\newcommand*\pagename{\GetTranslation{schooldocs-pagename}}
\newcommand*\correctname{\GetTranslation{schooldocs-correct}}
\newcommand*\identityname{\GetTranslation{schooldocs-name}}


\renewcommand{\title}[2][]{\long\def\@title{#2}
    \ifthenelse{\equal{#1}{}}{\def\@headtitle{#2}}{\def\@headtitle{#1}}
    \ifx\@onlypreamble\@notprerr\else
        \@ifpackageloaded{hyperref}%
            {\hypersetup{pdftitle={\@headtitle}}}{}
    \fi
}
\title{}
\author{}

\newcommand\school[1]{\long\def\@school{#1}
    \ifx\@onlypreamble\@notprerr\else
        \@ifpackageloaded{hyperref}{
            \hypersetup{pdfauthor={\@author\ (\@school)}}}{}
    \fi
}
\school{}
\newcommand{\institute}{\school}

\let\subject\relax
\newcommand{\subject}[2][]{\long\def\@subject{#2}
    \ifthenelse{\equal{#1}{}}%
        {\def\@headsubject{#2}}{\def\@headsubject{#1}}
    \ifx\@onlypreamble\@notprerr\else
        \@ifpackageloaded{hyperref}%
            {\hypersetup{pdfsubject={\@headsubject}}}{}
    \fi
}
\def\@subject{}
\def\@headsubject{}
\definecolor{titlecolor}{named}{black}
\newcommand{\titlestyle}{\LARGE\bfseries}
\newcommand{\subjectstyle}{\large}
\newcommand{\datestyle}{\large}
\newcommand{\smalltitledatestyle}{\large\slshape}
\newcommand{\titleflush}{center}
\newlength{\titletopskip} \setlength{\titletopskip}{-1.32cm}
\newlength{\smalltitletopskip} \setlength{\smalltitletopskip}{-1.32cm}
\newlength{\titlesep} \setlength{\titlesep}{2\medskipamount}
\newlength{\titlebottomskip} \setlength{\titlebottomskip}{\medskipamount}
\newlength{\seprulewidth} \setlength{\seprulewidth}{0.3pt}
\newlength{\seprulelength} \setlength{\seprulelength}{2.5cm}

\newcommand{\boxedshape}[1]{%
    \color{gray} % no effect
    \setlength{\fboxsep}{4.5pt}
    \setlength{\shadowsize}{3pt}
    \shadowbox{\quad\textcolor{titlecolor}{\rule{0pt}{2ex}#1}\quad}
}

\definecolor{headingcolor}{named}{black}
\newcommand{\headstyle}{\small\color{headingcolor}}
\newcommand{\footstyle}{\small\color{headingcolor}}
\newcommand{\headtitlestyle}{\scshape}
\newcommand{\headsubjectstyle}{\scshape}
\newcommand{\schoolstyle}{\scshape}
\newcommand{\headdatestyle}{\textnormal}
\newcommand{\authorstyle}{\textnormal}
\newcommand{\pagenamestyle}{\textnormal}
\setlength{\headheight}{\baselineskip}
\renewcommand{\headrule}{\ifthenelse{\thepage=1}%
    {\vspace{-2ex}\rule{\headwidth}{0pt}}%
    {\vspace{-2ex}\rule{\headwidth}{\headrulewidth}}
}

\newcommand{\schooldocstitles}{
    \renewcommand{\maketitle}[1][\seprulelength]{
        \newpage\mbox{}\par\vspace{\titletopskip}
        \begin{\titleflush}
            {\color{titlecolor}
            {\titlestyle{\@title}}
            \ifx\@subject\@empty\else
                \par\vspace{\titlesep}\subjectstyle\@subject
            \fi
            \ifthenelse{\equal{\@date}{}}{}{%
                \par\vspace{0.5\titlesep} \datestyle\@date}
            \par\vspace{0.5\titlesep}
            }
            \ifthenelse{\lengthtest{##1&gt;0cm}}{\rule{##1}{\seprulewidth}}{}
        \end{\titleflush}
        \vspace{\titlebottomskip}
    }

    \let\makesmalltitle\relax
    \newcommand{\makesmalltitle}{
        \newpage\mbox{}\par\vspace{\smalltitletopskip}
        \begin{center}
            {\color{titlecolor}
            {\titlestyle{\@title}}
            \hfill \subjectstyle\@subject
            \ifthenelse{\equal{\@date}{}}{}{%
                \enskip --\enskip \smalltitledatestyle\@date}
            }
            \rule{\linewidth}{\seprulewidth}
        \end{center}
        \vspace{\titlebottomskip}
    }

    \let\correct\relax
    \newcommand\correct{%
        \let\@originalheadtitle\@headtitle
        \def\@headtitle{\@originalheadtitle ~--~\correctname}
        \ifx\@onlypreamble\@notprerr\else
            \@ifpackageloaded{hyperref}{%
                \AtBeginDocument{\hypersetup{pdftitle={\@headtitle}}}}{}
        \fi
        \let\@originaltitle\@title
        \def\@title{\@originaltitle ~--~\correctname}
    }
}
\schooldocstitles

\newcommand{\seprule}[1][\seprulelength]{\begin{center}
    \raisebox{0.25\baselineskip}{\rule{#1}{\seprulewidth}}\end{center}}

\fancypagestyle{classic}{%
    \renewcommand{\headrulewidth}{0pt}
    \addtolength{\headheight}{\baselineskip}
    \lhead{\headstyle\ifthenelse{\thepage=1}{\schoolstyle\@school\mbox{}\\
        \headsubjectstyle\@subject}{\headtitlestyle\@headtitle} }
    \rhead{\headstyle\ifthenelse{\thepage=1}{\authorstyle\@author\mbox{}\\
        \headdatestyle\@date}{\headsubjectstyle\@headsubject}}
    \cfoot{\footstyle \thepage /\pageref{TotPages}}
    \setlength{\titletopskip}{-0.67cm}
    \renewcommand{\maketitle}[1][\seprulelength]{%
        \newpage\mbox{}\par\vspace{\titletopskip}
        \begin{\titleflush}
            {\color{titlecolor}\titlestyle{\@title}}
            \par\vspace{0.5\titlesep}
            \ifthenelse{\lengthtest{##1&gt;0cm}}{\rule{##1}{\seprulewidth}}{}
        \end{\titleflush}
        \vspace{\titlebottomskip}
    }
    \renewcommand{\makesmalltitle}{
        \newpage\mbox{}\par\vspace{\smalltitletopskip}
        \begin{center}
            {\color{titlecolor}
            {\titlestyle{\@title}}
            \hfill \subjectstyle\@subject
            }
            \rule{\linewidth}{\seprulewidth}
        \end{center}
        \vspace{\titlebottomskip}
    }
}

\fancypagestyle{elegant}{%
    \renewcommand{\headrulewidth}{0pt}
    \lhead{\headstyle
        \ifthenelse{\thepage=1}{}{\headtitlestyle\@headtitle}}
    \rhead{\headstyle
        \ifthenelse{\thepage=1}{}{%
        \pagenamestyle\pagename~\thepage /\pageref{TotPages}}}
    \lfoot{\ifthenelse{\thepage=1}{\footstyle\schoolstyle\@school}{}}
    \cfoot{}
    \rfoot{\ifthenelse{\thepage=1}{\footstyle\authorstyle\@author}{}}
}

\fancypagestyle{modern}{%
    \lhead{\headstyle
        \ifthenelse{\thepage=1}{}{\headtitlestyle\@headtitle}}
    \rhead{\headstyle
        \ifthenelse{\thepage=1}{}{\headsubjectstyle\@headsubject}}
    \lfoot{\ifthenelse{\thepage=1}{\footstyle\schoolstyle\@school}{}}
    \cfoot{\ifthenelse{\thepage=1}{}{
        \footstyle\thepage /\pageref{TotPages}}}
    \rfoot{\footstyle\ifthenelse{\thepage=1}{%
        \authorstyle\@author
        \ifx\@author\empty\else\\ \fi
        \headdatestyle\@date\ignorespaces}{}
    }
    \renewcommand{\maketitle}[1][\seprulelength]{%
        \newpage\mbox{}\par\vspace{\titletopskip}
        \begin{\titleflush}
            {\color{titlecolor}
            {\titlestyle{\@title}}
            \ifx\@subject\@empty\else
                \par\vspace{\titlesep}\subjectstyle\@subject
            \fi
            \par\vspace{0.5\titlesep}
            }
            \ifthenelse{\lengthtest{##1&gt;0cm}}{\rule{##1}{\seprulewidth}}{}
        \end{\titleflush}
        \vspace{\titlebottomskip}
    }
    \renewcommand{\makesmalltitle}{
        \newpage\mbox{}\par\vspace{\smalltitletopskip}
        \begin{center}
            {\color{titlecolor}
            {\titlestyle{\@title}}
            \hfill \subjectstyle\@subject
            }
            \rule{\linewidth}{\seprulewidth}
        \end{center}
        \vspace{\titlebottomskip}
    }
}

\fancypagestyle{soft}{%
    \lhead{\headstyle
        \ifthenelse{\thepage=1}{}{\headtitlestyle\@headtitle}}
    \rhead{\headstyle
        \ifthenelse{\thepage=1}{}{%
        \pagenamestyle\pagename~\thepage /\pageref{TotPages}}}
    \lfoot{\footstyle{\schoolstyle\@school}
        \ifthenelse{\thepage=1}{\ifx\@author\empty\else\\ \fi
            \authorstyle\@author}{}
    }
    \cfoot{}
    \rfoot{\footstyle{\headsubjectstyle\@headsubject}
        \ifthenelse{\thepage=1}{\ifx\@date\empty\else\\ \fi
            \headdatestyle\@date\ignorespaces}{}
    }
    \setlength{\titletopskip}{-0.67cm}
    \renewcommand{\maketitle}[1][\seprulelength]{%
        \newpage\mbox{}\par\vspace{\titletopskip}
        \begin{\titleflush}
            {\color{titlecolor}\titlestyle{\@title}}
            \par\vspace{0.5\titlesep}
            \ifthenelse{\lengthtest{##1&gt;0cm}}{\rule{##1}{\seprulewidth}}{}
        \end{\titleflush}
        \vspace{\titlebottomskip}
    }
    \renewcommand{\makesmalltitle}{
        \newpage\mbox{}\par\vspace{\smalltitletopskip}
        \begin{center}
            {\color{titlecolor}
            {\titlestyle{\@title}}
            \hfill \mbox{}
            }
            \rule{\linewidth}{\seprulewidth}
        \end{center}
        \vspace{\titlebottomskip}
    }
}

\fancypagestyle{identity}{%
    \lhead{\headstyle\headtitlestyle \identityname}
    \chead{}
    \rhead{}
    }

\fancypagestyle{exam}{%
    \let\subtitle\relax % because KOMA-Script uses it
    \newcommand\subtitle[1]{\long\def\@subtitle{##1}}
    \subtitle{}
    \lhead{\headstyle
        \ifthenelse{\thepage=1}{}{\headtitlestyle{\@headtitle}}}
    \rhead{\headstyle
        \ifthenelse{\thepage=1}{}{\headsubjectstyle\@headsubject}}
    \lfoot{\footstyle
        \authorstyle\@author
        \ifx\@author\empty\else\\ \fi
        \schoolstyle\@school
    }
    \cfoot{}
    \rfoot{\footstyle \pagenamestyle\pagename~\thepage/\pageref{TotPages}}
    \setlength{\titletopskip}{0.67cm}
    \setlength{\titlesep}{2\bigskipamount}
    \renewcommand{\titlestyle}{\LARGE\MakeUppercase}
    \renewcommand{\subjectstyle}{\Large\bfseries}
    \let\subtitlestyle\relax
    \newcommand{\subtitlestyle}{\large\slshape}
    \let\titlecorrectstyle\relax
    \newcommand*{\titlecorrectstyle}{\color{red}\large\scshape}
    \renewcommand\correct{%
        \let\@originalheadtitle\@headtitle
        \def\@headtitle{\@originalheadtitle ~--~\correctname}
        \ifx\@onlypreamble\@notprerr\else
            \@ifpackageloaded{hyperref}{%
                \AtBeginDocument{\hypersetup{pdftitle={\@headtitle}}}}{}
        \fi
        \renewcommand{\subtitlestyle}{\titlecorrectstyle}
        \subtitle{\correctname}
    }
    \renewcommand{\maketitle}[1][\seprulelength]{%
        \newpage\mbox{}\par\vspace{\titletopskip}
        \begin{center}
            {\color{titlecolor}
            {\titlestyle{\@title}}
            \par\vspace{\titlesep}{\subjectstyle \@subject}
            \par\vspace{\titlesep}
            \ifthenelse{\equal{\@date}{}}{}{%
                \datestyle\@date\par\vspace{0.5\titlesep}}
            \ifthenelse{\equal{\@subtitle}{}}{}{%
                \subtitlestyle\@subtitle\par\vspace{0.5\titlesep}
            }
            }
            \ifthenelse{\lengthtest{##1&gt;0cm}}{\rule{##1}{\seprulewidth}}{}
        \end{center}
        \vspace{\titlebottomskip}
    }
}

\fancypagestyle{collection}{%
    \lhead{\headstyle\headtitlestyle\@headtitle}
    \ifx\@onlypreamble\@notprerr
        \renewcommand{\sectionmark}[1]{\markboth{##1}{}}
    \else
        \AtBeginDocument{\renewcommand{\sectionmark}[1]{\markboth{##1}{}}}
    \fi
    \rhead{\headstyle\headsubjectstyle\leftmark} %\@section
    \lfoot{\footstyle\schoolstyle \@school}
    \cfoot{}
    \rfoot{\footstyle\thepage}
    \setlength{\titletopskip}{0.67cm}
    \setlength{\titlesep}{2\bigskipamount}
    \renewcommand{\titlestyle}{\LARGE\MakeUppercase}
    \renewcommand{\subjectstyle}{\Large\bfseries}
    \renewcommand{\authorstyle}{\Large}
    \renewcommand{\datestyle}{\Large}
    \renewcommand{\maketitle}[1][\seprulelength]{%
        \thispagestyle{empty}
        \newpage\mbox{}\par\vspace{\titletopskip}
        \begin{center}
            {\color{titlecolor}
            {\titlestyle{\@title}}
            \par\vspace{\titlesep} {\subjectstyle{\@subject}}
            \par\vspace{\titlesep}
            \ifx\@author\empty
            \else \authorstyle
                \begin{tabular}[t]{c}\@author\end{tabular}
                \ifx\@school\empty\else\par\vspace{1ex} \@school\fi
                \par\vspace{0.5\titlesep}
            \fi
            \ifthenelse{\equal{\@date}{}}{}{%
                \datestyle\@date \par\vspace{0.5\titlesep}}
            }
            \ifthenelse{\lengthtest{##1&gt;0cm}}{\rule{##1}{\seprulewidth}}{}
        \end{center}
        \vspace{\titlebottomskip}
    }
}
\endinput
%%
%% End of file `schooldocs.sty'.
</pre></body></html>