Back to LanguageTool Homepage - Privacy - Imprint

LaTeX filter


#1

Dear Daniel and collaborators,

first of all, thank you all for the great effort with LanguageTool.

Currently, I’m using its command-line version in a larger mathematics-oriented LaTeX project. After considering the utility detex for extracting raw text from LaTeX sources, I eventually wrote an own tailored Python script. Over the time, it evolved. Now, only very few “false” LT warnings remain when running over the whole document tree (around 250 pages of text with lots of formulas).
A speciality is that creation of unnecessary empty lines is avoided. Sentences remain intact if they span, e.g., over a list of items or over a displayed formula. Even punctuation inside of environments for displayed formulas (equation, align, etc.) can be checked. There is a mechanism for tracking of the changing line numbers, so that numbers in LT messages can be corrected via a small pipeline filter.
Since it is a Python script, adaptation to own needs, e.g., tailored treatment of own LaTeX macros, should be easy. Some knowledge of regular expressions would be necessary, however.
Many people probably use LT via the interface of a LaTeX IDE. It is not clear to me, how frequently LT (still?) is used in batch mode for LaTeX projects.

Do you know a place suitable to propose the script? I could submit the source and short discussion of an example.

Kind regards,
Matthias


#2

The script is on GitHub under
matze-dd/Tex2txt.

Cheers, Matthias


(Daniel Naber) #3

Sorry, I missed your original post. Thanks for publishing the script. Could you maybe add a license to its repo?

I have linked it from http://wiki.languagetool.org/checking-la-tex-with-languagetool.


#4

Thanks for linking the repo (GPL added). Hopefully, the script does not contain too many undiscovered bugs …