[GH-ISSUE #473] Feature Request: Support inserting Office MathML (Mathematical Formula) in Excel files #367

Closed
opened 2026-05-05 12:12:46 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @wangjinyin7136 on GitHub (Mar 7, 2025).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/473

Originally assigned to: @jmcnamara on GitHub.

Hi, thanks for this great library!

Background

Currently, libxlsxwriter doesn't support inserting mathematical formulas (like Office MathML or LaTeX-style math expressions) into Excel files. This is a useful feature when generating scientific or technical reports directly from code.

Expected feature

Add an API to allow embedding Office MathML into Excel files, possibly in cells, textboxes, or shapes. This can enable rendering complex formulas such as:

a² + b² = c²

Why it matters

This is very useful for scientific, engineering, educational applications, and automatic report generation tools. Other Office files (like Word or PowerPoint) can handle MathML, so Excel supporting it would make sense for compatibility.

Potential Approaches

  • Directly insert Office MathML into drawing.xml or sheet.xml.
  • Expose an API for adding MathML strings into textboxes or shapes.
  • Support injecting preformatted XML blocks into the XLSX archive.

Would love to hear your thoughts on this.

Thank you!

Originally created by @wangjinyin7136 on GitHub (Mar 7, 2025). Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/473 Originally assigned to: @jmcnamara on GitHub. Hi, thanks for this great library! ## Background Currently, libxlsxwriter doesn't support inserting mathematical formulas (like Office MathML or LaTeX-style math expressions) into Excel files. This is a useful feature when generating scientific or technical reports directly from code. ## Expected feature Add an API to allow embedding Office MathML into Excel files, possibly in cells, textboxes, or shapes. This can enable rendering complex formulas such as: a² + b² = c² ## Why it matters This is very useful for scientific, engineering, educational applications, and automatic report generation tools. Other Office files (like Word or PowerPoint) can handle MathML, so Excel supporting it would make sense for compatibility. ## Potential Approaches - Directly insert Office MathML into `drawing.xml` or `sheet.xml`. - Expose an API for adding MathML strings into textboxes or shapes. - Support injecting preformatted XML blocks into the XLSX archive. Would love to hear your thoughts on this. Thank you!
Author
Owner

@jmcnamara commented on GitHub (Mar 22, 2025):

Thanks for the suggestion and apologies for taking time to get back to you.

Unfortunately supporting MathML in libxlsxwriter (or the other language variants) isn't feasible due to the effort required.

It is possible to use Rich Strings to create simple equations with subscripts and superscripts (like your example) but not anything that has divisors. See for example: https://libxlsxwriter.github.io/rich_strings_8c-example.html

Closing as won't/can't fix.

<!-- gh-comment-id:2745438997 --> @jmcnamara commented on GitHub (Mar 22, 2025): Thanks for the suggestion and apologies for taking time to get back to you. Unfortunately supporting MathML in libxlsxwriter (or the other language variants) isn't feasible due to the effort required. It is possible to use Rich Strings to create simple equations with subscripts and superscripts (like your example) but not anything that has divisors. See for example: https://libxlsxwriter.github.io/rich_strings_8c-example.html Closing as won't/can't fix.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/libxlsxwriter#367
No description provided.