I have a DOCX template and I want to insert a sub document into it using the {{p }}
tag, it works fine for now except that some formattings are lost. In the original document (sub_doc.docx), the title of the table is italic, centered, the size of the main font in the table 10, in the result file the title lost the italic and centered formatting.
How can I keep the formatting when inserting the sub document?
from docxtpl import DocxTemplate
tpl = DocxTemplate('tpl.docx')
sd = tpl.new_subdoc('sub_doc.docx')
context = {
'sd' : sd,
}
tpl.render(context)
tpl.save('result.docx')