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