-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Latex writer should use tabu package and longtabu instead of longtable (patch available) #1681
Comments
I'm always up for better table handling. If tabu can do that, we'll definitely have a look at it. |
Would package |
Yes,
So, my opinion is that sphinx should move to tabu asap and move again to the newer tabu when it finally comes out, otherwise all those using autosummary tables will start monkey patching sphinx via extensions to get something usable. |
|
|
Just a quick note to record that a new version of tabu has still not arrived. Since the issue with tables in latex that generate bad boxes is still there, I think that we may want to consider tabu as is, rather than waiting for the new version (or use ltablex). Should the tabu way be preferred, to be protected from the author changing tabu in an incompatible way retaining the name (bad), could shipping the current tabu.sty with sphinx be an acceptable approach? |
A quick note to record that the latest update by the LaTeX team to This incident illustrates why Sphinx must remain conservative in this area, at least in its default LaTeX configuration; sure, Sphinx should offer a more modular structure in LaTeX, allowing e.g. users to painlessly adopt tabu/longtabu as their table rendering package, or at least make it not too complicated for a Sphinx extension to provide this, but this requires significant investment of time, and achieving compatibility with third-party LaTeX packages such as tabu which may become broken or unmaintained should not be part of core Sphinx. The main reasons why Sphinx did not adopt tabu/longtabu in the past were:
|
Is there any chance to support tabu in sphinx-core? If my understanding is right, there are no chance at present. If true, I'd like to mark this as "wontfix". |
This issue was formulated as using tabu/longtabu by Sphinx core. As such I agree with "wontfix" for the reasons above. Let me add one element, although I have not had time to make a full review of the tabu situation again: right now I tested with TeXLive 2017 that the \documentclass{article}
\usepackage{fancyvrb}
\usepackage{tabu}
\begin{document}
\begin{tabu*}to\linewidth{|XX|}
A&
\begin{Verbatim}[commandchars=\\\{\}]
And this is a complete
Verbatim environment
\end{Verbatim}
\\
\end{tabu*}
\end{document} only after removing \begin{sphinxVerbatimintable}[commandchars=\\\{\}]
\PYG{k}{def} \PYG{n+nf}{foo}\PYG{p}{(}\PYG{n}{x}\PYG{p}{)}\PYG{p}{:}
\PYG{k}{return} \PYG{n}{x}\PYG{o}{*}\PYG{o}{*}\PYG{l+m+mi}{2}
\end{sphinxVerbatimintable} in order for the from original source .. list-table::
* - .. code-block:: python
def foo(x):
return x**2
- B
* - U
- V I did not investigate the root cause of why More promising regarding the problem with computation of column widths is to do it ourself via Python code, I started this (#4507) but then I feared some complications with substitutions and basically I have not had the time to push it further so far. |
Thank you for comment. Okay, let's mark this as "wontfix". Note: It does not mean "never". We'll can reconsider when somebody would send excellent PR for us or situation changed. Thank you for proposal. |
For future reference, the problem with Verbatim is blocking. I raised the issue upstream tabu-issues-for-future-maintainer/tabu#3. |
Longtable makes it impossible to have 'paragraph type' table entries with automatically computed width.
However, this is an absolute necessity in order to correctly process things line autosummary tables.
Otherwise, one gets a latex document causing tons of overfull boxes and with text that is unreadable because it extends out of the page.
The tabu package, loaded together with longtable, provides a longtabu environment that simultaneously provides the features of longtable and tabularx.
Hence, the latex writer should be patched to use tabu. For instance, setting
and then, in
depart_table
, having something likewith this, the autosummary module can also be patched in the
get_table
function to set as column specifiersinstead of using
ll
The text was updated successfully, but these errors were encountered: