How do I disable change of != to ≠ in raw text / code?

Hi, I have a problem that the code in my raw blocks (```) is being rendered in the pdf-preview (and export) in it’s unicode representation. E.g. != is ≠ and same with smaller than / greater than.

How can I prevent/disable this?

1 Like

Hi, this depends on the font. You’re probably using some font with a ligature feature that creates the not equal symbol for you, I don’t think that happens with Typst’s default font. See the example below for how to turn it off for Fira Code, the very last raw block, which is my best guess at which font you are using.

```
This is != what I want
```
#show raw: set text(font: "Fira Code")
```
This is != what I want
```
#show raw: set text(font: "Fira Code", features: ("calt":0))
```
This is != what I want
```

bild

If you are using a different font, just report back with which font you are using, Typst can maybe even tell you

#show raw: it => context text.font
#raw("")

bild

3 Likes

Thanks, it was in fact “Fira Code” so your solution worked perfectly.

Have a great day! :blush:

Some other fonts should work with

#show raw: set text(ligatures: false)
1 Like