mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Streamline obsolete color set-up in LaTeX style file
The file ``pdfcolor.tex`` included in tex distributions is for Plain pdfTeX, not for LaTeX use. Loading it complicates task of supporting multiple TeX engines. If needed all corresponding colour names are better available from passing to ``color`` or ``xcolor`` the ``dvipsnames`` option. It is better to leave responsability of using this option to Sphinx user, if needed. The macros for setting the color defined by ``pdfcolor.tex`` were never documented to Sphinx user, and they can not be used from reST apart from ``.. raw:: latex`` directive, they are for Plain TeX without use of ``color`` package. Thus, this commit drops loading this file and the complicated conditionals around it (``\ifsphinxpdfoutput``), which are also used in the class files ``sphinxmanual.cls``, ``sphinxhowto.cls``. Also, this fixes issue #2693.
This commit is contained in:
parent
73b8cf44cf
commit
4b2fff4e5e
@ -402,33 +402,15 @@
|
|||||||
|
|
||||||
%% COLOR (general)
|
%% COLOR (general)
|
||||||
%
|
%
|
||||||
% FIXME: the reasons might be obsolete (better color drivers now?)
|
% FIXME: \normalcolor should probably be used in place of \py@NormalColor
|
||||||
% use pdfoutput for pTeX and dvipdfmx
|
% elsewhere, and \py@NormalColor shoudl never be defined. \normalcolor
|
||||||
% when pTeX (\kanjiskip is defined), set pdfoutput to evade \include{pdfcolor}
|
% switches to the colour from last \color call in preamble.
|
||||||
\ifx\kanjiskip\undefined\else
|
\def\py@NormalColor{\color{black}}
|
||||||
\newcount\pdfoutput\pdfoutput=0
|
% FIXME: it is probably better to use \color{TitleColor}, as TitleColor
|
||||||
\fi
|
% can be customized from 'sphinxsetup', and drop usage of \py@TitleColor
|
||||||
|
\def\py@TitleColor{\color{TitleColor}}
|
||||||
% for PDF output, use colors and maximal compression
|
% FIXME: this line should be dropped, as "9" is default anyhow.
|
||||||
\newif\ifsphinxpdfoutput % used in \maketitle
|
\ifdefined\pdfcompresslevel\pdfcompresslevel = 9 \fi
|
||||||
\ifx\pdfoutput\undefined\else
|
|
||||||
\ifnum\pdfoutput=\z@
|
|
||||||
\let\py@NormalColor\relax
|
|
||||||
\let\py@TitleColor\relax
|
|
||||||
\else
|
|
||||||
\sphinxpdfoutputtrue
|
|
||||||
\input{pdfcolor}
|
|
||||||
\def\py@NormalColor{\color[rgb]{0.0,0.0,0.0}}
|
|
||||||
\def\py@TitleColor{\color{TitleColor}}
|
|
||||||
\pdfcompresslevel=9
|
|
||||||
\fi
|
|
||||||
\fi
|
|
||||||
|
|
||||||
% XeLaTeX can do colors, too
|
|
||||||
\ifx\XeTeXrevision\undefined\else
|
|
||||||
\def\py@NormalColor{\color[rgb]{0.0,0.0,0.0}}
|
|
||||||
\def\py@TitleColor{\color{TitleColor}}
|
|
||||||
\fi
|
|
||||||
|
|
||||||
|
|
||||||
%% PAGE STYLING
|
%% PAGE STYLING
|
||||||
|
@ -31,7 +31,8 @@
|
|||||||
%
|
%
|
||||||
\renewcommand{\maketitle}{%
|
\renewcommand{\maketitle}{%
|
||||||
\noindent\rule{\textwidth}{1pt}\newline\null\par
|
\noindent\rule{\textwidth}{1pt}\newline\null\par
|
||||||
\ifsphinxpdfoutput
|
% FIXME: use \hypersetup{pdfauthor={\@author}, pdftitle={\@title}}
|
||||||
|
\ifdefined\pdfinfo
|
||||||
\begingroup
|
\begingroup
|
||||||
% These \defs are required to deal with multi-line authors; it
|
% These \defs are required to deal with multi-line authors; it
|
||||||
% changes \\ to ', ' (comma-space), making it pass muster for
|
% changes \\ to ', ' (comma-space), making it pass muster for
|
||||||
|
@ -41,7 +41,8 @@
|
|||||||
\let\footnotesize\small
|
\let\footnotesize\small
|
||||||
\let\footnoterule\relax
|
\let\footnoterule\relax
|
||||||
\noindent\rule{\textwidth}{1pt}\newline\null\par
|
\noindent\rule{\textwidth}{1pt}\newline\null\par
|
||||||
\ifsphinxpdfoutput
|
% FIXME: use \hypersetup{pdfauthor={\@author}, pdftitle={\@title}}
|
||||||
|
\ifdefined\pdfinfo
|
||||||
\begingroup
|
\begingroup
|
||||||
% These \defs are required to deal with multi-line authors; it
|
% These \defs are required to deal with multi-line authors; it
|
||||||
% changes \\ to ', ' (comma-space), making it pass muster for
|
% changes \\ to ', ' (comma-space), making it pass muster for
|
||||||
|
Loading…
Reference in New Issue
Block a user