Remove deprecated `\sphinxstylethead` (latex)

This commit is contained in:
jfbu
2017-05-07 10:59:50 +02:00
parent 5ca651f220
commit 4fc77026a3
4 changed files with 12 additions and 25 deletions

View File

@@ -43,6 +43,7 @@ Features removed
* ``sphinx.util.compat`` module * ``sphinx.util.compat`` module
* ``sphinx.util.nodes.process_only_nodes()`` * ``sphinx.util.nodes.process_only_nodes()``
* LaTeX environment ``notice``, use ``sphinxadmonition`` instead * LaTeX environment ``notice``, use ``sphinxadmonition`` instead
* LaTeX ``\sphinxstylethead``, use ``\sphinxstyletheadfamily``
Bugs fixed Bugs fixed
---------- ----------

View File

@@ -1360,16 +1360,7 @@
\protected\def\sphinxstyleothertitle {\textbf} \protected\def\sphinxstyleothertitle {\textbf}
\protected\def\sphinxstylesidebarsubtitle #1{~\\\textbf{#1} \smallskip} \protected\def\sphinxstylesidebarsubtitle #1{~\\\textbf{#1} \smallskip}
% \text.. commands do not allow multiple paragraphs % \text.. commands do not allow multiple paragraphs
\let\sphinxstylethead\empty \protected\def\sphinxstyletheadfamily {\sffamily}
\protected\def\sphinxstyletheadfamily {\ifx\sphinxstylethead\empty\sffamily\fi}
\AtBeginDocument{\ifx\sphinxstylethead\empty\else
\sphinxdeprecationwarning{\sphinxstylethead}{1.6}{1.7}{%
\string\sphinxstyletheadfamily\space replaces it
(it defaults to \string\sffamily) to allow use^^J
with multiple paragraphs. Backwards compatibility is maintained, but please^^J
move customization into \string\sphinxstyletheadfamily\space
in time for 1.7.^^J
And if you do it now, you will spare yourself this warning!}\fi}
\protected\def\sphinxstyleemphasis {\emph} \protected\def\sphinxstyleemphasis {\emph}
\protected\def\sphinxstyleliteralemphasis#1{\emph{\sphinxcode{#1}}} \protected\def\sphinxstyleliteralemphasis#1{\emph{\sphinxcode{#1}}}
\protected\def\sphinxstylestrong {\textbf} \protected\def\sphinxstylestrong {\textbf}

View File

@@ -1446,8 +1446,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
if len(node) == 1 and isinstance(node[0], nodes.paragraph) and node.astext() == '': if len(node) == 1 and isinstance(node[0], nodes.paragraph) and node.astext() == '':
pass pass
else: else:
self.body.append('\\sphinxstylethead{\\sphinxstyletheadfamily ') self.body.append('\\sphinxstyletheadfamily ')
context = '\\unskip}\\relax ' + context
if self.needs_linetrimming: if self.needs_linetrimming:
self.pushbody([]) self.pushbody([])
self.context.append(context) self.context.append(context)

View File

