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 * #5016: ``character_level_inline_markup`` setting is not initialized for
combination of non reST source parsers (ex. recommonmark) and docutils-0.13 combination of non reST source parsers (ex. recommonmark) and docutils-0.13
* #5022: latex: crashed with docutils package provided by Debian/Ubuntu * #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 Testing
-------- --------

View File

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

View File

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

View File

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