5

How can I declare a language on Latex and have a grammar/spell check on the text?

I would like to have highlighted the words that are not recognized by the system for the given language (English).

For the moment I am using TeXStudio on Windows 10.

  • 1
    This is not a TeX/Latex/ question, because it depends on your editor. You need to give information regarding your editor, and which operating system you are running. – Sveinung Jan 4 '17 at 9:34
  • I updated... I thought there was a package or something like that – user25954 Jan 4 '17 at 9:50
16

According to the Texstudio manual, the standard distribution already has an English spellchecker. You perform a spell check by using the shortcut Ctrl+Shift+F7. Spell checking will start at the cursor position and not at the beginning of the document.

In addition, you may use a ‘magic comment’ in your TeX- source file:

% !TeX spellcheck = en_GB 

If this comment is present in a file, the given language is automatically used for spell checks.

Use:

% !TeX spellcheck = en_US 

if you prefer US spelling. You use this code in all .tex-files you want to spell check, i.e. both in the main file and in the chapter files, if your sources are divided in multiple chapters.

Remember, the percent sign is mandatory.

Section 1.4 in the manual has detailed information how to set up different languages and perform spell checks (and grammar checks).

  • Shall the code be in the main.tex file? – user25954 Jan 4 '17 at 12:20
  • 1
    In all .tex-files you want to spell check (i.e. also at the top of any chapter files, if your sources is divided in multiple files). – Sveinung Jan 4 '17 at 12:40
  • 1
    @user25954 If you enable the spellchecking via the preferences of Texstusio and select your language there, you don't have to use any code, it will automatically check the spelling in all your open documents. Read the links to the manual. – user36296 Jan 4 '17 at 12:56
  • did not know why was in german... thanks a lot! – user25954 Jan 5 '17 at 10:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.