@@ -858,9 +858,8 @@ def test_latex_table_tabulars(app, status, warning):
assert ('\\begin{savenotes}\\sphinxattablestart\n\\centering\n' assert ('\\begin{savenotes}\\sphinxattablestart\n\\centering\n'
'\\begin{tabulary}{\\linewidth}[t]{|T|T|}' in table) '\\begin{tabulary}{\\linewidth}[t]{|T|T|}' in table)
assert ('\\hline\n' assert ('\\hline\n'
'\\sphinxstylethead{\\sphinxstyletheadfamily \nheader1\n\\unskip}\\relax &' '\\sphinxstyletheadfamily \nheader1\n&'
'\\sphinxstylethead{\\sphinxstyletheadfamily \nheader2\n\\unskip}\\relax' '\\sphinxstyletheadfamily \nheader2\n' in table)
in table)
assert ('\\hline\ncell1-1\n&\ncell1-2\n\\\\' in table) assert ('\\hline\ncell1-1\n&\ncell1-2\n\\\\' in table)
assert ('\\hline\ncell2-1\n&\ncell2-2\n\\\\' in table) assert ('\\hline\ncell2-1\n&\ncell2-2\n\\\\' in table)
assert ('\\hline\ncell3-1\n&\ncell3-2\n\\\\' in table) assert ('\\hline\ncell3-1\n&\ncell3-2\n\\\\' in table)
@@ -931,15 +930,13 @@ def test_latex_table_longtable(app, status, warning):
assert ('\\begin{savenotes}\\sphinxatlongtablestart' assert ('\\begin{savenotes}\\sphinxatlongtablestart'
'\\begin{longtable}{|l|l|}\n\\hline' in table) '\\begin{longtable}{|l|l|}\n\\hline' in table)
assert ('\\hline\n' assert ('\\hline\n'
'\\sphinxstylethead{\\sphinxstyletheadfamily \nheader1\n\\unskip}\\relax &' '\\sphinxstyletheadfamily \nheader1\n&'
'\\sphinxstylethead{\\sphinxstyletheadfamily \nheader2\n\\unskip}\\relax ' '\\sphinxstyletheadfamily \nheader2\n\\\\\n\\hline\n\\endfirsthead' in table)
'\\\\\n\\hline\n\\endfirsthead' in table)
assert ('\\multicolumn{2}{c}%\n' assert ('\\multicolumn{2}{c}%\n'
'{\\makebox[0pt]{\\sphinxtablecontinued{\\tablename\\ \\thetable{} -- ' '{\\makebox[0pt]{\\sphinxtablecontinued{\\tablename\\ \\thetable{} -- '
'continued from previous page}}}\\\\\n\\hline\n' 'continued from previous page}}}\\\\\n\\hline\n'
'\\sphinxstylethead{\\sphinxstyletheadfamily \nheader1\n\\unskip}\\relax &' '\\sphinxstyletheadfamily \nheader1\n&'
'\\sphinxstylethead{\\sphinxstyletheadfamily \nheader2\n\\unskip}\\relax ' '\\sphinxstyletheadfamily \nheader2\n\\\\\n\\hline\n\\endhead' in table)
'\\\\\n\\hline\n\\endhead' in table)
assert ('\\hline\n\\multicolumn{2}{r}' assert ('\\hline\n\\multicolumn{2}{r}'
'{\\makebox[0pt][r]{\\sphinxtablecontinued{Continued on next page}}}\\\\\n' '{\\makebox[0pt][r]{\\sphinxtablecontinued{Continued on next page}}}\\\\\n'
'\\endfoot\n\n\\endlastfoot' in table) '\\endfoot\n\n\\endlastfoot' in table)
@@ -996,10 +993,9 @@ def test_latex_table_complex_tables(app, status, warning):
table = tables['grid table'] table = tables['grid table']
assert ('\\begin{tabulary}{\\linewidth}[t]{|T|T|T|}' in table) assert ('\\begin{tabulary}{\\linewidth}[t]{|T|T|T|}' in table)
assert ('\\hline\n' assert ('\\hline\n'
'\\sphinxstylethead{\\sphinxstyletheadfamily \nheader1\n\\unskip}\\relax &' '\\sphinxstyletheadfamily \nheader1\n&'
'\\sphinxstylethead{\\sphinxstyletheadfamily \nheader2\n\\unskip}\\relax &' '\\sphinxstyletheadfamily \nheader2\n&'
'\\sphinxstylethead{\\sphinxstyletheadfamily \nheader3\n\\unskip}\\relax ' '\\sphinxstyletheadfamily \nheader3\n\\\\' in table)
'\\\\' in table)
assert ('\\hline\ncell1-1\n&\\sphinxmultirow{2}{5}{%\n\\begin{varwidth}[t]' assert ('\\hline\ncell1-1\n&\\sphinxmultirow{2}{5}{%\n\\begin{varwidth}[t]'
'{\\sphinxcolwidth{1}{3}}\n' '{\\sphinxcolwidth{1}{3}}\n'
'cell1-2\n\\par\n' in table) 'cell1-2\n\\par\n' in table)