Sphinx: When it's include a command :math:`[0, 1]` with commas in a csv table produced an error

Created on 10 May 2018  Â·  4Comments  Â·  Source: sphinx-doc/sphinx

Subject: When it includes a command :math:[0, 1] with commas in a csv table produced an error

Problem

  • When it includes a command :math:[0, 1] with commas in a csv table produced an error.

Procedure to reproduce the problem

.. csv-table:: Balance Sheet
   :header: Description,In,Out,Balance
   :widths: 20, 10, 10, 10
   :stub-columns: 1

   Travel,,230.00,:math:`[0, 1]`
   Fees,,400.00,-630.00
   Grant,700.00,,70.00
   Train Fare,,70.00,**0.00**

Error logs / results

```
➜ thesis_source git:(master) ✗ make html
Running Sphinx v1.7.4
loading translations [es]... done
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 2 source files that are out of date
updating environment: 0 added, 2 changed, 0 removed
reading sources... [100%] tablas/test
source/tablas/test.rst:1: WARNING: "csv-table" widths do not match the number of columns in table (5).

.. csv-table:: Balance Sheet
:header: Description,In,Out,Balance
:widths: 20, 10, 10, 10
:stub-columns: 1

Travel,,230.00,:math:[0, 1]
Fees,,400.00,-630.00
Grant,700.00,,70.00
Train Fare,,70.00,0.00
thesis_source/source/tablas/test.rst:1: WARNING: "csv-table" widths do not match the number of columns in table (5).

.. csv-table:: Balance Sheet
:header: Description,In,Out,Balance
:widths: 20, 10, 10, 10
:stub-columns: 1

Travel,,230.00,:math:[0, 1]
Fees,,400.00,-630.00
Grant,700.00,,70.00
Train Fare,,70.00,0.00
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] tablas/test
generating indices... genindex
writing additional pages... search
copying static files... done
copying extra files... done
dumping search index in Spanish (code: es) ... done
dumping object inventory... done
build succeeded, 2 warnings.

Environment info

  • OS: Mac Osx El Capitan
  • Python version: Python 2.7.10, python 3.6.4
  • Sphinx version: 1.7.4
extensions question

Most helpful comment

Please quote the equation.

.. csv-table:: Balance Sheet
   :header: Description,In,Out,Balance
   :widths: 20, 10, 10, 10
   :stub-columns: 1

   Travel,,230.00,":math:`[0, 1]`"
   Fees,,400.00,-630.00
   Grant,700.00,,70.00
   Train Fare,,70.00,**0.00**

All 4 comments

Please quote the equation.

.. csv-table:: Balance Sheet
   :header: Description,In,Out,Balance
   :widths: 20, 10, 10, 10
   :stub-columns: 1

   Travel,,230.00,":math:`[0, 1]`"
   Fees,,400.00,-630.00
   Grant,700.00,,70.00
   Train Fare,,70.00,**0.00**

I'm closing this now because this is not a bug.
Thanks,

Please, add this to a faq question or tips section.

Did you read the reference of csv-table? There is a mention about the option for quote characters.
http://docutils.sourceforge.net/docs/ref/rst/directives.html#id4

Was this page helpful?
0 / 5 - 0 ratings