0

I'm using sphinx to generate our company manuals. In our legacy manuals we have a certain table style, that we would like to keep.

The table style consists of tables having a header with dark green background, then there are several light-green background rows and after that several rows with a white background.

Sphinx generates my LaTeX input files, which are then made an PDF using PdfLatex. There is the possibility to include LaTeX specific comments right before the LaTeX table starts with :raw-role:.

The input RST file:

.. role:: raw-role(raw)
   :format: latex

:raw-role:`\firstRow`   

=== === ===
 A   B   C
=== === ===
1A   1B  1C
2A   2B  2C
3A   3B  3C
4A   4B  4C
=== === ===

Will be transformed into:

\firstRow

\noindent\begin{tabulary}{\linewidth}{|L|L|L|}
\hline
\sphinxstylethead{\relax 
A
\unskip}\relax &\sphinxstylethead{\relax 
B
\unskip}\relax &\sphinxstylethead{\relax 
C
\unskip}\relax \\
\hline
1A
&
1B
&
1C
\\
\hline
2A
&
2B
&
2C
\\
\hline
3A
&
3B
&
3C
\\
\hline
4A
&
4B
&
4C
\\
\hline\end{tabulary}

I'm now in need for a command called \firstRow that modifies the behaviour of the \tabulary environment, so that the header has a dark-green background, the first row beneath has a light-green background and the remaining rows having a white background.

A similar Question was already asked a while ago:

I know that this is not a specific LaTeX question, but I think it is still the right place to ask it here.

1

As one can not mark across sites duplicates, I only point out here in order not to leave this question unanswered that it is duplicate of https://stackoverflow.com/questions/42949129/change-latex-table-style-using-sphinx/ and has received as such an answer there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.