Skip to main content

Simple LaTeX parser providing latex-to-unicode and unicode-to-latex conversion

Project description

Simple LaTeX parser providing latex-to-unicode and unicode-to-latex conversion

https://img.shields.io/github/license/phfaist/pylatexenc.svg?style=flat https://img.shields.io/travis/phfaist/pylatexenc.svg?style=flat https://img.shields.io/pypi/v/pylatexenc.svg?style=flat https://img.shields.io/lgtm/alerts/g/phfaist/pylatexenc.svg?logo=lgtm&logoWidth=18&style=flat

Unicode Text to LaTeX code

The pylatexenc.latexencode module provides a function unicode_to_latex() which converts a unicode string into LaTeX text and escape sequences. It should recognize accented characters and most math symbols. A couple of switches allow you to alter how this function behaves.

You can also run latexencode in command-line to convert plain unicode text (from the standard input or from files given on the command line) into LaTeX code, written on to the standard output.

Parsing LaTeX code & converting to plain text (unicode)

The pylatexenc.latexwalker module provides a series of routines that parse the LaTeX structure of given LaTeX code and returns a logical structure of objects, which can then be used to produce output in another format such as plain text. This is not a replacement for a full (La)TeX engine, rather, this module provides a way to parse a chunk of LaTeX code as mark-up code.

The pylatexenc.latex2text module builds up on top of pylatexenc.latexwalker and provides functions to convert given LaTeX code to plain text with unicode characters.

You can also run latex2text in command-line to convert LaTeX input (either from the standard input, or from files given on the command line) into plain text written on the standard output.

Documentation

Full documentation is available at https://pylatexenc.readthedocs.io/.

License

See LICENSE.txt (MIT License).

NOTE: See copyright notice and license information for file unicode.xml provided in unicode.xml.LICENSE. (The file unicode.xml was downloaded from https://www.w3.org/2003/entities/2007xml/unicode.xml as linked from https://www.w3.org/TR/xml-entity-names/#source.)

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

pylatexenc-2.0.post1.tar.gz (119.2 kB view details)

Uploaded Source

File details

Details for the file pylatexenc-2.0.post1.tar.gz.

File metadata

  • Download URL: pylatexenc-2.0.post1.tar.gz
  • Upload date:
  • Size: 119.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.8.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.8.0 requests-toolbelt/0.8.0 clint/0.5.1 CPython/2.7.16 Darwin/18.7.0

File hashes

Hashes for pylatexenc-2.0.post1.tar.gz
Algorithm Hash digest
SHA256 e2bb024e446fc44672f04acf05a7281671832b127fc96e239d32755cb1a70769
MD5 847dd33e3714be5f3346d246f074302a
BLAKE2b-256 4717090c19d67d3bb2fca1287c506b255c717e5681f8cf369594bf77845da361

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