Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to TeX the Japanese characters 因子の部屋 (lit. "factor rooms"). How do I do that with LaTeX?

share|improve this question

1 Answer 1

The simplest way with the pdflatex engine is

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{CJKutf8}
\begin{document}

\begin{CJK}{UTF8}{min}因子の部屋\end{CJK}

\end{document}

If you want an abbreviated command for typesetting Japanese fragments, then put this in the preamble

\newcommand{\textnihon}{\begin{CJK}{UTF8}{min}\nihon}
\newcommand{\nihon}[1]{#1\end{CJK}}

Now

\textnihon{因子の部屋}

will typeset the fragment.

Another way to cope with the problem is to switch to XeLaTeX or LuaLaTeX; with one of these engines, the document

\documentclass{article}
\usepackage{fontspec}
\newfontfamily{\nihon}{Hiragino Mincho Pro}
\newcommand{\textnihon}[1]{{\nihon#1}}

\begin{document}
This is a Japanese fragment: \textnihon{因子の部屋}
\end{document}

In place of "Hiragino Mincho Pro" you'll need to use a Japanese font present on your system.

share|improve this answer
    
inputenc package with utf8 option is not useful. I'm not sure if it is harmful. –  Leo Liu Oct 16 '11 at 2:41
    
I thought if inputenc is used with utf8 option, and the file is saved in UTF8 encoding, then the CJKutf8 package should be loaded instead of CJK. –  LianTze Lim Oct 16 '11 at 6:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.