I've been using CJKuftf8 to include Japanese in a book containing mostly Latin script. It works fine most of the time, but I'm having problems displaying a particular kanji, 直. When compiled, this kanji always appears different to the one intended.
Left is kanji as typed, right is the kanji as it appears in the compiled document
I believe the kanji being displayed is an equivalent in simplified Chinese, but of course, is not understood in Japan.
Furthermore, if I open the document in a pdf reader on a Japanese computer, and copy the kanji, it copies as the character I intended (the one on the left). If I open the document in a pdf reader on a computer which isn't in Japanese, it copies as the wrong kanji. It seems to be an issue with an overlap in utf8. Is it possible to edit the way that the kanji is displayed in the compiled document?
MWE:
\documentclass{article}
\usepackage{CJKutf8}
\begin{document}
\Huge
\begin{CJK}{UTF8}{min}直\end{CJK}
\end{document}
Since the kanji in the code may appear differently on other computers, to be sure, here's a picture of the code.
Update: It seems to be entirely a font issue. Writing the Kanji in Word/Libre office, the kanji is displayed differently depending on the font chosen. In particular, it is displayed as intended when using a Japanese font (e.g. TakaoExMincho), and incorrectly otherwise. As far as I know, the font can't be changed when using \usepackage{CJKutf8}. Is there a fix for this?




\usepackage[utf8]{inputenc}? – erik Sep 19 '17 at 05:15\usepackage[utf8]{inputenc}and\usepackage[T1]{fontenc}, however the problem persists, the kanji is always displayed as the one on the right in the picture, not the left.Stranger still, when I open the TeX file on a different computer, the kanji in the TeX file is the wrong one.
– James Sep 19 '17 at 05:24ipxmfamily instead ofminand see if the problem resolves? – yudai-nkt Sep 19 '17 at 05:27ipxminstead ofmin.@erik As far as I know, the document is saved with utf8 encoding. Building the document with xelatex produces the same results.
– James Sep 19 '17 at 05:42\listfilesmight help especially if there might be residuals of old TeX systems. – yudai-nkt Sep 19 '17 at 05:56fontspecpackage to specify which font to use. – yudai-nkt Sep 19 '17 at 05:57fontspec" is meaningless. – James Sep 19 '17 at 07:44