Compiling japanese text in latex to PDF

Ok, so I said earlier that you only needed to install jlatex to have your japanese latex environment running.

Wrong. Dead wrong - as I was to find out today after finishing my Rinkou paper. First, my japanese friends in the lab suggested that I used Platex instead of jlatex (package: ptex). Why? I don’t know, but I followed their advice. It is a bit annoying having 2 packages doing apparently the same thing, and latex isn’t the only example, when talking about japanese software.

Ok, so after you generate your latex in japanese, you need to read it with a special xdvi, more precisely, xdvi-ja (package:xdvik-ja). It is easier to transform your dvi directly to pdf than to read it in gs in japanese, but here things get tricky.

Once you download all your japanese ttf fonts (apt-get cache search jap|less and install everything that look like a font) you will need dvipdfmf. But then you’ll probably run into this error:


$ dvipdfmf file.dvi
file.dvi -> file.pdf
[1
Can't find encoding file: H

Output file removed.

You’ll have to manually edit your texmf.cnf. Open the file:


/etc/texmf/texmf.d/50dvidfmx.cnf

and add this line:


CMAPINPUTS=.;/usr/share/fonts/cmap/adobe-japan1//;
/usr/share/fonts/cmap/adobe-japan2//;
/usr/share/fonts/cmap/adobe-gb1//;
/usr/share/fonts/cmap/gs-cjk-resource//

Be careful! This is actually only one line. And be sure
to apt-get install all the above cmap packages. After
you edit the file, run


#update-texmf

and then your dvipdfmf SHOULD work.

Info taken from the following links:
Debian Tips
TexWiki

Both in japanese.

One Response to “Compiling japanese text in latex to PDF”

  1. drebes Says:

    I always used pdflatex directly (no intermediate .dvi file). Do you know already, if there is any way to go from .tex source straight to a PDF with embedded Japanese fonts?

Leave a Reply


"みんな違って、みんないい。"
Unknown