I'm writing a Japanese dictionary using the CJKutf8 package in LaTeX. I wrote a few macros to make entries and everything works fine except setting headers with fancyhdr.

Using a macro:


I type Japanese in Unicode, but in


it doesn't compile and strange errors occur.

This is a working example:

\fancyhead[LE,RO]{\textbf{\rightmark\ -- \leftmark}}
\newcommand{\E}[4]{\hangpara{3em}{1}\textbf{\J{#2・}}\J{#1}\ #3\ \textit{#4}\J{\markboth{#2}{#2}\cleardoublepage\par}}
\E{青い}{あおい}{niebieski; \emph{rz.} zielony}{ia}
\E{青信号}{あおしんごう}{zielone światło na sygnalizatorze}{mn}

Of course I don't want to make every entry on a separate page so when I remove \cleardoublepage it it does not compile.

How can I make a header with Japanese words in it?


Using your code, you may see these error:

name = cyberb53, rootname = cyberb, pointsize = 53
mktexmf: empty or non-existent rootfile!


In fact, the TeX file is fine, but you don't have proper fonts installed for CJK bundle.

The simplest solution is to change




And note that song CJKfamily is actually for Chinese rather than Japanese.

There are also many other solutions and I won't explain much. See also How to write Japanese with LaTeX?

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.