Skip to main content

A pure python library implemented by python3 for writing Latex formulas to word.

Project description

LatexToWord

A pure python library implemented by python3 for writing Latex formulas to word.

Readme_CN

USAGE

Install

pip install latex2word

Example

from docx import Document
from latex2word import LatexToWordElement

"""
`pip install python-docx`  
常规用法  
General usage.  
"""

# 公式(Latex string)
latex_input = r"x={-b \pm \sqrt{b^2-4ac}\over 2a}"
# 构建latex_to_word对象 (Build latex_to_word objects)
latex_to_word = LatexToWordElement(latex_input)

# 插入word公式(Create the docx file and insert the element)
doc = Document()
paragraph = doc.add_paragraph()
latex_to_word.add_latex_to_paragraph(paragraph)

doc.save('test.docx')

Result:
demo

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

latex2word-1.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

latex2word-1.1-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file latex2word-1.1.tar.gz.

File metadata

  • Download URL: latex2word-1.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for latex2word-1.1.tar.gz
Algorithm Hash digest
SHA256 5c290dbbf71d4ef99fbaebb8ac462e8199a04147d5a202809e2a1b4a03122e5d
MD5 e74a303ce259a22f28d19380e618beb1
BLAKE2b-256 9531ec13a3ee3d1a492a642f1c684053600d1ec866fb4ac22698e73c58f676c2

See more details on using hashes here.

File details

Details for the file latex2word-1.1-py3-none-any.whl.

File metadata

  • Download URL: latex2word-1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for latex2word-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5e9505bbe934a3071e022a13c934733e3a5f83fa5dede425699aa2d5155e10a7
MD5 d7d4db216efa648815010067a11fe88f
BLAKE2b-256 e4f4b9eb1f86835a1befabafb0a66f8ced3ba97a022d25d4c7e1752e6b96c35b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page