[Tex/LaTex] Yen (¥) symbol for backslash (\) in TexWorks


Hi I am running TexWorks 0.6.2 on windows 10. In my text editor ( of texworks) whenever I type backslash (\) it is replaced by yen symbol (¥). The code compiles normally and if I copy the code and paste it on notepad or some other editor it shows (\). I was wondering if there is some setup in TexWorks which is causing this issue. I don't have this issue on command prompt or any other editor.

Best Answer

Since the OP's problem has been solved through the conversation in comment section, I'll post it as an answer. However, I doubt this question deserves an answer because it is more of a problem of font design than that of TeX/TeXworks and might be off-topic here. If this question should be closed and I shouldn't post an answer, feel free to let me know.

Some Japanese fonts, e.g., MS, Yu, IPA, and Meiryo, render U+005C (REVERSE SOLIDUS) as a yen symbol while yen symbol is assigned to U+00A5 and 0xA5 in Latin-1 encoding. This stems from the fact that the code point 0x5C in Shift_JIS means yen symbol. Developers of the fonts above decided to employ a yen symbol as a glyph for U+005C so that inexperienced users do not get confused with the change in the appearance of the character. Therefore, what the OP considered as a yen symbol is actually a backslash that mimics a yen symbol (ridiculous phrase but I hope you understand the meaning).

So, the solution to the problem is to use a font that renders U+005C as a backslash. Below is a list of monospaced fonts that cover Japanese characters and render U+005C as a backslash. The OP does not need a Japanese font in TeXworks, but I'd like to write down for the sake of completeness. The latter two links are unfortunately available only in Japanese.

  • Source Han Code JP: based on Source Han Sans and Source Code Pro.
  • Migu 1M: based on IPA and M+.
  • Ricty: based on Inconsolata and Migu 1M. You need to run a shell script to create Ricty due to lisence restriction.