Skip to content

Conversation

@kevina
Copy link
Member

@kevina kevina commented Feb 11, 2020

From an email on aspell-devel.
https://lists.gnu.org/archive/html/aspell-devel/2011-02/msg00000.html

A new TeX mode for Aspell 0.60.6
by Matthias Franz

This patch (hopefully) improves Aspell's TeX mode. The new features
are as follows:

  1. Aspell skips over math contents inside $...$, $$..$$, [...] and
    common LaTeX and AMS-LaTeX environments like "equation" and "gather".
    Additional environments to be skipped over can be defined via the new
    "tex-ignore-env" list.

  2. Forced spell-checking of macro arguments while skipping over
    arguments or environments. This is achieved with the new 'T' option to
    "add-tex-command".

  3. Discretionary hyphens and italic corrections are ignored. For
    example, "hy-phen" and "shelf/ful" are recognized as single words.

  4. Spell-checking can be manually switched on and off by putting the
    text "aspell:on" and "aspell:off" into the file. This allows to skip
    over macro definitions and other parts of text that confuse Aspell.

See the new Info file for more details.

Comments about the patch:

./modules/filter/context.cpp
It seems that the order of the context filter was undefined. Whether
one wants to have this filter before or after other filters depends on
the application in mind. I need it before the tex filter so that one
can place the "aspell:off" and "aspell:on" flags inside TeX comments.

./modules/filter/tex.cpp
The new code for the tex filter.

./modules/filter/tex-filter.info
The new default settings for the filter variables. "tex-ignore-env" is
new. Most changes to "tex-command" are related to the new 'T' option.
The new "begin" line is used internally. The rest are additions and
corrections to existing definitions.

./modules/filter/modes/tex.amf
Note that we enable the context filter by default.

./manual/aspell.1
./manual/aspell.texi
Updated documentation.

From an email on aspell-devel.
https://lists.gnu.org/archive/html/aspell-devel/2011-02/msg00000.html

A new TeX mode for Aspell 0.60.6
by Matthias Franz

This patch (hopefully) improves Aspell's TeX mode. The new features
are as follows:

1) Aspell skips over math contents inside $...$, $$..$$, \[...\] and
common LaTeX and AMS-LaTeX environments like "equation" and "gather".
Additional environments to be skipped over can be defined via the new
"tex-ignore-env" list.

2) Forced spell-checking of macro arguments while skipping over
arguments or environments. This is achieved with the new 'T' option to
"add-tex-command".

3) Discretionary hyphens and italic corrections are ignored. For
example, "hy\-phen" and "shelf\/ful" are recognized as single words.

4) Spell-checking can be manually switched on and off by putting the
text "aspell:on" and "aspell:off" into the file. This allows to skip
over macro definitions and other parts of text that confuse Aspell.

See the new Info file for more details.

Comments about the patch:

./modules/filter/context.cpp
It seems that the order of the context filter was undefined. Whether
one wants to have this filter before or after other filters depends on
the application in mind. I need it before the tex filter so that one
can place the "aspell:off" and "aspell:on" flags inside TeX comments.

./modules/filter/tex.cpp
The new code for the tex filter.

./modules/filter/tex-filter.info
The new default settings for the filter variables. "tex-ignore-env" is
new. Most changes to "tex-command" are related to the new 'T' option.
The new "begin" line is used internally. The rest are additions and
corrections to existing definitions.

./modules/filter/modes/tex.amf
Note that we enable the context filter by default.

./manual/aspell.1
./manual/aspell.texi
Updated documentation.
@dkwo
Copy link

dkwo commented Dec 17, 2020

This would be useful, is there any obstruction to merging?

@kevina
Copy link
Member Author

kevina commented Dec 17, 2020

@dkwo, This patch is needs more careful review and test cases to make sure it doesn't break anything. One option is to provide two versions of the TeX filter, this one, and the original, but I have not had the time to make that work.

@matthias314
Copy link
Contributor

matthias314 commented May 31, 2022

I have a small modification to the original patch from 2011. It adds support for \(...\) (inline math mode, similar to $...$). How shall I submit the new patch? As a completely new pull request for master, as a pull request for new-text-mode, or otherwise?

I've been using this new TeX mode for many years now without any problems. Still it would be better if other people tested it, too.

@kevina
Copy link
Member Author

kevina commented Jun 1, 2022

@matthias314 please first submit your modifications as a pull request to this one so I can see what changed.

@kevina
Copy link
Member Author

kevina commented Jun 1, 2022

I did not realize you where the same person (please correct me if I am mistaken).

Please go ahead create a new pull request against master and I will try and give it a proper code review. In the commit please include the same information you had in the original aspell-devel post. Also, if possible please update your GitHub profile and/or email with your full name.

Thanks.

@kevina
Copy link
Member Author

kevina commented Jun 16, 2022

See #625.

@kevina kevina closed this Jun 16, 2022
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

Successfully merging this pull request may close these issues.

4 participants