jupyter-book icon indicating copy to clipboard operation
jupyter-book copied to clipboard

Tables and figures produced by code cells are not numbered and tables don't have captions

Open mikheyev opened this issue 4 years ago • 1 comments

Describe the bug

According to the Jupyterbook documentation it is possible to make code cell outputs appear as images. However, these images do not receive numbers when the books is compiled.

Though the documentation doesn't say this, it seems logical that tables produced by code cells should also be rendered in this way also.

To Reproduce

An example of this can be seen here. The first figure is an image and is rendered properly and with a caption and number. The second figure is basically the same content but generated by R code cell. It has a caption but no number.

Below is an R code cell generating a table, but that has neither a number or a caption.

Expected behavior

Since a major benefit of jupyter is code executability, it is important to generate figures and tables using code and refer to them in the text.

Environment

  • Python Version [e.g. 3.7.1]: Python 3.8.2
  • Package versions or output of jupyter-book --version: Jupyter Book: 0.9.1 MyST-NB: 0.10.2 Sphinx Book Theme: 0.0.39 MyST-Parser: 0.12.10 Jupyter-Cache: 0.4.1 NbClient: 0.5.1
  • Operating System: Mac OS

mikheyev avatar Feb 25 '21 22:02 mikheyev

Plus: "figclass: margin-caption" does not work.

ysBach avatar Apr 28 '22 07:04 ysBach