-
Notifications
You must be signed in to change notification settings - Fork 60
New TeX mode #595
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
New TeX mode #595
Conversation
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.
|
This would be useful, is there any obstruction to merging? |
|
@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. |
|
I have a small modification to the original patch from 2011. It adds support for 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. |
|
@matthias314 please first submit your modifications as a pull request to this one so I can see what changed. |
|
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. |
|
See #625. |
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:
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.
Forced spell-checking of macro arguments while skipping over
arguments or environments. This is achieved with the new 'T' option to
"add-tex-command".
Discretionary hyphens and italic corrections are ignored. For
example, "hy-phen" and "shelf/ful" are recognized as single words.
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.