Corrige les headers/footers pour toutes les classes

This commit is contained in:
Gregory Trolliet 2023-10-03 21:29:31 +02:00
parent 2f817283db
commit f3b5317e9c

View file

@ -509,7 +509,12 @@ $if(abstract)$
$endif$
% Allow to access the total number of pages
\usepackage{lastpage}
\usepackage{pageslts}
%\pagenumbering{arabic}
% Define the page numbering to roman numbers
\newcommand{\lastpageofpart}{\lastpageref*{pagesLTS.arabic}}
% Allow to generate text from Lorem Ipsum
\usepackage{lipsum}
@ -519,30 +524,36 @@ $endif$
\usepackage{fancyhdr}
\pagestyle{fancy}
$if(date)$
\fancyhead[LO,RE]{\date{$date$}}
\fancyhead[LO,RE]{$date$}
$else$
\fancyhead[LO,RE]{\date{\today}}
\fancyhead[LO,RE]{\today}
$endif$
$if(header)$
\fancyhead[CO,CE]{$header$}
$endif$
$if(version)$
\fancyhead[RO,LE]{v$version$}
\fancyhead[RO,LE]{$header$}
$endif$
\fancyfoot[LO,RE]{$footer$}
\fancyfoot[CE,CO]{$title$}
% Total page without link (because of the * on pageref)
\fancyfoot[RO,LE]{\thepage / \pageref*{LastPage}}
% Flush right (raggedleft) on even pages
\fancyfoot[LO]{\begin{minipage}[t]{3cm}$if(license)$$license$\\$endif$$author$\end{minipage}}
\fancyfoot[RE]{\begin{minipage}[t]{3cm}\raggedleft{}$if(license)$$license$\\$endif$$author$\end{minipage}}
\fancyfoot[CE,CO]{$if(title)$$title$$endif$ $if(title)$$if(version)$--$endif$$endif$ $if(version)$v$version$$endif$}
\fancyfoot[RO,LE]{Page \thepage{}/\lastpageofpart}
\fancypagestyle{firstpage}{%
\fancyhead{}%
\renewcommand{\headrulewidth}{0pt}%
}
\fancypagestyle{plain}{%
\fancyhead{}%
\renewcommand{\headrulewidth}{0pt}%
}
\begin{document}
$if(has-frontmatter)$
\renewcommand{\lastpageofpart}{\lastpageref*{pagesLTS.roman}}
\pagenumbering{roman}
\frontmatter
$else$
\pagenumbering{arabic}
$endif$
$if(title)$
$if(beamer)$
@ -594,6 +605,9 @@ $if(linestretch)$
$endif$
$if(has-frontmatter)$
\mainmatter
% Define the page numbering to arabic numbers
\renewcommand{\lastpageofpart}{\lastpageref*{pagesLTS.arabic}}
\pagenumbering{arabic}
\thispagestyle{fancy}
$endif$