I would like to create a table using latex elements in my sphinx documentation. So far I have added the following lines to my conf.py:
latex_engine = 'xelatex'
latex_elements = {
'preamble': r'''
\usepackage{tabular}
'''
}
my rst looks as following:
.. math::
\begin{tabular}{|l|c|r|}
\hline
foo & bar & fubar \\
fubar & toobar & foo \\
\hline
\end{tabular}
\vspace{1cm}
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}|l|c|r|}
\hline
foo & bar & fubar \\
fubar & toobar & foo \\
\hline
\end{tabular*}
\vspace{1cm}
\begin{tabularx}{\textwidth}{|X|X|X|}
\hline
foo & bar & fubar \\
fubar & toobar & foo \\
\hline
\end{tabularx}
However, the html only displays a "unknown environment "tabular"" and none of the described elements. Is there a way to properly include the package?