TIL: You can use hunspell (provided with Firefox, LibreOffice, ...) to spellcheck your text files very easily!
I was looking for a way of spellchecking my huge 30-page mémoire written entirely under LaTeX, and up to now had no better solution than copy-pasting into LibreOffice. It turns out the following command:
hunspell -t mémoire.tex
will bring up a cool interface which will cycle through all unknown words in your file! Type ? to get help the first time you invoke it, it won't change your file until the end.
The most awesome thing is the -t switch tells it it's LaTeX so it doesn't try to correct math formulas or commands, it was extremely clever on my mémoire -- for example it corrected text within math formulas (in textrm) but not the maths itself.
It has a man page if you need other languages too, or other file formats.
About this post
- Posted
- Archived
- Score
- 209 · 100% up
- Kind
- Text
- ID
- bse6vr
26 comments
If you like a GUI for that, you can use geany:
https://plugins.geany.org/spellcheck.html
Or a tui, vim has
:se spellwhich highlights them in the editor and thenz=with the cursor over the misspelled word brings up spelling suggestions.The Emacs guy should be posting the shortcut any second now...
Just a tip, I made a remap nnoremap <keycombo> z=1 in order to just get the first correction auto inputted since usually it’s what I want
Or, if you like Vim, you can just type this in Vim:
:set spell spelllang=en_us
(Or whatever language locale you want)
Then it’s z= to see alternatives, ]s to move to the next word highlighted.
Edit: found a full tutorial article here if someone is interested. https://www.linux.com/learn/using-spell-checking-vim
Nice!
dear dairy, today OP was a very cool guy
Thanks buddy
I had some issues with hunspell and compound words (? Can’t remember the term- things ending with “‘ve” for example, like “they’ve”- “ve” is treated as a separate word and therefore marked incorrect. Something like that.). Apparently it’s a known issue and the versions/dictionaries used in Libreoffice and friends are patched to handle it.
Ended up going with aspell for my needs- emacs spell checking- with additional dictionaries. My testing on command line looked similar, though I haven’t looked into OP’s use case as much so I’m not 100% if the interface is the same.
So long story short, that’s another option if you find you have issues with hunspell or wanted to try something different.
I think it's called a contraction. Are you sure it wasn't about whether the apostrophe is the Unicode curved apostrophe or simply a vertical apostrophe? There's a setting to change that, maybe that was it?
At least I know I use compound words and have no trouble.
Ah yes thank you.
Yep, I can’t quite recall exactly what the issue was- purged it from memory once I figured out a solution. I believe you can add the regular vertical apostrophe to a list of allowed or ignored characters or whatnot, which is what the patched dictionaries do in addition to some other changes. Main thing I wanted was something that I could install on other systems without having to worry about dealing with that bit manually.
If you would like I could go take a look and refresh my memory. There’s a couple github issues open about it.
Some love for LanguageTool please!
English only or all languages?
Deleted before we saved it.
Deleted before we saved it.
Thanks for sharing, I learned a lot of several and different answers.
It look like you're French ;) I advise you to use antidote for both French and English text, AFAIK it's the best language corrector, really powerful and can now be used with latex code
Only 120€ for a proprietary software? What a steal!
You can find many not legal (torrent etc...) versions of it... even portable versions.
Still after using it many times, I think for a daily use, it worth the 120€.
I think it's the only software which have so many options, precision and can tell me that I missed a "s" somewhere and telling me it's because this word is the subject of the complement of another way before.
Plus, it gives you repetitions, strong/weak verbs or nouns, and better ways to formulate your sentences and more.
I don't know about antidote but for French there's Grammalecte which is FOSS, has plugins for LibreOffice, Firefox, vim as well as a CLI interface and is really really powerful.
I am, and I'll check it out!