mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #3481 from jfbu/spx@ifundefined
Remove now unneeded internal LaTeX macro as TL2013's one is OK
This commit is contained in:
commit
a4d1fb7dec
@ -6,28 +6,19 @@
|
|||||||
%
|
%
|
||||||
|
|
||||||
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
|
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
|
||||||
\ProvidesPackage{sphinx}[2017/02/18 v1.6 LaTeX package (Sphinx markup)]
|
\ProvidesPackage{sphinx}[2017/02/28 v1.6 LaTeX package (Sphinx markup)]
|
||||||
|
|
||||||
% this is the \ltx@ifundefined of ltxcmds.sty, which is loaded by
|
% provides \ltx@ifundefined
|
||||||
% kvoptions (and later by hyperref), but the first release of
|
% (many packages load ltxcmds: graphicx does for pdftex and lualatex but
|
||||||
% ltxcmds.sty as in TL2009/Debian has wrong definition.
|
% not xelatex, and anyhow kvoptions does, but it may be needed in future to
|
||||||
\newcommand{\spx@ifundefined}[1]{%
|
% use \sphinxdeprecationwarning earlier, and it needs \ltx@ifundefined)
|
||||||
\ifcsname #1\endcsname
|
\RequirePackage{ltxcmds}
|
||||||
\expandafter\ifx\csname #1\endcsname\relax
|
|
||||||
\expandafter\expandafter\expandafter\@firstoftwo
|
|
||||||
\else
|
|
||||||
\expandafter\expandafter\expandafter\@secondoftwo
|
|
||||||
\fi
|
|
||||||
\else
|
|
||||||
\expandafter\@firstoftwo
|
|
||||||
\fi
|
|
||||||
}
|
|
||||||
|
|
||||||
%% for deprecation warnings
|
%% for deprecation warnings
|
||||||
\newcommand\sphinxdeprecationwarning[4]{% #1 the deprecated macro or name,
|
\newcommand\sphinxdeprecationwarning[4]{% #1 the deprecated macro or name,
|
||||||
% #2 = version when deprecated, #3 = version when removed, #4 = message
|
% #2 = version when deprecated, #3 = version when removed, #4 = message
|
||||||
\edef\spx@tempa{\detokenize{#1}}%
|
\edef\spx@tempa{\detokenize{#1}}%
|
||||||
\spx@ifundefined{sphinx_depr_\spx@tempa}{%
|
\ltx@ifundefined{sphinx_depr_\spx@tempa}{%
|
||||||
\global\expandafter\let\csname sphinx_depr_\spx@tempa\endcsname\spx@tempa
|
\global\expandafter\let\csname sphinx_depr_\spx@tempa\endcsname\spx@tempa
|
||||||
\expandafter\AtEndDocument\expandafter{\expandafter\let\expandafter
|
\expandafter\AtEndDocument\expandafter{\expandafter\let\expandafter
|
||||||
\sphinxdeprecatedmacro\csname sphinx_depr_\spx@tempa\endcsname
|
\sphinxdeprecatedmacro\csname sphinx_depr_\spx@tempa\endcsname
|
||||||
@ -243,7 +234,7 @@
|
|||||||
\newcommand{\py@HeaderFamily}{\spx@opt@HeaderFamily}
|
\newcommand{\py@HeaderFamily}{\spx@opt@HeaderFamily}
|
||||||
|
|
||||||
% Redefine the 'normal' header/footer style when using "fancyhdr" package:
|
% Redefine the 'normal' header/footer style when using "fancyhdr" package:
|
||||||
\spx@ifundefined{fancyhf}{}{
|
\ltx@ifundefined{fancyhf}{}{
|
||||||
% Use \pagestyle{normal} as the primary pagestyle for text.
|
% Use \pagestyle{normal} as the primary pagestyle for text.
|
||||||
\fancypagestyle{normal}{
|
\fancypagestyle{normal}{
|
||||||
\fancyhf{}
|
\fancyhf{}
|
||||||
@ -254,7 +245,7 @@
|
|||||||
\renewcommand{\headrulewidth}{0.4pt}
|
\renewcommand{\headrulewidth}{0.4pt}
|
||||||
\renewcommand{\footrulewidth}{0.4pt}
|
\renewcommand{\footrulewidth}{0.4pt}
|
||||||
% define chaptermark with \@chappos when \@chappos is available for Japanese
|
% define chaptermark with \@chappos when \@chappos is available for Japanese
|
||||||
\spx@ifundefined{@chappos}{}
|
\ltx@ifundefined{@chappos}{}
|
||||||
{\def\chaptermark##1{\markboth{\@chapapp\space\thechapter\space\@chappos\space ##1}{}}}
|
{\def\chaptermark##1{\markboth{\@chapapp\space\thechapter\space\@chappos\space ##1}{}}}
|
||||||
}
|
}
|
||||||
% Update the plain style so we get the page number & footer line,
|
% Update the plain style so we get the page number & footer line,
|
||||||
@ -673,7 +664,7 @@
|
|||||||
\newenvironment{sphinxShadowBox}
|
\newenvironment{sphinxShadowBox}
|
||||||
{\def\FrameCommand {\spx@ShadowFBox }%
|
{\def\FrameCommand {\spx@ShadowFBox }%
|
||||||
% configure framed.sty not to add extra vertical spacing
|
% configure framed.sty not to add extra vertical spacing
|
||||||
\spx@ifundefined{OuterFrameSep}{}{\OuterFrameSep\z@skip}%
|
\ltx@ifundefined{OuterFrameSep}{}{\OuterFrameSep\z@skip}%
|
||||||
% the \trivlist will add the vertical spacing on top and bottom which is
|
% the \trivlist will add the vertical spacing on top and bottom which is
|
||||||
% typical of center environment as used in Sphinx <= 1.4.1
|
% typical of center environment as used in Sphinx <= 1.4.1
|
||||||
% the \noindent has the effet of an extra blank line on top, to
|
% the \noindent has the effet of an extra blank line on top, to
|
||||||
@ -828,7 +819,7 @@
|
|||||||
% configure framed.sty's parameters to obtain same vertical spacing
|
% configure framed.sty's parameters to obtain same vertical spacing
|
||||||
% as for "light" boxes. We need for this to manually insert parskip glue and
|
% as for "light" boxes. We need for this to manually insert parskip glue and
|
||||||
% revert a skip done by framed before the frame.
|
% revert a skip done by framed before the frame.
|
||||||
\spx@ifundefined{OuterFrameSep}{}{\OuterFrameSep\z@skip}%
|
\ltx@ifundefined{OuterFrameSep}{}{\OuterFrameSep\z@skip}%
|
||||||
\vspace{\FrameHeightAdjust}
|
\vspace{\FrameHeightAdjust}
|
||||||
% copied/adapted from framed.sty's snugshade
|
% copied/adapted from framed.sty's snugshade
|
||||||
\def\FrameCommand##1{\hskip\@totalleftmargin
|
\def\FrameCommand##1{\hskip\@totalleftmargin
|
||||||
@ -1157,7 +1148,7 @@
|
|||||||
% for captions of literal blocks
|
% for captions of literal blocks
|
||||||
% with `\theH...` macros for hyperref
|
% with `\theH...` macros for hyperref
|
||||||
\newcounter{literalblock}
|
\newcounter{literalblock}
|
||||||
\spx@ifundefined{c@chapter}
|
\ltx@ifundefined{c@chapter}
|
||||||
{\@addtoreset{literalblock}{section}
|
{\@addtoreset{literalblock}{section}
|
||||||
\def\theliteralblock {\ifnum\c@section>\z@ \thesection.\fi\arabic{literalblock}}
|
\def\theliteralblock {\ifnum\c@section>\z@ \thesection.\fi\arabic{literalblock}}
|
||||||
\def\theHliteralblock {\theHsection.\arabic{literalblock}}}
|
\def\theHliteralblock {\theHsection.\arabic{literalblock}}}
|
||||||
@ -1200,7 +1191,7 @@
|
|||||||
\@for\@tempa:=code,strong,bfcode,email,tablecontinued,titleref,%
|
\@for\@tempa:=code,strong,bfcode,email,tablecontinued,titleref,%
|
||||||
menuselection,accelerator,crossref,termref,optional\do
|
menuselection,accelerator,crossref,termref,optional\do
|
||||||
{% first, check if command with no prefix already exists
|
{% first, check if command with no prefix already exists
|
||||||
\spx@ifundefined{\@tempa}{%
|
\ltx@ifundefined{\@tempa}{%
|
||||||
% give it the meaning defined so far with \sphinx prefix
|
% give it the meaning defined so far with \sphinx prefix
|
||||||
\expandafter\let\csname\@tempa\expandafter\endcsname
|
\expandafter\let\csname\@tempa\expandafter\endcsname
|
||||||
\csname sphinx\@tempa\endcsname
|
\csname sphinx\@tempa\endcsname
|
||||||
@ -1245,12 +1236,12 @@
|
|||||||
|
|
||||||
% make commands known to non-Sphinx document classes
|
% make commands known to non-Sphinx document classes
|
||||||
\providecommand*{\sphinxtableofcontents}{\tableofcontents}
|
\providecommand*{\sphinxtableofcontents}{\tableofcontents}
|
||||||
\spx@ifundefined{sphinxthebibliography}
|
\ltx@ifundefined{sphinxthebibliography}
|
||||||
{\newenvironment
|
{\newenvironment
|
||||||
{sphinxthebibliography}{\begin{thebibliography}}{\end{thebibliography}}%
|
{sphinxthebibliography}{\begin{thebibliography}}{\end{thebibliography}}%
|
||||||
}
|
}
|
||||||
{}% else clause of ifundefined
|
{}% else clause of ifundefined
|
||||||
\spx@ifundefined{sphinxtheindex}
|
\ltx@ifundefined{sphinxtheindex}
|
||||||
{\newenvironment{sphinxtheindex}{\begin{theindex}}{\end{theindex}}}%
|
{\newenvironment{sphinxtheindex}{\begin{theindex}}{\end{theindex}}}%
|
||||||
{}% else clause of ifundefined
|
{}% else clause of ifundefined
|
||||||
|
|
||||||
@ -1275,7 +1266,7 @@
|
|||||||
% define all missing \@list... macros
|
% define all missing \@list... macros
|
||||||
\count@\@ne
|
\count@\@ne
|
||||||
\loop
|
\loop
|
||||||
\spx@ifundefined{@list\romannumeral\the\count@}
|
\ltx@ifundefined{@list\romannumeral\the\count@}
|
||||||
{\iffalse}{\iftrue\advance\count@\@ne}%
|
{\iffalse}{\iftrue\advance\count@\@ne}%
|
||||||
\repeat
|
\repeat
|
||||||
\loop
|
\loop
|
||||||
@ -1284,7 +1275,7 @@
|
|||||||
\csname @list\romannumeral\the\count@\expandafter\endcsname
|
\csname @list\romannumeral\the\count@\expandafter\endcsname
|
||||||
\csname @list\romannumeral\the\numexpr\count@-\@ne\endcsname
|
\csname @list\romannumeral\the\numexpr\count@-\@ne\endcsname
|
||||||
% work around 2.6--3.2d babel-french issue (fixed in 3.2e; no change needed)
|
% work around 2.6--3.2d babel-french issue (fixed in 3.2e; no change needed)
|
||||||
\spx@ifundefined{leftmargin\romannumeral\the\count@}
|
\ltx@ifundefined{leftmargin\romannumeral\the\count@}
|
||||||
{\expandafter\let
|
{\expandafter\let
|
||||||
\csname leftmargin\romannumeral\the\count@\expandafter\endcsname
|
\csname leftmargin\romannumeral\the\count@\expandafter\endcsname
|
||||||
\csname leftmargin\romannumeral\the\numexpr\count@-\@ne\endcsname}{}%
|
\csname leftmargin\romannumeral\the\numexpr\count@-\@ne\endcsname}{}%
|
||||||
@ -1293,7 +1284,7 @@
|
|||||||
% define all missing enum... counters and \labelenum... macros and \p@enum..
|
% define all missing enum... counters and \labelenum... macros and \p@enum..
|
||||||
\count@\@ne
|
\count@\@ne
|
||||||
\loop
|
\loop
|
||||||
\spx@ifundefined{c@enum\romannumeral\the\count@}
|
\ltx@ifundefined{c@enum\romannumeral\the\count@}
|
||||||
{\iffalse}{\iftrue\advance\count@\@ne}%
|
{\iffalse}{\iftrue\advance\count@\@ne}%
|
||||||
\repeat
|
\repeat
|
||||||
\loop
|
\loop
|
||||||
@ -1313,7 +1304,7 @@
|
|||||||
% define all missing labelitem... macros
|
% define all missing labelitem... macros
|
||||||
\count@\@ne
|
\count@\@ne
|
||||||
\loop
|
\loop
|
||||||
\spx@ifundefined{labelitem\romannumeral\the\count@}
|
\ltx@ifundefined{labelitem\romannumeral\the\count@}
|
||||||
{\iffalse}{\iftrue\advance\count@\@ne}%
|
{\iffalse}{\iftrue\advance\count@\@ne}%
|
||||||
\repeat
|
\repeat
|
||||||
\loop
|
\loop
|
||||||
|
Loading…
Reference in New Issue
Block a user