Fix #5009: latex: a label for table is vanished if table does not have a caption

This commit is contained in:
Takeshi KOMIYA 2018-05-24 23:22:30 +09:00
parent 65cf7b2cb2
commit 7416e9907c
4 changed files with 10 additions and 1 deletions

View File

@ -21,6 +21,7 @@ Bugs fixed
* #5016: ``character_level_inline_markup`` setting is not initialized for
combination of non reST source parsers (ex. recommonmark) and docutils-0.13
* #5022: latex: crashed with docutils package provided by Debian/Ubuntu
* #5009: latex: a label for table is vanished if table does not have a caption
Testing
--------

View File

@ -9,8 +9,12 @@
<%= table.get_colspec() %>
<%- if table.caption -%>
\caption{<%= ''.join(table.caption) %>\strut}<%= labels %>\\*[\sphinxlongtablecapskipadjust]
<% endif -%>
\hline
<% elif labels -%>
\hline\noalign{\phantomsection<%= labels %>}%
<% else -%>
\hline
<% endif -%>
<%= ''.join(table.header) %>
\endfirsthead

View File

@ -14,6 +14,8 @@
\sphinxcapstartof{table}
\sphinxcaption{<%= ''.join(table.caption) %>}<%= labels %>
\sphinxaftercaption
<% elif labels -%>
\phantomsection<%= labels %>
<% endif -%>
\begin{tabular}[t]<%= table.get_colspec() -%>
\hline

View File

@ -14,6 +14,8 @@
\sphinxcapstartof{table}
\sphinxcaption{<%= ''.join(table.caption) %>}<%= labels %>
\sphinxaftercaption
<% elif labels -%>
\phantomsection<%= labels %>
<% endif -%>
\begin{tabulary}{\linewidth}[t]<%= table.get_colspec() -%>
\hline