fix: use Arabic page numbers throughout Kits PDF

- Remove Roman numeral frontmatter/mainmatter switching
- Set Arabic page numbering in before-body-includes.tex
- Simplify chapter command to just reset footnote counter
- All pages now use regular numbers (1, 2, 3...) not (i, ii, iii...)
This commit is contained in:
Vijay Janapa Reddi
2025-12-28 12:06:02 -05:00
parent c9d0daf8d7
commit 6a1e477510
2 changed files with 16 additions and 36 deletions

View File

@@ -14,3 +14,12 @@
}
\let\endtitlepage\relax
% =============================================================================
% FORCE ARABIC PAGE NUMBERING FROM START
% =============================================================================
% Hardware Kits doesn't have a traditional frontmatter/mainmatter split,
% so we use Arabic numerals (1, 2, 3...) throughout the entire document.
\AtBeginDocument{
\pagenumbering{arabic}
}

View File

@@ -758,53 +758,24 @@ align=right,font={\fontsize{40pt}{40}\selectfont}]
% =============================================================================
% PAGE NUMBERING SYSTEM
% =============================================================================
% Implements traditional book numbering:
% - Roman numerals (i, ii, iii...) for frontmatter
% - Arabic numerals (1, 2, 3...) for mainmatter
% Automatically switches at first numbered chapter
% Hardware Kits uses Arabic numerals (1, 2, 3...) throughout the entire document.
% No frontmatter/mainmatter split - all content is practical lab material.
%
% Note: The \AtBeginDocument in before-body-includes.tex sets \pagenumbering{arabic}
% Reset footnote counter at each chapter
\makeatletter
\newif\if@firstnumbered%
\@firstnumberedtrue%
\newif\if@firstunnumbered%
\@firstunnumberedtrue%
\newcounter{lastRomanPage}
\setcounter{lastRomanPage}{1}
% Start document with Roman numerals (frontmatter)
\AtBeginDocument{
\pagenumbering{roman}
\renewcommand{\thepage}{\roman{page}}
}
% Intercept chapter command
\let\old@chapter\chapter%
\renewcommand{\chapter}{%
\@ifstar{\unnumbered@chapter}{\numbered@chapter}%
}
% Numbered chapters: switch to Arabic on first occurrence
\newcommand{\numbered@chapter}[1]{%
\if@firstnumbered%
\cleardoublepage%
\setcounter{lastRomanPage}{\value{page}}%
\pagenumbering{arabic}%
\@firstnumberedfalse%
\else
\setcounter{page}{\value{page}}%
\fi
\setcounter{sidenote}{1} % Reset footnote counter per chapter
\setcounter{sidenote}{1}
\old@chapter{#1}%
}
% Unnumbered chapters: stay in Roman numerals
\newcommand{\unnumbered@chapter}[1]{%
\if@firstunnumbered%
\clearpage
\setcounter{lastRomanPage}{\value{page}}%
\pagenumbering{roman}%
\@firstunnumberedfalse%
\fi
\setcounter{sidenote}{1}
\old@chapter*{#1}%
}