Fonts & Character Sets ⇒ inserting foreign language unicode characters into a LaTeX document
inserting foreign language unicode characters into a LaTeX document
I am looking for a minimal (but complete) example of how to insert unicode characters from Japanese or Tamil by their unicode character codes ( like Hex UTF-32 4EAC (Japanese) or 0BAA (Tamil) ) into a LaTeX document with the output compiled into a pdf document.
So far, I tried many versions, also using XeTeX, but nothing worked. XeTeX would not even compile.
I would, if possible, prefer a solution in plain, simple LaTeX (maybe, using packages).
Thank you, Jochen
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Ijon Tichy
- Posts: 640
- Joined: Mon Dec 24, 2018 10:12 am
inserting foreign language unicode characters into a LaTeX document
However, I would recommend to use XeLaTeX or LuaLaTeX. For those there are packages like babel-japanese, xecjk or lualatexja.
Please read the manuals of that packages for more information. Depending in the package there are different additional dependencies and rules to observe.
If you have problems in using them, please show us a

If you only want to print single characters, you just need a proper font. Then with XeLaTeX or LuaLaTeX you can switch to that font and select the character directly, e.g., adding 京 to your source. With pdfLaTeX instead, you need a LaTeX font binding package, that maps the font to 8bit code positions (see the link in the first paragraph).
BTW: There is a good overview with examples at: How to write Japanese with LaTeX? or more in detail at Norbert Preinings blog.

inserting foreign language unicode characters into a LaTeX document
Code: Select all
\documentclass{article}
\usepackage{} ... whatever is needed
\begin{document}
\char"41
\char"4EAC
\char"0BAA
\end{document}
Reason: code marked
- Ijon Tichy
- Posts: 640
- Joined: Mon Dec 24, 2018 10:12 am
inserting foreign language unicode characters into a LaTeX document
\char
is 8bit with pdfLaTeX. But with LuaLaTeX or XeLaTeX you could use it. But see the two documents I've linked in my last answer. For more information, e.g., about fonts see the two links at the end of my last comment.BTW: Please try to use Code tags for block code.

inserting foreign language unicode characters into a LaTeX document
Thank you, again, for your effort - and all the best.
Jochen
- Ijon Tichy
- Posts: 640
- Joined: Mon Dec 24, 2018 10:12 am
inserting foreign language unicode characters into a LaTeX document
fontspec
):A very simple example could be:
Code: Select all
%!TeX LuaLaTeX
\documentclass{article}
\usepackage{fontspec}
\newfontfamily\Mincho{IPAexMincho}
\newfontfamily\Gothic{IPAexGothic}
\begin{document}
\section{Test of Japanese symbols with IPA fonts}
{\Mincho 日本語\char"4EAC}
{\Gothic 日本語\char"4EAC}
\end{document}
With pdfLaTeX there is much more effort. Here I would absolutely recommend the usage of package
CJK
.