mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
update latex table tests and CHANGES for PR#3415
This commit is contained in:
parent
dcb211f5de
commit
1c38710ed2
4
CHANGES
4
CHANGES
@ -10,6 +10,9 @@ Incompatible changes
|
||||
has the custom code to fit image to available width if oversized.
|
||||
* The subclasses of ``sphinx.domains.Index`` should override ``generate()``
|
||||
method. The default implementation raises NotImplementedError
|
||||
* LaTeX positioned long tables horizontally centered, and short ones
|
||||
flushed left (no text flow around table.) The position now defaults to center in
|
||||
both cases, and it will obey Docutils 0.13 ``:align:`` option (refs #3415, #3377)
|
||||
|
||||
Features removed
|
||||
----------------
|
||||
@ -49,6 +52,7 @@ Features added
|
||||
* #3402: Allow to suppress "download file not readable" warnings using
|
||||
:confval:`suppress_warnings`.
|
||||
* #3377: latex: Add support for Docutils 0.13 ``:align:`` option for tables
|
||||
(but does not implement text flow around table).
|
||||
|
||||
Bugs fixed
|
||||
----------
|
||||
|
@ -30,7 +30,7 @@ table having :align: option (tabulary)
|
||||
--------------------------------------
|
||||
|
||||
.. table::
|
||||
:align: center
|
||||
:align: right
|
||||
|
||||
======= =======
|
||||
header1 header2
|
||||
|
@ -831,23 +831,24 @@ def test_latex_table_tabulars(app, status, warning):
|
||||
|
||||
# simple_table
|
||||
table = tables['simple table']
|
||||
assert ('\\begin{tabulary}{\\linewidth}{|L|L|}' in table)
|
||||
assert ('\\begingroup\n\\centering\n\\begin{tabulary}{\\linewidth}{|L|L|}' in table)
|
||||
assert ('\\hline\n'
|
||||
'\\sphinxstylethead{\\relax \nheader1\n\\unskip}\\relax &'
|
||||
'\\sphinxstylethead{\\relax \nheader2\n\\unskip}\\relax' in table)
|
||||
assert ('\\hline\ncell1-1\n&\ncell1-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\n\\end{tabulary}' in table)
|
||||
assert ('\\hline\n\\end{tabulary}\n\\par\n\\endgroup' in table)
|
||||
|
||||
# table having :widths: option
|
||||
table = tables['table having :widths: option']
|
||||
assert ('\\begin{tabular}{|\\X{30}{100}|\\X{70}{100}|}' in table)
|
||||
assert ('\\hline\n\\end{tabular}' in table)
|
||||
assert ('\\begingroup\n\\centering\n'
|
||||
'\\begin{tabular}{|\\X{30}{100}|\\X{70}{100}|}' in table)
|
||||
assert ('\\hline\n\\end{tabular}\n\\par\n\\endgroup' in table)
|
||||
|
||||
# table having :align: option (tabulary)
|
||||
table = tables['table having :align: option (tabulary)']
|
||||
assert ('\\begingroup\n\\centering\n'
|
||||
assert ('\\begingroup\n\\raggedleft\n'
|
||||
'\\begin{tabulary}{\\linewidth}{|L|L|}\n' in table)
|
||||
assert ('\\hline\n\\end{tabulary}\n\\par\n\\endgroup' in table)
|
||||
|
||||
@ -863,10 +864,12 @@ def test_latex_table_tabulars(app, status, warning):
|
||||
|
||||
# table having caption
|
||||
table = tables['table having caption']
|
||||
assert ('\\begin{threeparttable}\n\\capstart\\caption{caption for table}'
|
||||
assert ('\\begingroup\n\\centering\n'
|
||||
'\\begin{threeparttable}\n\\capstart\\caption{caption for table}'
|
||||
'\\label{\\detokenize{tabular:id1}}' in table)
|
||||
assert ('\\begin{tabulary}{\\linewidth}{|L|L|}' in table)
|
||||
assert ('\\hline\n\\end{tabulary}\n\\end{threeparttable}' in table)
|
||||
assert ('\\hline\n\\end{tabulary}\n\\end{threeparttable}'
|
||||
'\n\\par\n\\endgroup' in table)
|
||||
|
||||
# table having verbatim
|
||||
table = tables['table having verbatim']
|
||||
|
Loading…
Reference in New Issue
Block a user