python-openxml / python-docx

Create and modify Word documents with Python
MIT License
4.51k stars 1.11k forks source link

feature: Support Captions #138

Open bitwisecook opened 9 years ago

bitwisecook commented 9 years ago

The ability to add captions to Figures and Tables for later use in a ToC.

                </w:tc>
            </w:tr>
        </w:tbl>
        <w:p w14:paraId="7A0A91D2" w14:textId="67CA5D88" w:rsidP="005329E3" w:rsidR="005329E3" w:rsidRDefault="005329E3">
            <w:pPr>
                <w:pStyle w:val="Caption"/>
            </w:pPr>
            <w:bookmarkStart w:id="52" w:name="_Toc282782923"/>
            <w:r>
                <w:t xml:space="preserve">Table </w:t>
            </w:r>
            <w:fldSimple w:instr=" SEQ Table \* ARABIC ">
                <w:r w:rsidR="0036215B">
                    <w:rPr>
                        <w:noProof/>
                    </w:rPr>
                    <w:t>10</w:t>
                </w:r>
            </w:fldSimple>
            <w:r>
                <w:t xml:space="preserve">- Caption for Table</w:t>
            </w:r>
            <w:bookmarkEnd w:id="52"/>
        </w:p>
scanny commented 9 years ago

Related to #137. @bitwisecook you might be able to adapt a temporary solution from the code there.

obentley commented 7 years ago

Hi, I was wondering if anyone had successfully managed to work out the functionality for adding captions and referable numbering to tables and figures?