|
6 | 6 | % |
7 | 7 |
|
8 | 8 | \NeedsTeXFormat{LaTeX2e}[1995/12/01] |
9 | | -\ProvidesPackage{sphinx}[2018/07/18 v1.8 LaTeX package (Sphinx markup)] |
| 9 | +\ProvidesPackage{sphinx}[2018/09/18 v1.8.1 LaTeX package (Sphinx markup)] |
10 | 10 |
|
11 | 11 | % provides \ltx@ifundefined |
12 | 12 | % (many packages load ltxcmds: graphicx does for pdftex and lualatex but |
|
499 | 499 | \sloppy |
500 | 500 | \hbadness = 5000 % don't print trivial gripes |
501 | 501 |
|
502 | | -\pagestyle{empty} % start this way |
503 | | - |
| 502 | +% Use \pagestyle{normal} as the primary pagestyle for text. |
504 | 503 | % Redefine the 'normal' header/footer style when using "fancyhdr" package: |
505 | | -% Note: this presupposes "twoside". If "oneside" class option, there will be warnings. |
506 | | -\ltx@ifundefined{fancyhf}{}{ |
507 | | - % Use \pagestyle{normal} as the primary pagestyle for text. |
508 | | - \fancypagestyle{normal}{ |
| 504 | +\@ifpackageloaded{fancyhdr}{% |
| 505 | + \ltx@ifundefined{c@chapter} |
| 506 | + {% no \chapter, "howto" (non-Japanese) docclass |
| 507 | + \fancypagestyle{plain}{ |
| 508 | + \fancyhf{} |
| 509 | + \fancyfoot[C]{{\py@HeaderFamily\thepage}} |
| 510 | + \renewcommand{\headrulewidth}{0pt} |
| 511 | + \renewcommand{\footrulewidth}{0pt} |
| 512 | + } |
| 513 | + % Same as 'plain', this way we can use it in template |
| 514 | + % FIXME: shouldn't this have a running header with Name and Release like 'manual'? |
| 515 | + \fancypagestyle{normal}{ |
| 516 | + \fancyhf{} |
| 517 | + \fancyfoot[C]{{\py@HeaderFamily\thepage}} |
| 518 | + \renewcommand{\headrulewidth}{0pt} |
| 519 | + \renewcommand{\footrulewidth}{0pt} |
| 520 | + } |
| 521 | + }% |
| 522 | + {% classes with \chapter command |
| 523 | + \fancypagestyle{normal}{ |
509 | 524 | \fancyhf{} |
510 | | -% (for \py@HeaderFamily cf "TITLES") |
| 525 | + % FIXME: this presupposes "twoside". |
| 526 | + % If "oneside" class option, there are warnings in LaTeX log. |
511 | 527 | \fancyfoot[LE,RO]{{\py@HeaderFamily\thepage}} |
512 | 528 | \fancyfoot[LO]{{\py@HeaderFamily\nouppercase{\rightmark}}} |
513 | 529 | \fancyfoot[RE]{{\py@HeaderFamily\nouppercase{\leftmark}}} |
|
517 | 533 | % define chaptermark with \@chappos when \@chappos is available for Japanese |
518 | 534 | \ltx@ifundefined{@chappos}{} |
519 | 535 | {\def\chaptermark##1{\markboth{\@chapapp\space\thechapter\space\@chappos\space ##1}{}}} |
520 | | - } |
| 536 | + } |
521 | 537 | % Update the plain style so we get the page number & footer line, |
522 | 538 | % but not a chapter or section title. This is to keep the first |
523 | 539 | % page of a chapter and the blank page between chapters `clean.' |
524 | | - \fancypagestyle{plain}{ |
| 540 | + \fancypagestyle{plain}{ |
525 | 541 | \fancyhf{} |
526 | 542 | \fancyfoot[LE,RO]{{\py@HeaderFamily\thepage}} |
527 | 543 | \renewcommand{\headrulewidth}{0pt} |
528 | 544 | \renewcommand{\footrulewidth}{0.4pt} |
| 545 | + } |
| 546 | + } |
| 547 | + } |
| 548 | + {% no fancyhdr: memoir class |
| 549 | + % Provide default for 'normal' style simply as an alias of 'plain' style |
| 550 | + % This way we can use \pagestyle{normal} in LaTeX template |
| 551 | + \def\ps@normal{\ps@plain} |
| 552 | + % Users of memoir class are invited to redefine 'normal' style in preamble |
529 | 553 | } |
530 | | -} |
531 | 554 |
|
532 | 555 | % geometry |
533 | 556 | \ifx\kanjiskip\@undefined |
|
0 commit comments