Skip to main content

Yet another LaTeX filter

Project description

YaLafi: Yet another LaTeX filter

This Python package extracts plain text from LaTeX documents. The software may be integrated with a proofreading tool and an editor. It provides

  • mapping of character positions between LaTeX and plain text,
  • 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, including interfaces to the plug-ins vim-grammarous for Vim and Emacs-langtool for Emacs, 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 yalafi/shell/ 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. 

The script can also emulate a LanguageTool server with integrated LaTeX filter, and it produces an HTML report when run with option '--output html':

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 yalafi, version 0.9.0
Filename, size File type Python version Upload date Hashes
Filename, size yalafi-0.9.0-py3-none-any.whl (54.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size yalafi-0.9.0.tar.gz (29.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page