Add some header manipulation commands

This commit is contained in:
Jeff Lance 2019-11-02 10:53:42 +01:00
parent ed7d669b38
commit 903c983c40

View File

@ -57,6 +57,7 @@
\RequirePackage{pageslts} \RequirePackage{pageslts}
\RequirePackage{enumitem} \RequirePackage{enumitem}
\RequirePackage[]{hyperref} \RequirePackage[]{hyperref}
\RequirePackage{chngcntr}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -123,23 +124,47 @@
\ifthenelse{ \equal{\type}{activity} }{ \ifthenelse{ \equal{\type}{activity} }{
\IfNoValueTF{ \subtitle }{ \IfNoValueTF{ \subtitle }{
\cohead[\@title]{\@title} % \cohead[\@title]{\@title}
\rohead[Activité]{Activité} % \rohead[Activité]{Activité}
\cohead[]{\@title}
\rohead[]{Activité}
}{ }{
\cohead[\@title]{\@title} % \cohead[\@title]{\@title}
\rohead[Activité]{Activité - \@subtitle} % \rohead[Activité]{Activité - \@subtitle}
\cohead[]{\@title}
\rohead[]{Activité - \@subtitle}
} }
}{ }{
\ifthenelse{ \equal{\type}{exercise} }{ \ifthenelse{ \equal{\type}{exercise} }{
\cohead[\@title]{\@title} % \cohead[\@title]{\@title}
\rohead[Exercices]{Exercices} % \rohead[Exercices]{Exercices}
\IfNoValueTF{ \subtitle }{
\cohead[]{\@title}
\rohead[]{Exercices}
}{
\cohead[]{\@title}
\rohead[]{Exercices - \@subtitle}
}
}{
\ifthenelse{ \equal{\type}{auto} }{
% \cohead[\@title]{\@title}
% \rohead[Rappels]{Rappels - \@subtitle}
\cohead[]{\@title}
\rohead[]{Rappels - \@subtitle}
}{ }{
\rohead[Cours]{Cours - \@title} \rohead[Cours]{Cours - \@title}
} }
}
} }
\cofoot*{\thepage\ /\ \pageref{LastPage}} \pagenumbering{arabic}
%\ofoot*{\pagemark}% pagenumber in the outer footer with scrheadings and plain style
%\ohead[]{\headmark}% headmark only with scrheadings
\cofoot[\thepage\ /\ \pageref{LastPage}]{\thepage\ /\ \pageref{LastPage}}
\cefoot[\thepage\ /\ \pageref{LastPage}]{\thepage\ /\ \pageref{LastPage}}
%\clearpairofpagestyles% removes the default page header and footer entries
\pagestyle{scrheadings} \pagestyle{scrheadings}
\setkomafont{pagehead}{\normalfont\bfseries} \setkomafont{pagehead}{\normalfont\bfseries}
\setkomafont{pagefoot}{\normalfont} \setkomafont{pagefoot}{\normalfont}
@ -209,11 +234,42 @@
% %
% %
%% 1ere
\NewDocumentCommand{\classe}{ G{2nde} }{
\ifthenelse{ \equal{#1}{2nde} }{
\lohead[2\tup{nde}]{2\tup{nde}}
}{
\ifthenelse{ \equal{#1}{1gen} }{
\lohead[1\tup{ère}]{1\tup{ère}}
}{
\ifthenelse{ \equal{#1}{1stg} }{
\lohead[1\tup{ère}STMG]{1\tup{ère}STMG}
}{
\ifthenelse{ \equal{#1}{tes} }{
\lohead[T\tup{ale}ES]{T\tup{ale}ES}
}{
\lohead{}
}
}
}
}
}
%% page
%%
\NewDocumentCommand{\nextpage}{}{
\newpage
\thispagestyle{myheadings}
% \vspace{-1cm}
% \cofoot[\thepage\ /\ \pageref{LastPage}]{\thepage\ /\ \pageref{LastPage}}
% \cefoot[\thepage\ /\ \pageref{LastPage}]{\thepage\ /\ \pageref{LastPage}}
}
%% titre %% titre
%% %%
\NewDocumentCommand \titre { G{Titre} G{Sous-titre} }{% \NewDocumentCommand \titre { G{Titre} G{Sous-titre} G{} G{} }{%
\setlength{\droptitle}{-2cm} \setlength{\droptitle}{-2cm}
\title{#1} \title{\Jd #1}
\subtitle{#2} \subtitle{#2}
\date{} \date{}
\maketitle \maketitle