Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive Grazie inspections in \section and math #3700

Open
solonovamax opened this issue Oct 20, 2024 · 7 comments
Open

False positive Grazie inspections in \section and math #3700

solonovamax opened this issue Oct 20, 2024 · 7 comments
Labels
bug Deficiencies in TeXiFy behaviour. Grazie

Comments

@solonovamax
Copy link
Contributor

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.

@solonovamax solonovamax added bug Deficiencies in TeXiFy behaviour. untriaged Issue type still needs to be triaged or verified. labels Oct 20, 2024
@PHPirates
Copy link
Collaborator

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

@PHPirates PHPirates added Grazie and removed untriaged Issue type still needs to be triaged or verified. labels Oct 21, 2024
@PHPirates PHPirates changed the title [Bug] Bad Inspections False positive Grazie inspections in \section and math Oct 21, 2024
@solonovamax
Copy link
Contributor Author

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
Copy link
Collaborator

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
Copy link
Contributor Author

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
Copy link
Contributor Author

solonovamax commented Oct 25, 2024

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

  • the word "Washer" was removed
  • the sentence "Some random content here." wasn't long enough (which, it seems to have stopped breaking with shorter text now??)
  • the aligned blocks were removed
  • that one \\ on its own line was moved to the same line as x = 0
  • &= \pi x was used instead of &= \pi (x) (or even &= (x)
%! 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
Copy link
Collaborator

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

@solonovamax
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Deficiencies in TeXiFy behaviour. Grazie
Projects
None yet
Development

No branches or pull requests

2 participants