## #355 Spelling in multi lingual documents

open
nobody
None
5*
2014-08-25
2012-11-08
Anonymous
No

I'm not sure if this should be a feature request, or a bug report. Basically, I spend a lot of time working on multi lingual documents in English and a Southeast Asian language such as Thai, Khmer, or Myanmar. I'm a very poor speller, so I appreciate the spell checker on the English text. However, it is annoying that the Asian text is always marked as misspelled.

In the case where there is some kind of mark underneath the Asian consonants the red misspelled underlining makes it difficult to even read the text.

All the languages that I am concerned about encode their characters in a different Unicode block than English. It seems like it should be relatively simple for the English spell-checker to only check words that use characters within the Latin code block.

Providing spell checks for the other languages would be nice too, but by no means essential. Just get rid of the red underlining.

## Discussion

• Anonymous - 2012-11-08

One more dream feature that I forgot to mention: it would be very nice to have an option to make the font of a specific Unicode block larger than the other text in the document. For some reason, a font size that is large for English text is, for the Asian text, quite small; in particular for Myanmar.

Thank you for providing such a wonderful editor.

• Tim Hoffmann - 2012-11-08

Well, checking the code block seems a bit hackish. It only works for the special combination latin - non-latin language and just ignores the non-latin language.

If the text blocks are larger, you can \input{} them and put a

% !TeX spellcheck = en_US


or similar command at the beginning of the file.

Multiple spellcheckers in one document are not (yet) possible. I think there's been a feature request somewhere. You may go and vote for it.

Last edit: Tim Hoffmann 2012-11-08
• Anonymous - 2012-11-08

It doens't seam very hackish to me that the US English spellchecker should skip words that are very obviously not English.

\input{} doesn't work because it's usualy only one or two lines.

I did some fiddling around, and figured out that the spell checker doesn't check inside comments. Also, I can change the comment font and font size. So what I'm doing now is just puting a special sequence after the comment percent sign, and then removing them all with the find and replace before compile. Kind of hackish, I guess. Note, this wouldn't work so nice if the Asian text and English text were mixed together in the same paragraph.

• Very hackish indeed.

You could change the "sweave" highlighting instead of the "comment" highlighting and write it like this:

 english  \<<>>=  asian @   english


and put a

 \def\<<>>=#1@{#1}


in the praemble

• Tim Hoffmann - 2012-11-08

And another hackish solution ;)

Well, checking the code block is hackish because it adresses the problem from the wrong end: Text parts in other languages should not be passed to the spellchecker at all in the first place. Additionally, it contradicts the logic (The speller accepts a word, even though it's not in its dictionary). Furthermore it only works for a subset of languages. And we'd have to hard code this into the spellchecker.

Therefore it should not go into TXS. However, you can modify the code yourself and build your version of TXS. Essentially adding something like this to SpellerUtility::check() should work:

if (word.length()<=1) return true;
foreach (const QChar &c, word) {
if (!c.toLatin1()) {
return true;
}
}


Last edit: Tim Hoffmann 2012-11-08
• Anonymous - 2012-11-09

Ok, thanks. The sweave thing is a good way to change the font, but as you gave it, it doens't turn off the spell checker. However, I discovered that changing the <<>>= to be <<%>>= does turn it off.

For some reason, if I try to type a % after <<, it tries to run some kind of macro, and wont let me type. I have to copy and past the % in. What is going on here?

• Tim Hoffmann - 2012-11-12

Multilanguage spellchecking might be directly supported in QCE3.

• Priority: 1 --> 5*