Rename `\sphinxcaptionof to \sphinxcaption`, only 2 args

This commit is contained in:
jfbu 2017-05-04 16:10:58 +02:00
parent 069b937513
commit cdc1dadd8e
4 changed files with 9 additions and 9 deletions

View File

@ -12,7 +12,7 @@
<%- endif %> <%- endif %>
<% if table.caption -%> <% if table.caption -%>
\sphinxcapstartof{table} \sphinxcapstartof{table}
\sphinxcaptionof{table}{<%= ''.join(table.caption) %>}<%= labels %> \sphinxcaption{<%= ''.join(table.caption) %>}<%= labels %>
\sphinxaftercaption \sphinxaftercaption
<% endif -%> <% endif -%>
\begin{tabular}[t]<%= table.get_colspec() -%> \begin{tabular}[t]<%= table.get_colspec() -%>

View File

@ -12,7 +12,7 @@
<%- endif %> <%- endif %>
<% if table.caption -%> <% if table.caption -%>
\sphinxcapstartof{table} \sphinxcapstartof{table}
\sphinxcaptionof{table}{<%= ''.join(table.caption) %>}<%= labels %> \sphinxcaption{<%= ''.join(table.caption) %>}<%= labels %>
\sphinxaftercaption \sphinxaftercaption
<% endif -%> <% endif -%>
\begin{tabulary}{\linewidth}[t]<%= table.get_colspec() -%> \begin{tabulary}{\linewidth}[t]<%= table.get_colspec() -%>

View File

@ -113,7 +113,7 @@
% move back vertically to compensate space inserted by next paragraph % move back vertically to compensate space inserted by next paragraph
\vskip-\baselineskip\vskip-\parskip \vskip-\baselineskip\vskip-\parskip
}% }%
\newcommand\sphinxcaptionof[3][\LTcapwidth]{% \newcommand\sphinxcaption[2][\LTcapwidth]{%
\noindent\hb@xt@\linewidth{\hss \noindent\hb@xt@\linewidth{\hss
\vtop{\@tempdima\dimexpr#1\relax \vtop{\@tempdima\dimexpr#1\relax
% don't exceed linewidth for the caption width % don't exceed linewidth for the caption width
@ -121,8 +121,8 @@
% longtable ignores \abovecaptionskip/\belowcaptionskip, so do the same here % longtable ignores \abovecaptionskip/\belowcaptionskip, so do the same here
\abovecaptionskip\z@skip \abovecaptionskip\z@skip
\belowcaptionskip\z@skip \belowcaptionskip\z@skip
\caption[{#3}]% \caption[{#2}]%
{\strut\ignorespaces#3\ifhmode\unskip\@finalstrut\strutbox\fi}% {\strut\ignorespaces#2\ifhmode\unskip\@finalstrut\strutbox\fi}%
}\hss}% }\hss}%
\par\prevdepth\dp\strutbox \par\prevdepth\dp\strutbox
}% }%

View File

@ -492,7 +492,7 @@ def test_footnote(app, status, warning):
assert ('\\bibitem[bar]{\\detokenize{bar}}' assert ('\\bibitem[bar]{\\detokenize{bar}}'
'{\\phantomsection\\label{\\detokenize{footnote:bar}} ' '{\\phantomsection\\label{\\detokenize{footnote:bar}} '
'\ncite\n}') in result '\ncite\n}') in result
assert '\\sphinxcaptionof{table}{Table caption \\sphinxfootnotemark[4]' in result assert '\\sphinxcaption{Table caption \\sphinxfootnotemark[4]' in result
assert ('\\hline%\n\\begin{footnotetext}[4]\\sphinxAtStartFootnote\n' assert ('\\hline%\n\\begin{footnotetext}[4]\\sphinxAtStartFootnote\n'
'footnote in table caption\n%\n\\end{footnotetext}\\ignorespaces %\n' 'footnote in table caption\n%\n\\end{footnotetext}\\ignorespaces %\n'
'\\begin{footnotetext}[5]\\sphinxAtStartFootnote\n' '\\begin{footnotetext}[5]\\sphinxAtStartFootnote\n'
@ -517,7 +517,7 @@ def test_reference_in_caption_and_codeblock_in_footnote(app, status, warning):
'{\\hyperref[\\detokenize{index:authoryear}]' '{\\hyperref[\\detokenize{index:authoryear}]'
'{\\sphinxcrossref{{[}AuthorYear{]}}}}.}' in result) '{\\sphinxcrossref{{[}AuthorYear{]}}}}.}' in result)
assert '\\chapter{The section with a reference to {[}AuthorYear{]}}' in result assert '\\chapter{The section with a reference to {[}AuthorYear{]}}' in result
assert ('\\sphinxcaptionof{table}{The table title with a reference' assert ('\\sphinxcaption{The table title with a reference'
' to {[}AuthorYear{]}}' in result) ' to {[}AuthorYear{]}}' in result)
assert '\\paragraph{The rubric title with a reference to {[}AuthorYear{]}}' in result assert '\\paragraph{The rubric title with a reference to {[}AuthorYear{]}}' in result
assert ('\\chapter{The section with a reference to \\sphinxfootnotemark[4]}\n' assert ('\\chapter{The section with a reference to \\sphinxfootnotemark[4]}\n'
@ -528,7 +528,7 @@ def test_reference_in_caption_and_codeblock_in_footnote(app, status, warning):
'\\sphinxfootnotemark[6].}\\label{\\detokenize{index:id27}}\\end{figure}\n' '\\sphinxfootnotemark[6].}\\label{\\detokenize{index:id27}}\\end{figure}\n'
'%\n\\begin{footnotetext}[6]\\sphinxAtStartFootnote\n' '%\n\\begin{footnotetext}[6]\\sphinxAtStartFootnote\n'
'Footnote in caption\n%\n\\end{footnotetext}')in result 'Footnote in caption\n%\n\\end{footnotetext}')in result
assert ('\\sphinxcaptionof{table}{footnote \\sphinxfootnotemark[7] in ' assert ('\\sphinxcaption{footnote \\sphinxfootnotemark[7] in '
'caption of normal table}\\label{\\detokenize{index:id28}}') in result 'caption of normal table}\\label{\\detokenize{index:id28}}') in result
assert ('\\caption{footnote \\sphinxfootnotemark[8] ' assert ('\\caption{footnote \\sphinxfootnotemark[8] '
'in caption \\sphinxfootnotemark[9] of longtable\\strut}') in result 'in caption \\sphinxfootnotemark[9] of longtable\\strut}') in result
@ -896,7 +896,7 @@ def test_latex_table_tabulars(app, status, warning):
table = tables['table having caption'] table = tables['table having caption']
assert ('\\begin{savenotes}\\sphinxattablestart\n\\centering\n' assert ('\\begin{savenotes}\\sphinxattablestart\n\\centering\n'
'\\sphinxcapstartof{table}\n' '\\sphinxcapstartof{table}\n'
'\\sphinxcaptionof{table}{caption for table}' '\\sphinxcaption{caption for table}'
'\\label{\\detokenize{tabular:id1}}\n' '\\label{\\detokenize{tabular:id1}}\n'
'\\sphinxaftercaption' in table) '\\sphinxaftercaption' in table)
assert ('\\begin{tabulary}{\\linewidth}[t]{|T|T|}' in table) assert ('\\begin{tabulary}{\\linewidth}[t]{|T|T|}' in table)