Skip to content

CJK-Latin-spacing not working with raw text #2702

Open

Description

@jiaojiaodubai

Description

Minimum working example

汉字`(code)`汉字

汉字 `(code)` 汉字

I tried to write the name of a function in raw text with parentheses, and then I found that there were no spaces between it and the subsequent CJK text. Logically speaking, regardless of the content in raw text, it should be considered as Latin text.

Reproduction URL

No response

Operating system

Windows

Typst version

  • I am using the latest version of Typst

Activity

  1. added
    bug
    on Nov 17, 2023
  2. Enter-tainer commented on Nov 17, 2023

    @Enter-tainer
    Contributor

    currently it only considers texts within the text element.

    I dont know if this is possible. Maybe we should also consider math equation and so on.

  3. Enter-tainer commented on Nov 17, 2023

    @Enter-tainer
    Contributor

    Logically speaking, regardless of the content in raw text, it should be considered as Latin text.

    Do you mean we should always add space between code blocks and cjk character?

  4. jiaojiaodubai commented on Nov 17, 2023

    @jiaojiaodubai
    Author

    Yes, as mentioned in the reference document, the text in the raw text will be in mono and is typically used to display code. Of course, CJK text can also be placed in raw text and displayed as mono, but this is an edge case. If someone really wants to display CJK text in mono, it should use methods like #set text instead of relying on raw text.

  5. changed the title [-]Whitespace Between CJK & Latin not Working with Some Raw Text[/-] [+]Whitespace between CJK & Latin not working with some raw text[/+] on Nov 17, 2023
  6. Enter-tainer commented on Nov 17, 2023

    @Enter-tainer
    Contributor

    maybe this issue should be renamed to cjk-raw spacing or something similar

  7. changed the title [-]Whitespace between CJK & Latin not working with some raw text[/-] [+]CJK-Latin-spacing not working with raw text[/+] on Nov 17, 2023
  8. added
    text
    on Nov 18, 2023
  9. added
    cjk
    on Feb 10, 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

    bugcjktext

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions