- Add custom header/footer.

- Add option to generate files optimized for either print or electronic reading.
This commit is contained in:
Silcantar
2025-08-17 22:29:41 -05:00
parent 9610ecec59
commit c914902f59
10 changed files with 165 additions and 91 deletions

49
packages/Header.sty Normal file
View File

@@ -0,0 +1,49 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{PrimeTeX/packages/Header}[2025-08-16]
% Header & Footer Options
\RequirePackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\newlength{\outsideheaderoffset}
\setlength{\outsideheaderoffset}{1.0in}
\newlength{\insideheaderoffset}
\setlength{\insideheaderoffset}{0.5in}
\newcommand{\parttitle}{}
\renewcommand{\chaptermark}[1]{ \markboth{#1}{} }
\fancypagestyle{fancy}{
\ifthenelse{\boolean{isElectronic}}{
\fancyhfoffset[L]{\insideheaderoffset}
\fancyhfoffset[R]{\outsideheaderoffset}
\fancyhead[L]{\partname{} \thepart{}: \parttitle}
\fancyhead[R]{\chaptername{} \thechapter{}: \leftmark}
\fancyfoot[R]{\thepage}
}{
\fancyhfoffset[LE,RO]{\outsideheaderoffset}
\fancyhead[LE]{\partname{} \thepart{}: \parttitle}
\fancyhead[RO]{\chaptername{} \thechapter{}: \leftmark}
\fancyfoot[LE,RO]{\thepage}
}
}
\fancypagestyle{plain}{ %
\fancyhf{} % remove everything
\renewcommand{\headrulewidth}{0pt} % remove lines as well
\renewcommand{\footrulewidth}{0pt}
\ifthenelse{\boolean{isElectronic}}{
\fancyfoot[R]{\thepage}
}{
\fancyfoot[LE,RO]{\thepage}
}
}