Skip to main content

A flexible LaTeX filter

Project description

Tex2txt: a flexible LaTeX filter

This Python script or module extracts plain text from LaTeX documents. Due to the following characteristics, it may be integrated with a proofreading software:

  • tracking of line numbers or character positions during text manipulations,
  • simple inclusion of own LaTeX macros and environments with tailored treatment,
  • careful conservation of text flows,
  • detection of trailing interpunction in equations,
  • proper handling of nestable LaTeX elements like {} braces.

A more complete description is available at the GitHub page. For instance, the LaTeX input

Only few people\footnote{We use
\textcolor{red}{redx colour.}}
is lazy.

will lead to the subsequent output from example application script shell.py. The script invokes LanguageTool as proofreading software, using a local installation or the Web server hosted by LanguageTool.

1.) Line 2, column 17, Rule ID: MORFOLOGIK_RULE_EN_GB
Message: Possible spelling mistake found
Suggestion: red; Rex; reds; redo; Red; Rede; redox; red x
Only few people is lazy.    We use redx colour. 
                                   ^^^^
2.) Line 3, column 1, Rule ID: PEOPLE_VBZ[1]
Message: If 'people' is plural here, don't use the third-person singular verb.
Suggestion: am; are; aren
Only few people is lazy.    We use redx colour. 
                ^^

Run with option --html, the script produces an HTML report:

HTML report

Project details


Download files

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

Files for tex2txt, version 1.7.0
Filename, size File type Python version Upload date Hashes
Filename, size tex2txt-1.7.0-py3-none-any.whl (43.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size tex2txt-1.7.0.tar.gz (31.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page