-
-
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
Add support for booktabs-style tables to LaTeX builder #6666
Conversation
+1, reasonable. The loading of LaTeX package |
Does anyone know other (well-used) table style? If anything exists, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for your idea! But I feel some refactoring is needed for this. And it seems testing are failed. Could you check it please? I'll take a look later if I have time.
In addition, new testcase is needed for this option. Please add them later after discussion.
Not very sure if this is somehow useful, but it seems that docutils has a booktabs option implemented |
I am sorry about very long delay. But the world of LaTeX tables is a terrible jungle mess. I am worried about setting a precedent if we provide a LaTeX package specific adaptation, what if it turns incompatible with using some other package which adds colours to rows etc... There are some other things in the code base which are tied to using default columns lines and need adjustments. Sphinx has a sophisticated architecture with no equivalent in the world of LaTeX table packages to handle grid tables with merged cells. Ideally, the safest would not to worry about external LaTeX packages and provide all necessary customization hooks internally. But this probably means maintenance becomes impossible because requires to much knowledge of LaTeX and TeX macros and primitives. Anyway I will try to focus my available Sphinx time on this and possibly push to this branch. (hopefully, no promises made..) |
Indeed. It is actually a value we can pass as one of a comma separated class values to the
ah well, html output also removes everything. Anyway I wanted to check if the Docutils class values were additive or mutually exclusive, but here combining |
Render tables without vertical rules and horizontal rules of varying thickness (with additional space above and below) using the booktabs package. This is a rebase of original commit which was on master branch prior to 2.1 release. In this rebase the \RequirePackage{booktabs} has been removed from sphinx.sty, as it has to be conditional on latex_booktabs (or whatever its name will be) configuration option, and will be repositioned in a subsequent commit.
I am in the process of rebasing this on 5.x branch, hopefully for 5.2.0 (as it is a feature addition I think it is suitable for 5.2.0 if we maintain exact backwards compatibility). |
well, mypy chokes on the |
@tk0miya I rebase don 5.x but I hesitate if I should keep this PR for merge to master. Indeed I expect to be replacing |
I don't know what causes the linkcheck test failures I have seen recently often: https://github.com/sephalon/sphinx/runs/7706483793?check_suite_focus=true#step:8:2088. This time at Python 3.10 but on a nother recent occasion it was Python 3.7. And after merge no failure was reported. cf https://github.com/sphinx-doc/sphinx/runs/7618138712?check_suite_focus=true for the Python 3.7 instance on commit 5090486 which after merge f72a25c tested fine... (the linkcheck failures being without relation to the actual merged patches). |
I have reimplemented the whole thing. Apart from removing |
Ready for review. (but I forgot to add a CHANGES entry) TBH I think this option will start making sense only when "zebra-style" colouring for tables will also be available (which however may be tricky for complex tables with merged cells, but we can perhaps simply warn). |
I am closing this as it has been transfered to #10759 for further development. |
Subject: Add support for booktabs-style tables to LaTeX builder
Feature or Bugfix
Purpose
Render tables without vertical rules and horizontal rules of varying
thickness (with additional space above and below) using the booktabs
package.
Feature is not polished yet (see below), but should be enough to keep the discussion started.
TODO
\cmidrule
commands):latex-booktabs:
)