docxsphinx icon indicating copy to clipboard operation
docxsphinx copied to clipboard

Image caption issue for .doxc document

Open Lbramante opened this issue 5 years ago • 1 comments

With reference to a .docx document generated with the execution of the command make html docx the image caption is not displayed under the image but it is displayed after the last text available before the image call. For example, in the code reported below, the caption Image caption is reported after General Test. resulting in General Test.Image caption.

The same issue has been detected, during the generation of the .docx document, with the image reported in the example: https://github.com/mherkazandjian/docxsphinx/blob/master/examples/sample_1/source/index.rst

Also the numbered reference :numref:`` is not working despite the usage of numfig=True in the conf.py file

Could you please help me to solve this issue?

Kind regards

Code:

`General Test.

.. _First-figure:

.. figure:: _static/Life_cycle_of_the_product.png

Image caption

An example is shown in :ref:First-figure.

  • plain reference :ref:First-figure

  • named reference :ref:XXXXX <First-figure>

  • numbered reference :numref:First-figure `

Lbramante avatar Mar 25 '21 16:03 Lbramante

Thanks for the report. docxsphinx uses python-docx, and it seems that python-docx does not support image captions.

So this would probably take quite some work to add.

See https://python-docx.readthedocs.io/en/latest/

hugobuddel avatar Mar 29 '21 15:03 hugobuddel