Japanese
LaTeX supports many worldwide languages by means of some special packages. In this article is explained how to import and use those packages to create documents in Japanese.
Introduction
Japanese language, just as many other oriental languages, requires special fonts and a particular document encoding.
\documentclass{article}
\usepackage{xeCJK}
\setCJKmainfont{AozoraMinchoRegular.ttf}
\begin{document}
\section{これは最初のセクションである}
日本語で \LaTeX の組版を実証するための導入部分。
フォントはまた、数学的な形態および他の環境で使用することができる
\vspace{0.5cm}
And you can also use Latin characters within your Japanese document.
\end{document}
Documents in Japanese are usually formatted with the Japanese LaTeX distribution pLatex. But if you already have a LaTeX installation or want to compile your document on-line with ShareLaTeX you can use the CJK (Chinese, Japanese and Korean) package. Please note that the compiler will have to be set to XeLaTeX for this to work.
CJK with XeLaTeX
XƎLaTeX offers the possibility of importing external popular fonts or using the ones you already have in your Operating System:
\documentclass{article}
\usepackage{xeCJK}
\setCJKmainfont{AozoraMinchoRegular.ttf}
\setCJKsansfont{KodomoRounded-Light.otf}
\setCJKmonofont{KodomoRounded-Light.otf}
\begin{document}
\section{これは最初のセクションである}
日本語で \LaTeX の組版を実証するための導入部分。
フォントはまた、数学的な形態および他の環境で使用することができる
\vspace{0.5cm}
And you can also use Latin characters within your Japanese document.
\vspace{1cm}
\begin{verbatim}
このテキストは、別のフォントを持つことになります
This is a verbatim environment with mono-space font
\end{verbatim}
\end{document}
As you see, to set up a LaTeX document in Japanese is straightforward. Below is a description of each command:
\usepackage{xeCJK}
- This includes the package xeCJK which allows to use Chinese, Japanese and Korean fonts in a document to be compiled with XeLaTeX.
\setCJKmainfont{AozoraMinchoRegular.ttf}
- The main font of this document. You can either download a font and put it in your current working directory or use one of the fonts already installed in your system.
\setCJKsansfont{KodomoRounded-Light.otf}
- Font to be used in elements that require the sans family font.
\setCJKmonofont{KodomoRounded-Light.otf}
- Font to be used in elements that require the monospace family font. In the example the text inside the
verbatim
environment uses this font.
CJK with pdfLaTeX
The CJTK
package can also be used to generate a document with pdfLaTeX. External fonts can not be used, so compiling with XeLaTeX is recommended.
\documentclass{article}
\usepackage{CJKutf8}
\begin{document}
\begin{CJK}{UTF8}{min}
\section{これは最初のセクションである}
日本語で \LaTeX の組版を実証するための導入部分。
フォントはまた、数学的な形態および他の環境で使用することができる
\end{CJK}
\vspace{1cm}
\noindent
Outside the environment Latin characters may be used.
\end{document}
The line \usepackage{CJKutf8}
imports CJKutf8 which enables utf8 encoding for Chinese, Japanese and Korean fonts.
In this case every block of Japanese text must be typed inside a \begin{CJK*}{UTF8}{min}
environment. In this environment UTF8 is the encoding and min is the font to be used. You can also use the JIS encoding with the song font.
Further reading
For more information see
- Supporting modern fonts with XƎLaTeX
- Typesetting quotations and quotation marks
- International language support
- Chinese
- French
- German
- Greek
- Italian
- Arabic
- Korean
- Portuguese
- Russian
- Spanish
- The not so short introduction to LaTeX2ε
- LaTeX/Internationalization on WikiBooks
- LaTeX/Special_Characters on WikiBooks
Overleaf guides
- Creating a document in Overleaf
- Uploading a project
- Copying a project
- Creating a project from a template
- Including images in Overleaf
- Exporting your work from Overleaf
- Working offline in Overleaf
- Using Track Changes in Overleaf
- Using bibliographies in Overleaf
- Sharing your work with others
- Debugging Compilation timeout errors
- How-to guides
LaTeX Basics
- Creating your first LaTeX document
- Choosing a LaTeX Compiler
- Paragraphs and new lines
- Bold, italics and underlining
- Lists
- Errors
Mathematics
- Mathematical expressions
- Subscripts and superscripts
- Brackets and Parentheses
- Fractions and Binomials
- Aligning Equations
- Operators
- Spacing in math mode
- Integrals, sums and limits
- Display style in math mode
- List of Greek letters and math symbols
- Mathematical fonts
Figures and tables
- Inserting Images
- Tables
- Positioning Images and Tables
- Lists of Tables and Figures
- Drawing Diagrams Directly in LaTeX
- TikZ package
References and Citations
- Bibliography management in LaTeX
- Bibliography management with biblatex
- Biblatex bibliography styles
- Biblatex citation styles
- Bibliography management with natbib
- Natbib bibliography styles
- Natbib citation styles
- Bibliography management with bibtex
- Bibtex bibliography styles
Languages
- Multilingual typesetting on Overleaf using polyglossia and fontspec
- International language support
- Quotations and quotation marks
- Arabic
- Chinese
- French
- German
- Greek
- Italian
- Japanese
- Korean
- Portuguese
- Russian
- Spanish
Document structure
- Sections and chapters
- Table of contents
- Cross referencing sections and equations
- Indices
- Glossaries
- Nomenclatures
- Management in a large project
- Multi-file LaTeX projects
- Hyperlinks
Formatting
- Lengths in LaTeX
- Headers and footers
- Page numbering
- Paragraph formatting
- Line breaks and blank spaces
- Text alignment
- Page size and margins
- Single sided and double sided documents
- Multiple columns
- Counters
- Code listing
- Code Highlighting with minted
- Using colours in LaTeX
- Footnotes
- Margin notes
Fonts
Presentations
Commands
Field specific
- Theorems and proofs
- Chemistry formulae
- Feynman diagrams
- Molecular orbital diagrams
- Chess notation
- Knitting patterns
- CircuiTikz package
- Pgfplots package
- Typing exams in LaTeX
- Knitr
- Attribute Value Matrices
Class files
- Understanding packages and class files
- List of packages and class files
- Writing your own package
- Writing your own class
- Tips