- Add\Rework UI - Add Split Table and Listing - Add Support Customazeble schems
This commit is contained in:
@@ -89,14 +89,16 @@ class Paragraph(Renderable):
|
||||
return link
|
||||
|
||||
def add_inline_equation(self, formula: str):
|
||||
# omml = inline_omml(latex_to_omml(formula))
|
||||
# for r in omml.xpath("//m:r", namespaces=omml.nsmap):
|
||||
# r.append(create_element("w:rPr", [
|
||||
# create_element("w:sz", {"w:val": "24"}),
|
||||
# create_element("w:szCs", {"w:val": "24"}),
|
||||
# ]))
|
||||
# self._docx_paragraph._element.append(omml)
|
||||
self.add_run(formula, is_italic=True)
|
||||
try:
|
||||
omml = inline_omml(latex_to_omml(formula))
|
||||
for r in omml.xpath("//m:r", namespaces=omml.nsmap):
|
||||
r.append(create_element("w:rPr", [
|
||||
create_element("w:sz", {"w:val": "28"}),
|
||||
create_element("w:szCs", {"w:val": "28"}),
|
||||
]))
|
||||
self._docx_paragraph._element.append(omml)
|
||||
except Exception:
|
||||
self.add_run(formula, is_italic=True)
|
||||
|
||||
@property
|
||||
def page_break_before(self) -> bool:
|
||||
@@ -170,6 +172,12 @@ class Paragraph(Renderable):
|
||||
images = iter(self._images)
|
||||
|
||||
for image in images:
|
||||
# +landscape: section break handles the new page. Do NOT measure against
|
||||
# portrait remaining (that queues add_to_new_page and leaves an empty page).
|
||||
if getattr(image, "landscape", False):
|
||||
yield SubRenderable(image, False)
|
||||
continue
|
||||
|
||||
rendered_image = list(image.render(previous_rendered, copy(layout_state)))
|
||||
rendered_image_height = sum([x.height for x in rendered_image])
|
||||
if rendered_image:
|
||||
|
||||
Reference in New Issue
Block a user