I'm trying to typeset a Japanese book with LaTeX.
I want to use Japanese for chapter titles, so instead of "Chapter 1 ジャン・バルジン", I get "第1章 ジャン・バルジャン".
I got the Japanese option for babel with the TeX Live Manager which contains a few files, including japanese.ldf, japanese.dtx and japanese.ins. I think I'm supposed to put one of these files in the babel folder of my TeX directories, where there are a bunch of .sty files, each with the name of a language option for babel.
I tried putting the japanese.ldf in the folder. Then I tried this simple example:
\documentclass[a4paper, 10pt, twoside, draft]{memoir}
\usepackage[japanese]{babel}
\begin{document}
\title{題}
\author{作者}
\date{日付}
\maketitle
\clearpage
\tableofcontents
\clearpage
\chapter{章1}
ウェルギリウスの作品。
\clearpage
\section{節1.1}
事実両者を区別した。
\clearpage
\section{節1.2}
キケロは上流の家柄の出。
\clearpage
\chapter{章2}2}
事実両者を区別した。
\clearpage
\section{節2.1}
キケロは上流の家柄の出。
\clearpage
\section{節2.2}
ウェルギリウスの作品。
\clearpage
\chapter{章3}
キケロは上流の家柄の出。
\section{節3.1}
ウェルギリウスの作品。
\clearpage
\section{節3.2}
事実両者を区別した。
\clearpage
\end{document}
Then I got this error:
\l@japanese = a dialect from \language0
! Text line contains an invalid character.
l.35 \def\prepartname{^^[
$BBh^^[(B}%
? x
I believe something is wrong with the encoding of japanese.ldf. When I opened it with Sublime Text, there were weird characters exactly where the errors occured:
Is there a working version of japanese.ldf distributed somewhere? Or am I doing anything wrong here?



platex; I don't think they're compatible with XeLaTeX. – egreg Jul 19 '16 at 07:21xeCJKinstead – egreg Jul 19 '16 at 12:02