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