#11 Add option for processing TeX files

2.2
closed
nobody
None
5
2014-08-15
2009-10-16
Pander
No

Please, add an option for processing TeX files [-T|--TeX]

Se it omits reports like:

1.) Line 1, column 24, Rule ID: COMMA_PARENTHESIS_WHITESPACE
Message: Put a space after the comma
Suggestion: ,
\documentclass[twocolumn,showtrims]{memoir}
^

( the ^ is pointing at the comma)

Also omit all after a % (not a \%) untill the end of the line.

Omit repoting whitespace before words starting with a backslash

26.) Line 83, column 0, Rule ID: WHITESPACE_RULE
Message: Possible typo: you repeated a whitespace
Suggestion:
{ \abc{}}
^^^^

and also after a TeX command without {}

{\abc }
^^^^

Implementing these 5 points under a special TeX command line option will increase checking grammar for TeX files

Discussion

  • Pander

    Pander - 2009-10-16

    this should also be considered good:

    3.) Line 55, column 46, Rule ID: COMMA_PARENTHESIS_WHITESPACE
    Message: Put a space after the comma
    Suggestion: ,
    ...contemporaries,\\ blah blah blah
    ^

    since \\ reprecents a line break.

     
  • Corentin Barbu

    Corentin Barbu - 2009-10-19

    I'm currently setting a bundle of shortcut allowing to efficiently review LT corrections on tex files from vim (http://corentin.barbu.free.fr/blogotext/index.php?2009/10/17/17/03/59-correction-grammaticale-dans-latex).

    My point of view on this four points (I missed the fifth):

    First, yes I've problems with comma (,) in squared brackets ([ ]), this probably should be escaped in tex mode.

    Second, clearly escape the end of the line after a % (not a \%) would be a good thing. even if I've few comments in my tex files.

    Third/Fourth I use the option :
    --disable WHITESPACE_RULE
    As LaTeX handle very well white spaces, correct white spaces in the tex document are most-often not necessary and often used for readability of the tex file.

    Maybe a tex mode with this rules would be a good thing even If I think LT to be already suitable for production use on LaTeX files, a list for my usage.

    Best Regards,

     
  • Corentin Barbu

    Corentin Barbu - 2009-10-19

    Two more tricks to deal with in a LaTeX mode :
    1) same comment on spaces in response to pander, you can use
    --disable WHITESPACE_RULE,COMMA_PARENTHESIS_WHITESPACE
    without disagreament as LaTeX manage then well spaces in the final document.

    2) french '«' and '» ' (french typo for '' ", « open » close )cause an error, maybe it's not only a tex problem.
    37.) Line 128, column 106, Rule ID: UNPAIRED_BRACKETS
    Message: Il manque une parenthèse fermante ou ouvrante, un guillemet fermant ou ouvrant, etc.
    ...ée dans toute la région appellée communément « le cône Sud » c'est à dire au sud d'u...

     
  • Pander

    Pander - 2009-10-19

    I would prefer that all the rules, including the ones on comma and whtespace, remain active in TeX mode. User can disable them themselved if they need to, this can be suggested in the manual regarding TeX mode. Also suppose there rules are extended with things that are useful for TeX, then one would miss these in TeX mode. Because overall these rules are doing it very good already in TeX and I hopre the extra cases can be implemented.

    Keep up the good work and I'm willing to run it on English and Dutch TeX files as a tester.

     
  • Pander

    Pander - 2011-09-26

    Anotherone that can be added is to ignore all that is between a procent % and the end of line, unless the % is escaped with a backslash \%.

    The implementation can be done easily by reusing code from ispell http://www.math.sc.edu/system/man/ispell.html and/or apsell http://aspell.net/man-html/The-Options.html#The-Options Both these checkers have functionality (perhaps even from another lib) to process input in (La)TeX format as normal text.

     
  • Pander

    Pander - 2011-09-26

    For aspell, see modules/filter ftp://ftp.gnu.org/gnu/aspell/aspell-0.60.6.1.tar.gz

     
  • Pander

    Pander - 2011-09-26

    For aspell, see modules/filter and modules/filter/modes from ftp://ftp.gnu.org/gnu/aspell/aspell-0.60.6.1.tar.gz These support also HTML, SGML and more.

     
  • Andrzej Giniewicz

    Would be great to have... till then I use http://code.google.com/p/opendetex/ - as simple solution would it be possible to just "use" it in LT if TeX was detected? Or - maybe it would be possible to use it as base for some more advanced mode

     
  • Daniel Naber

    Daniel Naber - 2013-10-20

    From the 2.3 change log:

    A new method JLanguageTool.check(AnnotatedText) has been introduced that allows you to check text with markup. Use AnnotatedTextBuilder to build up the input.

    So we don't directly support TeX, but we have the infrastructure so ignore markup. Directly supporting TeX is a bit out of scope for LT.

     
  • Daniel Naber

    Daniel Naber - 2013-10-20
    • status: open --> closed
    • Group: --> 2.2
     

Log in to post a comment.