1%% PAGE STYLING 2% 3% change this info string if making any custom modification 4\ProvidesFile{sphinxlatexstylepage.sty}[2021/01/27 page styling] 5 6% Separate paragraphs by space by default. 7\IfFileExists{parskip-2001-04-09.sty}% since September 2018 TeXLive update 8% new parskip.sty, but let it rollback to old one. 9% hopefully TeX installation not broken and LaTeX kernel not too old 10 {\RequirePackage{parskip}[=v1]} 11% standard one from 1989. Admittedly \section of article/book gives possibly 12% anomalous spacing, but we can't require September 2018 release for some time. 13 {\RequirePackage{parskip}} 14 15% Style parameters and macros used by most documents here 16\raggedbottom 17\sloppy 18\hbadness = 5000 % don't print trivial gripes 19 20% Require package fancyhdr except under memoir class 21\@ifclassloaded{memoir}{}{\RequirePackage{fancyhdr}} 22% Use \pagestyle{normal} as the primary pagestyle for text. 23% Redefine the 'normal' header/footer style when using "fancyhdr" package: 24\@ifpackageloaded{fancyhdr}{% 25 \ltx@ifundefined{c@chapter} 26 {% no \chapter, "howto" (non-Japanese) docclass 27 \fancypagestyle{plain}{ 28 \fancyhf{} 29 \fancyfoot[C]{{\py@HeaderFamily\thepage}} 30 \renewcommand{\headrulewidth}{0pt} 31 \renewcommand{\footrulewidth}{0pt} 32 } 33 % Same as 'plain', this way we can use it in template 34 % FIXME: shouldn't this have a running header with Name and Release like 'manual'? 35 \fancypagestyle{normal}{ 36 \fancyhf{} 37 \fancyfoot[C]{{\py@HeaderFamily\thepage}} 38 \renewcommand{\headrulewidth}{0pt} 39 \renewcommand{\footrulewidth}{0pt} 40 } 41 }% 42 {% classes with \chapter command 43 \fancypagestyle{normal}{ 44 \fancyhf{} 45 \fancyfoot[RO]{{\py@HeaderFamily\thepage}} 46 \fancyfoot[LO]{{\py@HeaderFamily\nouppercase{\rightmark}}} 47 \fancyhead[RO]{{\py@HeaderFamily \@title\sphinxheadercomma\py@release}} 48 \if@twoside 49 \fancyfoot[LE]{{\py@HeaderFamily\thepage}} 50 \fancyfoot[RE]{{\py@HeaderFamily\nouppercase{\leftmark}}} 51 \fancyhead[LE]{{\py@HeaderFamily \@title\sphinxheadercomma\py@release}} 52 \fi 53 \renewcommand{\headrulewidth}{0.4pt} 54 \renewcommand{\footrulewidth}{0.4pt} 55 % define chaptermark with \@chappos when \@chappos is available for Japanese 56 \ltx@ifundefined{@chappos}{} 57 {\def\chaptermark##1{\markboth{\@chapapp\space\thechapter\space\@chappos\space ##1}{}}} 58 } 59 % Update the plain style so we get the page number & footer line, 60 % but not a chapter or section title. This is to keep the first 61 % page of a chapter `clean.' 62 \fancypagestyle{plain}{ 63 \fancyhf{} 64 \fancyfoot[RO]{{\py@HeaderFamily\thepage}} 65 \if@twoside\fancyfoot[LE]{{\py@HeaderFamily\thepage}}\fi 66 \renewcommand{\headrulewidth}{0pt} 67 \renewcommand{\footrulewidth}{0.4pt} 68 } 69 } 70 } 71 {% no fancyhdr: memoir class 72 % Provide default for 'normal' style simply as an alias of 'plain' style 73 % This way we can use \pagestyle{normal} in LaTeX template 74 \def\ps@normal{\ps@plain} 75 % Users of memoir class are invited to redefine 'normal' style in preamble 76 } 77 78 79\endinput 80