Hannah-Sten / TeXiFy-IDEA

LaTeX support for the IntelliJ platform by JetBrains.
https://hannah-sten.github.io/TeXiFy-IDEA
MIT License
898 stars 90 forks source link

False positive Grazie inspections in \section and math #3700

Open solonovamax opened 1 month ago

solonovamax commented 1 month ago

Type of JetBrains IDE (IntelliJ, PyCharm, etc.) and version

Name Value
IDE IntelliJ IDEA (Ultimate Edition)
Version Build #IU-242.23339.11, built on September 25, 2024
Runtime Version 21.0.4+13-b509.17 amd64 (JCEF 122.1.9)
VM OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Additional Plugins Grazie Lite/Pro

Operating System

Arch Linux x86_64 6.11.3-zen1-1-zen

TeXiFy IDEA version

0.9.7

What I did (steps to reproduce)

  1. Create document
  2. Copy in contents of example document
  3. Wait for inspections to finish processing

Minimal example to reproduce the problem

%! Author = solonovamax
%! Date = 2024-10-20
%! Compiler = latexmk -g -f --xelatex

% Preamble
\documentclass[12pt]{article}

% Document
\begin{document}

    \section{This is the first section of my test document}\label{sec:this-is-the-first-section-of-my-test-document}

    \section{The second section that is present in my testing document}\label{sec:the-second-section-that-is-present-in-my-testing-document}

    \section{A third section that I also put in my test document to showcase this issue}\label{sec:a-third-section-that-i-also-put-in-my-test-document-to-showcase-this-issue}

    \section{Here is a fourth section that I am putting in my document}\label{sec:here-is-a-fourth-section-that-i-am-putting-in-my-document}

\end{document}

Expected behavior

No inspection for the sentence being too long is present.

Actual behavior

An inspection for the sentence being too long is present.

image image

Additional Information

There are two inspections that can be presented. Sometimes it will present an inspection that reads

This sentence is over 40 words long. Consider splitting it up, as shorter sentences make the text easier to read. Powered by LanguageTool

and other times it presents one which reads

Long sentences ([word count] words here) are harder to read, according to the research; consider splitting

Further, this inspection will also show up on math content, not just textual content.

On math content, the following inspection can also show up:

Please delete the space character at the end of the paragraph.  Powered by LanguageTool

Ideally, the proofreading inspections should be entirely disabled for math content.

PHPirates commented 1 month ago

Thanks for reporting, this is essentially the same problem as #3508 and #3494, but this is a good test case.

solonovamax commented 1 month ago

Should I close this and then move it over to one of those, in that case? (also, oopsies, forgot to search for similar issues this time lol)

PHPirates commented 4 weeks ago

No worries, I'll keep it open so I will remember to test this specific case. For Grazie it is sometimes difficult to find good test cases, at least this one is in English...

solonovamax commented 4 weeks ago

No worries, I'll keep it open so I will remember to test this specific case. For Grazie it is sometimes difficult to find good test cases, at least this one is in English...

I mean if I were to close it, I'd move the vast majority of everything in the issue over to whatever the destination issue is, as a comment but I'll leave it open for now

solonovamax commented 3 weeks ago

here's another test case for a few language tool/grazie inspections

if some of the content doesn't make sense, it's because I've attempted to minimize it as much as possible, but it was extremely finicky. like it would stop working if

%! Author = solonovamax
%! Date = 2024-10-25
%! Compiler = latexmk -g -f --xelatex

% Preamble
\documentclass[12pt]{article}

% Packages

% Document
\begin{document}
    \section{Washer Method}
        \begin{gather*}
            \begin{aligned}
                V &= \pi x \\
                &= \pi (x)
            \end{aligned}
        \end{gather*}

        Some random content here.

        \subsection{Subsection}
            \subsubsection{Some Example}
                \begin{gather*}
                    x = 0
                    \\
                    y = 0
                    \begin{aligned}
                        A &= x
                    \end{aligned}
                \end{gather*}

            \subsubsection{Some Example 2}
                \begin{gather*}
                    x = 0 \\
                    x = 1 \\
                    y = 0
                    \begin{aligned}
                        A &= \frac{1}{x} \\
                        &= \frac{1}{x}
                    \end{aligned}
                \end{gather*}

\end{document}

it produces the following inspections:

image

  1. image
  2. image
  3. image
  4. image
  5. image
PHPirates commented 3 weeks ago

Yeah that's why I said it can be hard to come up with good examples, thanks a lot for this one!

solonovamax commented 3 weeks ago

if I run into any other unique inspections, I'll try and provide minimal test cases for them as well