Fonts & Character SetsJapanese fonts

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
lordbittlesham
Posts: 1
Joined: Thu May 21, 2009 12:32 pm

Japanese fonts

Post by lordbittlesham »

Hello,

I'm trying to produce Japanese fonts in LaTeX and having some difficulties. I use MiKTeX together with TeXnic Center (and Vista). I installed the relevant CJK package automatically in MiKTeX together with the IPA font package and as far as I can see (using this guide http://www-alg.ist.hokudai.ac.jp/~jan/japfonts.html) the following should now produce Japanese output:

\documentclass{article}
\usepackage{CJK}
\begin{document}
\begin{CJK}{JIS}{ipam}
<EUC coded Japanese input>
\end{CJK}
\end{document}


The problem I have is how to create the EUC coded Japanese input. I have to confess to not knowing precisely what this means. I usually use the Windows IME language bar (that you can add automatically via control panel) to get Japanese output from roman input, which works fine in Thunderbird, Notepad, etc but when I try it with TeXnic Center all I get is ??? ?? ? ? ?? etc The same happens if I try to copy and paste. I suspect the problem is that TeXnic Center doesn't recognise this input (but possibly another editor would?) or maybe I need to use something other than Windows IME to produce the text, or... maybe I'm completely confused and I have to actually enter some raw code into TeXnic Center somehow.

Any hints whatsoever would be gratefully received.

Best,

Matthew

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

stanlio
Posts: 4
Joined: Thu Jun 11, 2009 2:39 am

Re: Japanese fonts

Post by stanlio »

Recommendation:
1. Forget about TeXnic. It doesn't do what you want and probably won't in the near future.
2. Get an editor that supports your preferred encoding. I don't know about any ones that explicitly do EUC, but notepad [1], emacs, and texmaker [2] can do unicode, as well as a bunch of others. Unless you already have large amounts of text already in EUC and you can't simply convert it, that probably will do as an alternative. emacs probably can do EUC natively, but I'm not sure.
3. In the preamble, say \usepackage[utf8x]{inputenc} and set CJK to use UTF8 instead of "JIS".

[1] If the font setting supports the characters involved. The most extensive fixed-width one seems to be MS Mincho. Also see notepad++.
[2] I had a problem typing cjk text directly into texmaker--Windows IME doesn't like it for some reason--but I can copy/paste it from another document just fine.
J_entz
Posts: 4
Joined: Fri Nov 13, 2009 9:33 am

Japanese fonts

Post by J_entz »

Hi
I also wanted to use Japanese fonts in LaTeX on windows (using Miktex). Previously I used emacs to do this (see http://www.physics.wustl.edu/~alford/te ... latex.html) but I found out that, if you just put

\documentclass[english,a4paper]{article}
\usepackage{txfonts}
\usepackage{CJK}
\begin{document}
\include{JapaneseText}
\end{document}

and you make an EUC encoded file called JapaneseText.tex with contents

%-*- coding: euc-japan -*-
\begin{CJK*}[dnp]{JIS}{min}
YOUR JAPANESE TEXT GOES HERE
\end{CJK*}

it works fine

I think the line "%-*- coding: euc-japan -*-" is important, because it tells the LaTeX "compiler" what input it is getting. If I don't use this line, LaTeX hangs during compilation.

Kind regards

Jorg Entzinger
Post Reply