Customizing LaTeX tables

123 views
Skip to first unread message

Ron Stone

unread,
Sep 3, 2020, 5:55:12 PM9/3/20
to sphinx-dev
I am trying to improve the look of LaTeX tables generated from Sphinx. In particular, I'd like to use the  top, mid, and bottom rules from the booktabs package and suppress vertical cell separators.

I can load booktabs from conf.py.

The current Sphinx doc here https://www.sphinx-doc.org/en/master/latex.html implies that this level of control is not available via conf.py, but there is a note at the bottom of the page that alludes to customization via templates:

As an experimental feature, Sphinx can use user-defined template file for LaTeX source if you have a file named _templates/latex.tex_t in your project. Additional files longtable.tex_t, tabulary.tex_t and tabular.tex_t can be added to _templates/ to configure some aspects of table rendering (such as the caption position).

and there is a parameter for pointing to it which I have set as follows in conf.py:

templates_path = '_templates'

I added the templates from https://github.com/sphinx-doc/sphinx/tree/3.x/sphinx/templates/latex

The templates are not read.

Is this possible via templates? The feature introduced as experimental in Sphinx 1.6 and may have been dropped.

Komiya Takeshi

unread,
Sep 4, 2020, 10:22:40 PM9/4/20
to sphin...@googlegroups.com
Hi,

The LaTeX templating is still working. How about changing your
templates_path to the list of string? Then it will go well :-)
https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-templates_path

Thanks,
Takeshi KOMIYA

2020年9月4日(金) 6:55 Ron Stone <ronsto...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups "sphinx-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-dev+...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/sphinx-dev/ae3e4439-d8a2-4b68-8656-24c43bd04796n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages