\documentclass{article}
\usepackage{xeCJK}
\setCJKmainfont{Meiryo} % Here, check out your Font in your Windows and type the name of any Japanese font you like. You don't need to add the extension such as .ttf .
And in my case where I use Khmer as a main text, I set
\setmainfont{Khmer Kampot}
\usepackage[utf8]{inputenc}
So I begin:
\documentclass{article}
\usepackage{xeCJK}
\setCJKmainfont{Meiryo}
\setmainfont{Khmer Kampot}
\usepackage[utf8]{inputenc}
\begin{document}
សួស្តីកញ្ញាៗ
\section{練習は楽しい}
日本語が分からなくても日本語を話せる。
\vspace{0.5cm}
Of course, English, the language of \LaTeX producer, is there.
\end{document}
With Xelatex as the compiler, it becomes:
Example of Japanese and Khmer in Tex Document |
Note: I use TexMaker as my Latex editor. Previously, I used TexWork and it sucks. And I use TexLive, switching from MikTek, which contains limited packages.
For more details, for instance if you use PdfLatex, please refer to this site:
https://www.sharelatex.com/learn/Japanese