5

I'm trying to type some japanese characters in my document. In particular, I'll have to write some movie's name this way:

Godzilla (ゴジラ, Gojira, Ishirō Honda, 1954)

I sadly found out that I just can't write Kanji characters in latex. It appears I have to use the package CJK, but something isn't working and I can't understand how to make it work.

The CJK package seems to be installed in my computer, since if I just type something like this:

\documentclass{article}

\usepackage{CJK}
\usepackage{lipsum}

\begin{document}

\lipsum

\end{document}

It works. If the CJK wasn't there it would give me an error like

File `CJK.sty' not found. \usepackage

The problem is that if I try to paste the example code I find in the CJK documentation, which is the following:

\documentclass{article}

\usepackage{CJK}
\usepackage{pinyin}

\begin{document}
\begin{CJK}{Bg5}{fs}

我很喜歡吃中國飯。
\Wo3 \hen3 \xi3\huan1 \chi1\Zhong1\guo2\fan4.
I like to eat Chinese foodvery much.

\end{CJK}
\end{document}

I get the following errors:

Argument of \CJK@XX has an extra } æå
Paragraph ended before \CJK@XX was complete æå
Argument of \CJK@XX has an extra } æå¾åæ
Paragraph ended before \CJK@XX was complete æå¾åæ
Argument of \CJK@XX has an extra } æå¾åæ­¡åä
Paragraph ended before \CJK@XX was complete æå¾åæ­¡åä
Argument of \CJK@XX has an extra } æå¾åæ­¡å中åé
Paragraph ended before \CJK@XX was complete æå¾åæ­¡å中åé
Argument of \Wo has an extra } \Wo
Paragraph ended before \Wo was complete \Wo

I looked for other discussions and couldn't understand how to just make this work. Also, I'm not interested in that pinyin package that the example suggests; I just need the CJK package so I can type Kanji characters. It may be something related to the encoding, BG5, or the font, but the CJK documentation just says that there are different encodings and fonts, without indicating the codes to use them. This means that I can't try to play with them to see if it's just a matter of encoding and fonts.

I don't have a clue about how to proceed forth, so I'll copy you the message log, which by the way goes wild when I try to compile the document:

Process started: pdflatex.exe -synctex=1 -interaction=nonstopmode "test".tex

Running miktex-makemf.exe...

miktex-makemf: The ntufsm source file could not be found. Running hbf2gf.exe...

hbf2gf (CJK ver. 4.8.0) Couldn't find `ntufsm.cfg' miktex-maketfm: No creation rule for font ntufsm43.

Running miktex-makemf.exe...

miktex-makemf: The ntufsm source file could not be found. Running hbf2gf.exe...

hbf2gf (CJK ver. 4.8.0) Couldn't find `ntufsm.cfg' miktex-maketfm: No creation rule for font ntufsm19.

Running miktex-makemf.exe...

miktex-makemf: The ntufsm source file could not be found. Running hbf2gf.exe...

hbf2gf (CJK ver. 4.8.0) Couldn't find `ntufsm.cfg' miktex-maketfm: No creation rule for font ntufsm08.

Running miktex-makemf.exe...

miktex-makemf: The ntufsm source file could not be found. Running hbf2gf.exe...

hbf2gf (CJK ver. 4.8.0) Couldn't find `ntufsm.cfg' miktex-maketfm: No creation rule for font ntufsm15.

Running miktex-makemf.exe...

miktex-makemf: The ntufsm source file could not be found. Running hbf2gf.exe...

hbf2gf (CJK ver. 4.8.0) Couldn't find `ntufsm.cfg' miktex-maketfm: No creation rule for font ntufsm02.

Running miktex-makemf.exe...

miktex-makemf: The ntufsm source file could not be found. Running hbf2gf.exe...

hbf2gf (CJK ver. 4.8.0) Couldn't find `ntufsm.cfg' miktex-maketfm: No creation rule for font ntufsm41.

Process exited with error(s)

I also uploaded the log file on 2shared; maybe you can deduce something from it: http://www.2shared.com/file/hdD5oY4I/test.html

Thank you in advance to anyone who'll help me.

EDIT:

This questions doesn't have anything to do with this other question. While in that case the problem was not having the kanji characters shown properly, in my case I am receiving a big amount of problems related to the CJK packages.

As cfr said, I also found out that the problem may be some missing font. I downloaded the CJK-font package, which is a "fake" package, since it just contains six fonts which I'd have to install manually, via a very complex procedure that the latex manual I've got via the installation doesn't cover properly.

I also found out that MiKTeX should include a ipaex package, as shown here. That package should provide the fonts I need, but if I type a \usepackage{ipaex} it doesn't work (it says it can't find ipaex.sty), nor I can find documentation about what are the actual names or short-names of those fonts, which would allow me to use them by temporarily changing the font family in the document. The same goes for CJK-fonts: it says it can't find cjk-fonts.sty, even though, according to MiKTeX, it's present in the MiKTeX installation since 2004.

So I'm still trying to type those characters, and I have "just" a couple of days to discover how to do so.

  • 2
    Although you have the package installed, TeX thinks you don't have the font it needs. This either means you need to install the font or, if it is installed, you need to tell TeX about it. Check the former first, obviously. (Or use a different font.) In this case, though, I would start with texdoc cjk which tells you the encoding you are using is for Chinese, not Japanese. It also explains the options for Japanese. Figure that first. Then figure the font. – cfr Feb 21 '14 at 0:45
  • I updated my solution in the previous question. I hope it will help. – Leo Liu Feb 21 '14 at 7:45
  • I am quite sure that my solution does cover your question, and I am very familar with this kind of questions. I provided several solutions that all of which were tested on automatically updated TeX Live 2013, without any manaul configurations. You should update your MiKTeX (maybe switch to TeX Live), and use one of the solutions. And the XeTeX or LuaTeX solution (without Japanese classes) may be suitable for you. – Leo Liu Feb 24 '14 at 2:33
  • this was from years ago and the answer actually didn't help me. Some months ago I happened to find the same issue, though, but I managed to find my own solution - using the package "kotex", that's it. I'll add this as solution. – il mietitore Mar 6 '17 at 15:38
3

an example with xelatex:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Code2000}
\begin{document}

我很喜歡吃中國飯。
Godzilla (ゴジラ, Gojira, Ishirō Honda, 1954)

\end{document}

The free TrueType font Code2000 is available in the www but you can use any other font with cjk characters.

enter image description here

  • The OP said that he/she uses some old packages like inputenc and babel. It might a bit difficult for a beginner to switch to UTF-8 and polyglossia. (BTW, Code2000 is a very poor font.) – Leo Liu Feb 24 '14 at 2:59
  • Why should one switch to Polyglossia? And I never said that Code2000 is a good font, it has all characters which is good for testing! – user2478 Feb 24 '14 at 7:43
  • @Hherbert: polyglossia is the replacement of babel under XeTeX. – Leo Liu Feb 24 '14 at 14:22
1

I posted this 3 years ago and, back in the time, I didn't solve the issue. Some months ago though I happened to find myself in a similar situation and I found out that I could as well resolve it by loading the package "kotex".

\usepackage{kotex}

It's made for korean characters but in reality it worked as well with kanji.

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.