mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-03-11 17:49:25 -05:00
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:
@@ -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}
|
||||
}
|
||||
|
||||
@@ -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}%
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user