I have some .rst files and I convert them to .tex file using standard sphinx converter.
In some .rst I have tables with special width like:
.. list-table::
:widths: 50 50
The resulting .tex always contains tables like:
\begin{tabulary}{\textwidth}{|L|L|}
So, the column width is lost.
How can I preserve column width when converting rst to latex?
I used comma separator too,
.. list-table::
:widths: 50 , 50
:header-rows: 1
* - SETTING
- DESCRIPTION
* - Enable
- Enables or disables internal tracing.
* - Verbose
- Enables or disables extended internal tracing.
but it doesn't work.. maybe I used a bad converter? What converter do you recommend?
actually the command
.. tabularcolumns:: |p{4.5cm}|p{8.5cm}|
is needed just before .. list-table::
https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-tabularcolumns
try:
:widths: 50, 50
with a comma separator.
The output also depends on how your table is written in rst.
I assumed that you were using the standard rst table syntax, not making tables from bulleted lists (as is possible). For more help, try http://docutils.sourceforge.net/docs/ref/rst/directives.html#tables
Also, if the 50, 50
is the column width, your latex code should look like this:
\begin{tabulary}{ 1\textwidth}{ | p{0.5} | p{0.5} | }
and:
\begin{tabulary}{total width of table}{| column width| column width|}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With