Sphinx tables in latex are inconsistent at the moment.  There is a ticket 
open to use just one package for tables, but right now I think it picks 1 
of 4(?) packages depending on what it thinks it best.  In all of the 
documentation we write, I always add :class: longtable to all of the table 
definitions to allow for (what I think) is better layout, plus the 
header/footer for continuations.

You can format the columns and overall table width using the tabularcolumns 
directive, eg
.. tabularcolumns:: |>{\RaggedRight}p{\dimexpr 0.3\linewidth-2\tabcolsep}
                    |>{\RaggedRight}p{\dimexpr 0.5\linewidth-2\tabcolsep}
                    |>{\RaggedRight}p{\dimexpr 0.2\linewidth-2\tabcolsep}|

Adding that everywhere tends to get annoying quickly, plus is is difficult 
for most people understand what is going on (FYI this produces a table with 
3 columns, all left aligned, with 30%, 50%, and 20% of the page widths).

IIRC, xcolor doesn't work with all table packages, hence why it might be 
working for you.  I'd have to look through the latex writer code to find 
all of the table packages that are used, but it possible that it may work 
with one of the table packages, then you could use the :class: option to 
always use that package.

On Saturday, October 8, 2016 at 4:23:53 PM UTC-7, Minkai Li wrote:
>
> sphinx can generate Latex,the pdf it produces via latex, I'm using sphinx 
> to generate documentations. The tables it produces via latex are pretty ugly, 
> so I'd like to give them some global styling. I'd like to 
> customize tableheader row color.I add the directive 
> 在此输入代\usepackage{tabu,tabulary}码...\usepackage[table]{xcolor}\definecolor{
> tablehead}{rgb}{153,153,153 } 
>
> into my conf.py peramble  but it does not work.
>
>
> 在 2016年10月7日星期五 UTC+8上午8:23:47,Peter Burdine写道:
>>
>> For Sphinx, most people create a preamble.tex file that modifies the 
>> formatting Sphinx uses.  As of 1.4.x of Sphinx, there isn't much in the way 
>> of global styling options.  You have to learn a bit of Latex.
>>
>> On Thursday, October 6, 2016 at 5:32:08 AM UTC-7, Minkai Li wrote:
>>>
>>> Does the Sphinx documentation tool offer different PDF themes?Sphinx 
>>> doesn't generate PDF output by itself,Ituse the Latex builder。How to set 
>>> the sphinx pdf themes?
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To post to this group, send email to sphinx-users@googlegroups.com.
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to