Better handling of titlesec 2.10.1's bug (ref #3241)

This commit is contained in:
jfbu
2017-05-01 17:22:54 +02:00
parent 23b1d846f1
commit efb544898b

View File

@@ -6,7 +6,7 @@
%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{sphinx}[2017/04/25 v1.5.6 LaTeX package (Sphinx markup)]
\ProvidesPackage{sphinx}[2017/05/01 v1.5.6 LaTeX package (Sphinx markup)]
% this is the \ltx@ifundefined of ltxcmds.sty, which is loaded by
% kvoptions (and later by hyperref), but the first release of
@@ -50,10 +50,29 @@
\RequirePackage{textcomp}
\RequirePackage{titlesec}
\@ifpackagelater{titlesec}{2016/03/15}%
{\@ifpackagelater{titlesec}{2016/03/21}{}%
{\AtEndDocument{\PackageWarningNoLine{sphinx}{^^J%
******** ERROR !! PLEASE UPDATE titlesec.sty !!********^^J%
******** THIS VERSION SWALLOWS SECTION NUMBERS.********}}}}{}
{\@ifpackagelater{titlesec}{2016/03/21}%
{}%
{\newif\ifsphinx@ttlpatch@ok
\IfFileExists{etoolbox.sty}{%
\RequirePackage{etoolbox}%
\patchcmd{\ttlh@hang}{\parindent\z@}{\parindent\z@\leavevmode}%
{\sphinx@ttlpatch@oktrue}{}%
\ifsphinx@ttlpatch@ok
\patchcmd{\ttlh@hang}{\noindent}{}{}{\sphinx@ttlpatch@okfalse}%
\fi
}{}%
\ifsphinx@ttlpatch@ok
\typeout{^^J Package Sphinx Info: ^^J
**** titlesec 2.10.1 successfully patched for bugfix ****^^J}%
\else
\AtEndDocument{\PackageWarningNoLine{sphinx}{^^J%
******** titlesec 2.10.1 has a bug, (section numbers disappear) ......|^^J%
******** and Sphinx could not patch it, perhaps because your local ...|^^J%
******** copy is already fixed without a changed release date. .......|^^J%
******** If not, you must update titlesec! ...........................|}}%
\fi
}%
}{}
\RequirePackage{tabulary}
\RequirePackage{makeidx}
% For framing code-blocks and warning type notices, and shadowing topics