10

I'm writing a document which is 99% English but needs a few words of other languages, including Thai, Japanese, and Chinese. I've had success with the latter two, but I'm stuck on Thai. Here's a MNWE:

\documentclass{article}

\usepackage{CJKutf8}

\begin{document}

Japanese: \begin{CJK}{UTF8}{min}結核\end{CJK}
Chinese: \begin{CJK}{UTF8}{bsmi}結核\end{CJK}
Thai: \begin{CJK}{UTF8}{gar}ไข้เด็งกี\end{CJK}   % <-- fail 

\end{document}

Compiling this fails with:

LaTeX Font Warning: Font shape `C70/gar/m/n' undefined
(Font)              using `C70/song/m/n' instead on input line 9.

(/usr/local/texlive/2013/texmf-dist/tex/latex/cjk/texinput/UTF8/c70song.fd)
./b0rken.tex:9: Undefined control sequence.
try@size@range ...extract@rangefontinfo font@info 
                                                  <-*>@nil <@nnil 
l.9 Thai: \begin{CJK}{UTF8}{gar}ไข
                                      ้เด็งกี\end{CJK}  % <-- ...

Commenting out the "fail" line leads to successful compile with Japanese and Chinese characters where they should be in the output.

This is using MacTeX 2013. I do have the cjk and fonts-tlwg packages installed. I also have several c90* files present, including c90gar.fd and c90nrsr.fd.

I do need to stay with normal pdfTeX rather than XeTeX.

3
  • There's no CJK fonts in C70 encoding (Unicode) preinstalled for Thai in TeX Live. Fonts in C90 encoding cannot be used like that.
    – Leo Liu
    Nov 16, 2013 at 0:21
  • @Leo: OK. How can they be used? Are there C70 fonts I can install?
    – Reid
    Nov 16, 2013 at 4:07
  • The easiest way to use a few Thai words in LaTeX, is to include a graphic. I am not an expert on Thai. But the fonts for Thai are usually used in TIS 620 (input) encoding. Anyway, I'll try to provide a solution to explain how to use Thai fonts in C90 (font) encoding installed in TeX Live.
    – Leo Liu
    Nov 16, 2013 at 5:24

1 Answer 1

12

To use Thai fonts, we do not need to load CJK package, but babel package.

To use the fonts in C90 encoding, we can use thaicjk option of babel package.

\documentclass{article}

\usepackage[utf8x]{inputenc}

% English is the main language
\usepackage[thaicjk,english]{babel}
\addto\extrasthaicjk{\fontencoding{C90}\selectfont}

% Hack into CJKutf8 package for an option clash error
\makeatletter
\@namedef{[email protected]}{utf8}
\makeatother
\usepackage{CJKutf8}

\begin{document}

Japanese: \begin{CJK}{UTF8}{min}結核\end{CJK}
Chinese: \begin{CJK}{UTF8}{bsmi}結核\end{CJK}
Thai: \foreignlanguage{thaicjk}{ไข้เด็งกี}

\end{document}

Or, we can also use the fonts in LTH encoding. In this case we need to use thai option of babel. See document of babel-thai.

\documentclass{article}

\usepackage[utf8x]{inputenc}

% English is the main language
\usepackage[thai,english]{babel}

% Hack into CJKutf8 package for an option clash error
\makeatletter
\@namedef{[email protected]}{utf8}
\makeatother
\usepackage{CJKutf8}

\begin{document}

Japanese: \begin{CJK}{UTF8}{min}結核\end{CJK}
Chinese: \begin{CJK}{UTF8}{bsmi}結核\end{CJK}
Thai: \textthai{ไข้เด็งกี}

\end{document}
1
  • The second example works for me, thank you. (I didn't try the first.)
    – Reid
    Nov 18, 2013 at 21:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .