mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #4792 from jfbu/autosummary_latex_tablespec
Fix autosummary latex table colspec (closes #4790)
This commit is contained in:
commit
3259ba9422
@ -358,7 +358,7 @@ class Autosummary(Directive):
|
|||||||
*items* is a list produced by :meth:`get_items`.
|
*items* is a list produced by :meth:`get_items`.
|
||||||
"""
|
"""
|
||||||
table_spec = addnodes.tabular_col_spec()
|
table_spec = addnodes.tabular_col_spec()
|
||||||
table_spec['spec'] = r'p{0.5\linewidth}p{0.5\linewidth}'
|
table_spec['spec'] = r'\X{1}{2}\X{1}{2}'
|
||||||
|
|
||||||
table = autosummary_table('')
|
table = autosummary_table('')
|
||||||
real_table = nodes.table('', classes=['longtable'])
|
real_table = nodes.table('', classes=['longtable'])
|
||||||
|
@ -188,6 +188,16 @@ def test_autosummary_generate(app, status, warning):
|
|||||||
' \n' in Foo)
|
' \n' in Foo)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.sphinx('latex', **default_kw)
|
||||||
|
def test_autosummary_latex_table_colspec(app, status, warning):
|
||||||
|
app.builder.build_all()
|
||||||
|
result = (app.outdir / 'Python.tex').text(encoding='utf8')
|
||||||
|
print(status.getvalue())
|
||||||
|
print(warning.getvalue())
|
||||||
|
assert r'\begin{longtable}{\X{1}{2}\X{1}{2}}' in result
|
||||||
|
assert r'p{0.5\linewidth}' not in result
|
||||||
|
|
||||||
|
|
||||||
def test_import_by_name():
|
def test_import_by_name():
|
||||||
import sphinx
|
import sphinx
|
||||||
import sphinx.ext.autosummary
|
import sphinx.ext.autosummary
|
||||||
|
Loading…
Reference in New Issue
Block a user