Skip to content

Captions that behave like captions #676

Open
@ppebay

Description

@ppebay

Say that I appended to document an inline picture contained in a file called figure_file_name as follows:
add_picture(figure_file_name)
Then, say that I am subsequently creating a caption as follows:

p = document.paragraphs[-1]
p.alignment = WD_ALIGN_PARAGRAPH.CENTER
caption = document.add_paragraph("Text of the caption goes here", style='Caption')
caption.alignment = WD_ALIGN_PARAGRAPH.CENTER

How do I then make this paragraph, which has the Caption style indeed, actually behave like a caption, i.e., move with the figure (and possibly refer to it with a Fig. 1 marking), as if it had been created in the MS Word GUI?

If I am not missing anything, the API currently does not allow for it. It would be a nice feature to have however. Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions