I'm writing in TeXstudio, using Spanish and English. I first loaded the babel package, and then used \selectlanguage
within the text. In Options / Configure TeXstudio, I have selected Spanish as default language. This causes all text in English to be underlined in red (the program 'thinks' all the words are misspelled because they're in a language it didn't expect).
Changing the default language to English makes the red underlining appear in the Spanish text instead.
Here's the code used:
\documentclass[]{article}
\usepackage[utf8]{inputenc}
\usepackage[spanish,english]{babel}
\begin{document}
\section{Primera parte}
\selectlanguage{english}
This section is written in English. %This is all underlined in red
\section{Segunda parte}
\selectlanguage{spanish}
Esta sección está escrita en español.
\end{document}
Am I missing something really obvious here? I did try the 'Import dictionary' option.
babel
, but it only depends on the editor's features.