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.

  • 1
    the yen symbol is defined as the escape character for japanese implementations of tex. i can't explain how the substitution is made when you use texworks, but it's definitely related to the japanese tex input convention. Dec 14 '17 at 22:33
  • @barbarabeeton This is not happening in any other editors or programs, it is just in TexWorks. Although it doesn't affect the code any way, but it just looks odd. I have installed TexMaker just to check if the same thing happens but there is no issue with TexMaker.
    – Prem
    Dec 14 '17 at 22:39
  • 1
    @Prem: Perhaps, when running TeXworks, the keyboard switches to Japanese. If you're not using the Japanese keyboard, you can remove it.
    – Werner
    Dec 14 '17 at 22:57
  • 1
    Although I can't give you a clear answer without detailed information on TeXworks setting, this seems to be a font glyph issue. Some Japanese Unicode fonts renders U+005C (REVERSE SOLIDUS) as yen sign because 0x5C in SHIFT_JIS corresponds to yen sign. Using an appropriate font in the editor will solve your issue in this case, and I recommend you Source Han Code JP as a typewriter font if you really need to use Japanese characters in your document.
    – yudai-nkt
    Dec 14 '17 at 23:32
  • 2
    Thanks. U+005C in MS Gothic is displayed as a yen mark, so that was definitely the cause of the problem.
    – yudai-nkt
    Dec 15 '17 at 3:25

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.
  • on or off topic, this explains something that has puzzled me for a very lng time -- why japanese tex input uses a yes sign for the tex escape character. so it's not really a yen sign at all -- it just looks like one! thanks! Dec 15 '17 at 13:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.