Skip to content

Table counter is overrided by code-block's in LaTeX #2319

@tk0miya

Description

@tk0miya

In Sphinx-1.3.5, the counter of tables is overrided by code-block's in latex output.
You can see the caption of table starts with 'Listings ...' in following screenshot:
2016-02-14 14 06 36

The screenshot above is generated from following reST:

.. list-table:: hello-table
   :header-rows: 1

   * - Hello
     - World
   * - Hello
     - World

.. code-block:: python
   :caption: hello-world

   print('Hello world')

.. code-block:: python
   :caption: hello-world

   print('Hello world')

.. list-table:: hello-table
   :header-rows: 1

   * - Hello
     - World
   * - Hello
     - World

This behavior comes from the combination of threeparttable and captionof.
As a test, I wraped the threeparttable in table environment. Then the problem was fixed.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions