Repository navigation
refactor latex table templates to avoid extra vertical space (refs #3405) - #3415
Conversation
…phinx-doc#3405) also, make "center" the default for short table horizontal alignment (it is already so for longtable)
tk0miya
left a comment
There was a problem hiding this comment.
LGTM with nits. Please update if you'll agree with my comments.
Anyway please go ahead!
| # simple_table | ||
| table = tables['simple table'] | ||
| assert ('\\noindent\\begin{tabulary}{\\linewidth}{|L|L|}' in table) | ||
| assert ('\\begin{tabulary}{\\linewidth}{|L|L|}' in table) |
There was a problem hiding this comment.
I think we should always check \\begingroup\n\\centering\n\\begin{tabulary}... here.
It is a part of start tag of both tabular and tabulrary.
| table = tables['table having :widths: option'] | ||
| assert ('\\noindent\\begin{tabular}{|\\X{30}{100}|\\X{70}{100}|}' in table) | ||
| assert ('\\begin{tabular}{|\\X{30}{100}|\\X{70}{100}|}' in table) | ||
| assert ('\\hline\n\\end{tabular}' in table) |
There was a problem hiding this comment.
And, we should also check \\end{tabular}\n\\par\n\\endgroup here.
|
@tk0miya thanks for review ! tests updated. I updated CHANGES, and needed to mention there that there is no text flow around table currently. Because of that I am not sure |
|
Agreed. +1 for the default alignment of non-longtables. |
|
(I rebased and merged at 1c38710; thanks again!) |
The center, flushleft, flushright environments added at #3377: support :align: option for tables #3405 add extra vertical spaces in PDF output compared to earlier situation. This PR removes them.
The tabular and tabulary templates are also modified in order for produced LaTeX code to have start of environments at start of new line, for better readability
By default, the table will be horizontally centered. This is already the default behaviour of longtable. Before incorporation of
:align:option, default for short tables not using longtable was flushleft and one could not change it. Now default is like longtable centered.Relates
:align:option for tables #3377