Skip to content

Improve spellchecking in combination regex show rules #733

Open

Description

@Yourouchour

Description

I am writing a bilingual Chinese-English document and encountered a problem.

If I set the spell check to Chinese, then it cannot check English words, as shown below.

#set text(lang:"ch")

asdfasdfasdf

However, if I set the language to English, then all Chinese characters will be considered spelling errors.

#set text(lang:"en")

这是一段没有问题的文字。

This is a piece of text without *ANY* problems.

I would appreciate it if it can be implemented in the near future!

Use Case

As mentioned above, this improvement will benefit those who need to write in multiple languages simultaneously.

Activity

  1. added
    feature request
    on Oct 4, 2025
  2. frozolotl commented on Oct 4, 2025

    @frozolotl

    For what it's worth, you can set the language in specific sections to english:

    #set text(lang: "zh")
    #let en(content) = text(lang: "en", content)
    
    这是一段没有问题的文字。
    
    #en[This is texxxt with problems.]
    
    #text(lang: "en")[Of course, you don't _need_ to define a function for this. But it is a bit more to type.]
  3. Yourouchour commented on Oct 5, 2025

    @Yourouchour
    Author

    For a document mixed with Chinese and English, adding a function to all the English parts is tedious and annoying.

    Fortunately, because Chinese is very different from English, I can write like this.

    #set text(lang:"en")
    #show regex("[一-龥]"): set text(lang: "ch")

    What I want to say is that writing it this way will not have any effect, including writing it like this.

    #set text(lang:"en")
    #show regex("[一-龥]"): it => text(lang: "ch")[#it]
  4. laurmaedje commented on Oct 6, 2025

    @laurmaedje
    Member

    This not working is specific to text show rules which due to how they are handled in the compiler currently lose the source location information.

  5. changed the title [-]Recommendation: Improve spell checking for multiple languages simultaneously.[/-] [+]Improve spellchecking in combination regex show rules[/+] on Oct 6, 2025
  6. added
    spellcheck
    improve
    on Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestimprovespellcheck

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions