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

Allow grammar checks on figures, tables, minipages, etc. if needed #202

Open
davidstutz opened this issue Mar 1, 2022 · 0 comments
Open

Comments

@davidstutz
Copy link

Hi,

first of all, great tool, love it to check spelling and issues in larger projects.

However, I repeatedly come across issues when checking figures, minipages, etc. that a lot of documents and papers naturally have. I have been reading through some issues and looking through the code and I hope that I am not missing any obvious option or fix to that.

The problem:
Often the structure for figures in my documents (and many others, as far as I know) could be as follows:

\begin{figure}
    % some includegraphics, tikzpicture, maybe nested using subfigure etc.
    \caption[Short caption.]{\textbf{Title:} Long caption}
    \label{fig}
\end{figure}

In some documents, figures can also be nested in minipages (e.g, to obtain two column figures in a one column template or so) or the figures themselves can have subfigures or minipages inside. Similar things apply to tables, as well.

It seems that, currently, figures and minipages and other such environments are ignored. I somewhat understand the reason for that in it not being an interpreter. However, I would argue that making this adjustable via a command line argument would be very very beneficial for many users. This is, for example, also related to #118 (although frames seem to be handled somewhat differently in the current code).

For me, for example, I would add tikzpicture or subfigure as environments to ignore, while not ignoring figure and minipage in order to get spell checking working on the caption. Even if spell checking is run on the whole inside of the figure environment and giving a lot of false positives, this would be more useful then not checking the figure at all -- I prefer to submit a thesis, paper, official document that was spell checked more thoroughly over one where I know that captions where not checked.

A simple example:

\begin{figure}
asdf 23q4tgrw asd fd
\caption{asdhger.}
\label{fig:test}
\end{figure}

Running textidote --clean --read-all --check en will show nothing and highlight nothing. Removing the --check will highlight the label as not being referenced (so there is some checking of the inside of the figure happening at least):

* L4C9-L4C17 Figure fig:test is never referenced in the text [sh:figref] 
\label{fig:test}
      ^^^^^^^^^

However, the text itself is not checked in any case.

Unfortunately, I do not have much experience with Java and was so far unable to compile it and propose some changes, but it seems that

protected boolean isEnvironmentStart(/*@ non_null @*/ String line)
is key here and would be easy to take into account a command line argument or something similar.

Thanks,
David

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

No branches or pull requests

1 participant