Commit 1efada5d authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Keep figure always with its caption

parent c449e1f5
Loading
Loading
Loading
Loading
Loading
+3
Changes for generateBaseline/postprocessing.py: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -808,6 +808,9 @@ def update_figure_style(docx_input, docx_output):
    for elem in root.xpath('.//w:pStyle[@w:val="CaptionedFigure"]', namespaces=ns):
        old_val = elem.get(f"{{{ns['w']}}}val")
        elem.set(f"{{{ns['w']}}}val", new_style)
        pPr = elem.getparent()
        if pPr is not None and not pPr.xpath('./w:keepNext', namespaces=ns):
            pPr.append(OxmlElement('w:keepNext'))
        counter += 1
        
    print(f'Changed style "CaptionedFigure" to "FL" {counter} times')