従来のマニュアルを再構築するために、Sphinxの機能を検討しています。私たちはすでに以前のマニュアルのほとんどをスフィンクスに移植しました。今私は会社スタイルを適応させる可能性を模索しています。Sphinxでラテックスのヘッダーとフッターをカスタマイズする
特に、PDFマニュアルでヘッダーとフッターの外観を変更したいと考えています。会社のロゴを含め、偶数ページと奇数ページの外観を変更します。
したがって、conf.py
には、fancyhdr
パッケージを使用してカスタムパグスタイルで次のプリアンブルが含まれています。
latex_elements = {
'preamble' : '''\
\\pagestyle{fancy}
\\fancyhf{}
\\fancyhead[LE,RO]{My Header}'''
}
残念ながら、begin{document}
前のみ変更ヘッダは、その後スフィンクススタイルsphinx.sty
ファイル何とか私の設定を上書きします。
sphinx.sty
から次のスニペットは、問題が発生することがあります:
% Redefine the 'normal' header/footer style when using "fancyhdr" package:
\[email protected]{fancyhf}{}{
% Use \pagestyle{normal} as the primary pagestyle for text.
\fancypagestyle{normal}{
\fancyhf{}
\fancyfoot[LE,RO]{{\[email protected]\thepage}}
\fancyfoot[LO]{{\[email protected]\nouppercase{\rightmark}}}
\fancyfoot[RE]{{\[email protected]\nouppercase{\leftmark}}}
\fancyhead[LE,RO]{{\[email protected] \@title, \[email protected]}}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
% define chaptermark with \@chappos when \@chappos is available for Japanese
\[email protected]{@chappos}{}
{\def\chaptermark##1{\markboth{\@chapapp\space\thechapter\space\@chappos\space ##1}{}}}
}
% Update the plain style so we get the page number & footer line,
% but not a chapter or section title. This is to keep the first
% page of a chapter and the blank page between chapters `clean.'
\fancypagestyle{plain}{
\fancyhf{}
\fancyfoot[LE,RO]{{\[email protected]\thepage}}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0.4pt}
}
}
可能な回避策がありますか?