% The house layer of The Rhythm of Primes, after the GAI-MUA papers (00 campaign/styles/rs-header.tex): leading, % colours, running heads, the title block, parts and headings, the theorem environments, the Lean anchors, the % references list. Article form after the Annals of Mathematics: parts, sections numbered through the paper, % statements numbered within sections, proofs ending with a square. \linespread{1.06} \setlength{\parskip}{0pt} \setlength{\emergencystretch}{3em} % an overfull line is a gate failure: stretch, never overrun \clubpenalty=10000 \widowpenalty=10000 \displaywidowpenalty=10000 \setcounter{tocdepth}{1} % the contents list parts and sections; the bookmarks keep the subsections \AtBeginDocument{\urlstyle{same}} \numberwithin{equation}{section} \definecolor{rpteal}{HTML}{0B5F63} % the darkest teal of the AURORA scale (7.0 : 1 on white) \definecolor{rprule}{HTML}{A7C2C5} \definecolor{rpgrey}{HTML}{4A575B} \hypersetup{colorlinks=true,linkcolor=rpteal,citecolor=rpteal,urlcolor=rpteal,filecolor=rpteal, bookmarksdepth=3,pdfstartview=FitH} % Running heads: the author on left-hand pages, the short title on right-hand pages, the folio outside. \pagestyle{fancy} \fancyhf{} \renewcommand{\headrulewidth}{0pt} \fancyhead[CE]{\footnotesize\scshape\RPauthor} \fancyhead[CO]{\footnotesize\itshape\RPshorttitle} \fancyhead[LE,RO]{\footnotesize\thepage} \fancypagestyle{rpfirst}{\fancyhf{}\fancyfoot[C]{\footnotesize\thepage}} \fancypagestyle{rppart}{\fancyhf{}} \makeatletter % amsart restores \topskip from \normaltopskip when it sets a page style (OpenShurik, 11-19): set both. \setlength{\normaltopskip}{10pt plus 1pt}\setlength{\topskip}{\normaltopskip} % ---- the title block --------------------------------------------------------------------------------------------- % Above: version and date on the left, DOI (once assigned) and licence on the right, a hairline beneath. Then title, % subtitle, author, one line with affiliation, e-mail and ORCID iD; then the abstract, MSC and keywords at 85 % of % the measure. \newcommand{\RPmaketitle}[1]{% \thispagestyle{rpfirst}% \begingroup\parindent\z@ \vspace*{-6mm}% {\footnotesize\color{rpgrey}\RPversion\enspace\textperiodcentered\enspace\RPdate\hfill \ifx\RPdoi\@empty\else\href{https://doi.org/\RPdoi}{doi:\RPdoi}\enspace\textperiodcentered\enspace\fi \href{https://creativecommons.org/licenses/by/4.0/}{\RPlicence}\par}% \vspace{1.4mm}{\color{rprule}\hrule height .4pt}% \vspace{12mm}% \begin{center} {\fontsize{17.28}{21.5}\selectfont\bfseries\RPtitle\par}% \vspace{2.8mm}% {\fontsize{12}{15.2}\selectfont\itshape\RPsubtitle\par}% \vspace{6.5mm}% {\normalsize\scshape\RPauthor\par}% \vspace{1.4mm}% {\footnotesize\href{\RPaffiliationurl}{\RPaffiliation}\enspace\textperiodcentered\enspace \href{mailto:\RPemail}{\RPemail}\enspace\textperiodcentered\enspace\url{\RPorcid}\par}% \end{center} \vspace{5.5mm}% {\leftskip .075\textwidth \rightskip .075\textwidth \fontsize{9.5}{12.4}\selectfont{\scshape Abstract.}\enspace\ignorespaces #1\par \vspace{2.4mm}% \footnotesize\textit{2020 Mathematics Subject Classification.}\enspace\RPmsc.\par \vspace{.4mm}% \textit{Key words and phrases.}\enspace\RPkeywords.\par}% \vspace{7mm}% \endgroup} % ---- parts and headings -------------------------------------------------------------------------------------------- % A part has a page of its own (layout gate L1): its number in small capitals, its name, and the summary that the % part's introduction expands, between two short hairlines. Sections are numbered through the paper. \newcounter{rppart} \renewcommand{\therppart}{\Roman{rppart}} \newcommand{\RPpart}[2]{% #1 label, #2 the name \clearpage\thispagestyle{rppart}% \refstepcounter{rppart}\label{#1}% \phantomsection\addcontentsline{toc}{part}{Part~\therppart.\texorpdfstring{\quad}{ } #2}% \vspace*{.28\textheight}% \begin{center} {\color{rprule}\rule{.28\textwidth}{.4pt}}\par\vspace{3.2mm}% {\small\scshape\color{rpteal}Part \therppart}\par\vspace{1.6mm}% {\fontsize{15}{18.5}\selectfont\bfseries #2\par}\vspace{3.4mm}% {\color{rprule}\rule{.28\textwidth}{.4pt}}\par \end{center} \clearpage} \def\@secnumfont{\bfseries} \def\section{\@startsection{section}{1}{\z@}{1.75\linespacing\@plus.4\linespacing\@minus.2\linespacing}% {.7\linespacing}{\normalfont\fontsize{12.5}{15}\selectfont\bfseries\raggedright}} \def\subsection{\@startsection{subsection}{2}{\z@}{1.15\linespacing\@plus.3\linespacing\@minus.1\linespacing}% {.4\linespacing}{\normalfont\normalsize\bfseries\raggedright}} \def\subsubsection{\@startsection{subsubsection}{3}{\z@}{.8\linespacing\@plus.3\linespacing}% {-.6em}{\normalfont\normalsize\itshape}} % A heading keeps at least three lines of its text on its page (layout gate P2): a section asks for room for its % heading and four lines, a subsection for its heading and three (with the space above them), or starts the next page. \let\rp@section\section\let\rp@subsection\subsection \renewcommand{\section}{\par\Needspace{8\baselineskip}\rp@section} \renewcommand{\subsection}{\par\Needspace{7\baselineskip}\rp@subsection} % The appendices open on a page of their own, like the parts (layout gate P0). \newcommand{\RPappendices}{% \clearpage\thispagestyle{rppart}% \pdfbookmark[0]{Appendices}{appendices}% % a bookmark only: the contents list the appendices themselves \addtocontents{toc}{\protect\addvspace{.6em}}% \vspace*{.28\textheight}% \begin{center} {\color{rprule}\rule{.28\textwidth}{.4pt}}\par\vspace{3.2mm}% {\fontsize{15}{18.5}\selectfont\bfseries Appendices\par}\vspace{3.4mm}% {\color{rprule}\rule{.28\textwidth}{.4pt}}\par \end{center} \clearpage} % Contents: parts in small capitals, sections with their page numbers. % The contents are set in the small size, as in the Annals, so that they end on a well-filled page. \let\rp@tableofcontents\tableofcontents \renewcommand{\tableofcontents}{{\small\linespread{1}\selectfont\rp@tableofcontents}} \def\l@part#1#2{\addpenalty{-\@highpenalty}\vskip .6em\@plus.2em {\noindent\scshape #1\hfill\upshape #2\par}\nobreak} % ---- statements ---------------------------------------------------------------------------------------------------- % Theorems, propositions, lemmas and corollaries in italics; definitions, remarks, notation and examples upright. % One counter for all, within the section ("Theorem 7.3"). The main theorems of the introduction are lettered. \newtheoremstyle{rpplain}{.9\baselineskip}{.9\baselineskip}{\itshape}{}{\bfseries}{.}{.5em} {\thmname{#1}\thmnumber{ #2}\thmnote{\ (\mdseries #3)}} \newtheoremstyle{rpdefinition}{.9\baselineskip}{.9\baselineskip}{\normalfont}{}{\bfseries}{.}{.5em} {\thmname{#1}\thmnumber{ #2}\thmnote{\ (\mdseries #3)}} \newtheoremstyle{rpremark}{.6\baselineskip}{.6\baselineskip}{\normalfont}{}{\itshape}{.}{.5em} {\thmname{#1}\thmnumber{ #2}\thmnote{\ (#3)}} % Each environment that shares the counter has an alias counter (aliascnt), so that hyperref and % cleveref see its own name ("Lemma 4.5"), not that of the shared counter. \newcommand{\RPsharedthm}[2]{\newaliascnt{#1}{theorem}\newtheorem{#1}[#1]{#2}\aliascntresetthe{#1}} \theoremstyle{rpplain} \newtheorem{theorem}{Theorem}[section] \RPsharedthm{proposition}{Proposition} \RPsharedthm{lemma}{Lemma} \RPsharedthm{corollary}{Corollary} \newtheorem{mainthm}{Theorem} \renewcommand{\themainthm}{\Alph{mainthm}} \newtheorem*{theorem*}{Theorem} \theoremstyle{rpdefinition} \RPsharedthm{definition}{Definition} \RPsharedthm{hypothesis}{Hypothesis} \RPsharedthm{construction}{Construction} \theoremstyle{rpremark} \RPsharedthm{remark}{Remark} \RPsharedthm{notation}{Notation} \RPsharedthm{example}{Example} % ---- Lean anchors -------------------------------------------------------------------------------------------------- % \lean{New.grh} (several names separated by commas) ties the statement in which it stands to the declarations of the % Lean development that prove it. Nothing is printed in the text; the anchors are written, with the number and the % page of the statement, to \jobname.lnk, from which Appendix C is set and against which the anchor and coverage % gates check the rebuilt Lean environment. % The anchor follows the statement, outside its group, so the number of the last statement is kept % globally at the end of each statement environment (an equation inside it has ended by then). \newwrite\rp@lnk \AtBeginDocument{\immediate\openout\rp@lnk=\jobname.lnk\relax} \def\rp@laststmt{}\def\rp@lastkind{} % An anchor that stands in running text (a definition in a paragraph after the last statement) belongs to the % subsection, not to that statement: a new paragraph after a statement clears the flag (LaTeX para hooks). \newif\ifrp@afterstmt \newcommand{\rp@track}[2]{\AddToHook{env/#1/end}{\xdef\rp@laststmt{\@currentlabel}\gdef\rp@lastkind{#2}% \global\rp@afterstmttrue}} \AddToHook{para/begin}{\global\rp@afterstmtfalse} \def\rp@here{\ifnum\c@subsection>\z@ \thesubsection\else\thesection\fi} \rp@track{theorem}{Theorem}\rp@track{proposition}{Proposition}\rp@track{lemma}{Lemma} \rp@track{corollary}{Corollary}\rp@track{mainthm}{Theorem}\rp@track{definition}{Definition} \rp@track{hypothesis}{Hypothesis}\rp@track{construction}{Construction}\rp@track{remark}{Remark} % \lean[eq:key]{names} anchors a numbered display (or a definition in running text) instead. \newcommand{\lean}[2][]{\ifx\relax#1\relax \ifrp@afterstmt \protected@write\rp@lnk{}{\string\RPleanrow{\rp@lastkind}{\rp@laststmt}{\thepage}{\detokenize{#2}}}% \else \protected@write\rp@lnk{}{\string\RPleanrow{Text}{\rp@here}{\thepage}{\detokenize{#2}}}% \fi \else \protected@write\rp@lnk{}{\string\RPleanrowref{#1}{\thepage}{\detokenize{#2}}}% \fi\ignorespaces} % Appendix C: one row per anchored statement; the names break after each comma. tools/build.py % rewrites main.lnk into main.lnk.prev with the characters of Lean names made safe for pdfTeX. \newcommand{\RPleanrow}[4]{#1~#2 & #3 & \RPleannames{#4}\\} \newcommand{\RPleanrowref}[3]{Display~\eqref{#1} & #2 & \RPleannames{#3}\\} \newcommand{\RPleanrowcont}[1]{ & & \RPleannames{#1}\\} % continuation of a long row (tools/build.py) \newcommand{\RPleannames}[1]{{\footnotesize\ttfamily\RP@names#1,\@nil}} \def\RP@names#1,#2\@nil{#1\ifx\relax#2\relax\else,\allowbreak\ \RP@names#2\@nil\fi} % The rows are read into a token list first: \input cannot stand inside an alignment. \newtoks\rp@rows \newread\rp@in \newcommand{\RPleantable}{\IfFileExists{\jobname.lnk.prev}{% \global\rp@rows{}% \openin\rp@in=\jobname.lnk.prev\relax \begingroup\endlinechar=-1 \loop\unless\ifeof\rp@in \read\rp@in to\rp@line \ifx\rp@line\@empty\else\global\rp@rows\expandafter{\the\expandafter\rp@rows\rp@line}\fi \repeat \endgroup\closein\rp@in \begin{longtable}{@{}l r >{\raggedright\arraybackslash}p{.66\textwidth}@{}}\toprule Statement & Page & Lean declarations\\\midrule\endhead \the\rp@rows\bottomrule\end{longtable}}{}} % Appendix C as printed (D12): one row per section, read from generated/lean-summary.tex, which tools/build.py writes from % the anchors and the section labels of the previous pass; the full table above goes to out/supplement. % A section: number, title, page, statements, declarations; then its module folders across the full measure. \newcommand{\RPleansumrow}[5]{#1 & #2 & #3 & #4 & #5\\*} \newcommand{\RPleansumfolders}[1]{\multicolumn{5}{@{\hspace{1.6em}}>{\raggedright\arraybackslash}p{\dimexpr\linewidth-1.6em\relax}@{}}{\footnotesize\ttfamily\hyphenchar\font=-1 #1}\\[1pt]} \newcommand{\RPleansummary}{\IfFileExists{generated/lean-summary.tex}{% \global\rp@rows{}% \openin\rp@in=generated/lean-summary.tex\relax \begingroup\endlinechar=-1 \loop\unless\ifeof\rp@in \read\rp@in to\rp@line \ifx\rp@line\@empty\else\global\rp@rows\expandafter{\the\expandafter\rp@rows\rp@line}\fi \repeat \endgroup\closein\rp@in \begin{longtable}{@{}l >{\raggedright\arraybackslash}p{.66\textwidth} r r r@{}}\toprule \S & Section and Lean module folders & Page & Stat. & Decl.\\\midrule\endhead \the\rp@rows\bottomrule\end{longtable}}{}} % ---- references ---------------------------------------------------------------------------------------------------- % tools/refs.py writes generated/references.tex from ledger/refs.yaml, one \bibitem per verified entry. \renewcommand{\bibliofont}{\small\raggedright} % ragged, as in the GAI-MUA papers: DOIs and URLs do not stretch lines \makeatother \newcommand{\RPepigraph}[2]{% \begin{flushright}\begin{minipage}{0.78\textwidth}\raggedleft\itshape #1\par\smallskip \normalfont\small #2\end{minipage}\end{flushright}\bigskip} \endinput