Skip to main content

Academic MathType Engine

Generate a Word equation collection from LaTeX on Linux, macOS or Windows. Each equation has its own embedded Equation.DSMT4 OLE object and associated PNG preview. The independent backend constructs both parts locally. Word and MathType are required on the editing workstation only.

Version 1.0.0. The maintainer checked the delivered 105-equation document in Windows Word and reported that it worked. For the same inputs, the release writer reproduces all 227 document parts byte for byte. The exact desktop builds and per-equation editing observations were not reported. 中文 · Verification · Licensing

Install and generate

Use Python 3.10 or newer. Install from PyPI in your virtual environment.

python -m pip install academic-mathtype-engine==1.0.0
academic-mathtype doctor

For a CLI example, save this UTF-8 array as input.json.

[
  {"id":"eq1","label":"Quadratic fraction","latex":"\\frac{x_i^2+1}{y_0}"},
  {"id":"eq2","label":"Inline variable","latex":"x+1","inline":true}
]
academic-mathtype build input.json demo.docx
academic-mathtype validate demo.docx --expected 2

The equivalent Python program is self-contained.

from academic_mathtype import build_docx, compile_latex, pack_ole, validate_docx

cases = [{"id": "q", "label": "Normalized response", "latex": r"\frac{x_i^2+1}{y_0}"},
         {"id": "r", "label": "Inline residual", "latex": "r=x-y", "inline": True}]
build_docx(cases, "equations.docx")
validate_docx("equations.docx", len(cases))
ole_bytes = pack_ole(compile_latex(cases[0]["latex"]))

The CLI accepts a UTF-8 JSON array with these same fields. Escape each LaTeX backslash as \\ in JSON. IDs must be unique. Use --title and --per-page to lay out a collection. The CLI requires --overwrite to replace a file. The Python API validates the entire document before replacing the destination. Installed commands are also available through python -m academic_mathtype.

Formula and preview support

The grammar covers Latin and selected Greek symbols, functions, scripts, fractions, square roots, accents, vector and font styles, fences, six matrix/cases environments, integrals, sums, products and lower limits. Use paired braces for compound operands, e.g. \sum_{i=1}^{n}{a_i-b_i}. Indexed roots, arbitrary macros and arbitrary TeX environments are outside this dialect. Limits include 700 tokens per expression, 12 × 12 per matrix and a bounded native body of 1 MiB.

Install TeX providing latex, amsmath, amssymb and dvipng for the full preview set. With these commands missing, Matplotlib mathtext can render simpler previews. An unavailable preview or unsupported expression aborts the build. Read the diagnostic for the equation ID. Run doctor to check the native round trip and whether the TeX commands are discoverable on PATH.

Verification and contribution

The frozen tests verify eight files, 29 exact MTEF bodies and 100 historical OLE/native hashes. The independent corpus includes 105 accepted inputs and 10 rejection cases. The checklist can record separate editing observations for specific desktop builds. Historical record · Acceptance materials · Architecture

python -m pip install ".[test]"
python -m unittest -v test_engine test_frozen test_document
python -m unittest discover -s tests -v
python -m unittest discover -s release -v

Submit changes on a branch with a minimal LaTeX input, its expected mathematical structure and a regression check. Keep private manuscripts, local profiles and third-party template binaries off the repository. Preserve the frozen manifest and tag. The package declares dependency ranges in pyproject.toml; requirements.txt records the historical reproduction versions. Agent workflows · Source provenance · Third-party notices · Publication gates

Metadata

Release files for academic-mathtype-engine 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for academic-mathtype-engine 1.0.0
File Size Uploaded Provenance Actions
academic_mathtype_engine-1.0.0.tar.gz 34.6 kB With provenance Details for academic_mathtype_engine-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for academic-mathtype-engine 1.0.0
File Interpreter ABI Platform Actions
academic_mathtype_engine-1.0.0-py3-none-any.whl Python 3 none any Details for academic_mathtype_engine-1.0.0-py3-none-any.whl

Total release size: 68.7 kB

Release files / academic_mathtype_engine-1.0.0.tar.gz

Download URL academic_mathtype_engine-1.0.0.tar.gz
Size 34.6 kB
Tags Source
SHA-256 checksum
How to use checksums
560ca7acd43afbb1e77c31cedc97ca57a3e29ca5b7793438b39d9fdb21c4f674
BLAKE2b-256 checksum
How to use checksums
d01fb4fac62059ea6833bcdc5b1ece240b1d29a1a0923e2c92f6234a1a9a2cf4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

Release files / academic_mathtype_engine-1.0.0-py3-none-any.whl

Download URL academic_mathtype_engine-1.0.0-py3-none-any.whl
Size 34.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
06ffb9c41888b07e9fff9e2c491ea2f8b8c47b5db374aaee9e51c588ac63bec1
BLAKE2b-256 checksum
How to use checksums
6060e8960e9c461bdfe35a5599e30e4b01d44e227b64b7363cd1f1b094770173
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

Security for academic-mathtype-engine 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for academic_mathtype_engine-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page