# Are there any good Chinese beamer templates available for Linux TeX Live users?

I have tested a few templates trying to write slides containing Chinese words with TeX Live (from Ubuntu 11.10 repositories). However, it always turned out that some macros were not found despite that the latex-cjk-all package has been installed. So I would like to know whether there are some nice templates for Linux users.

-
– Leo Liu Feb 25 '12 at 9:09
Just use beamer with any CJK support above available on your system. Ubuntu has outdated texlive package, you'd better not use it. – Leo Liu Feb 25 '12 at 9:14
@LeoLiu Could you make your comments here into an answer? – Joseph Wright Aug 6 '12 at 8:38
@JosephWright: Done. – Leo Liu Aug 6 '12 at 14:00
@LeoLiu thanks so much for your answers below. – Hongxu Chen Aug 7 '12 at 9:12

There's nothing new in beamer.

## Recommended solution:

% Compile with XeLaTeX, with Chinese fonts installed with Windows as default.
\documentclass{beamer}
\usepackage[noindent,UTF8]{ctexcap}
\renewcommand\CJKfamilydefault{\CJKsfdefault}
\begin{document}

\begin{frame}{中文}

\end{frame}

\end{document}


If you use latest version of ctex package in the SVN trunk, the solution can be also compile with pdfLaTeX. (In fact the solution can be compiled with latex/pdflatex if we don't change \CJKfamilydefault.)

For Linux users, one may have to specify the fonts explictly:

\usepackage[nofonts,noindent,UTF8]{ctexcap}
\renewcommand\CJKfamilydefault{\CJKsfdefault}
\setCJKsansfont{WenQuanYi Zen Hei}


## Solution using raw xeCJK

Everything is similar except that one must specify the Chinese fonts explictly.

% UTF-8 encoding, compile with XeLaTeX
\documentclass{beamer}
\usepackage{xeCJK}
\renewcommand\CJKfamilydefault{\CJKsfdefault}
\setCJKsansfont{Microsoft YaHei}
\begin{document}

\begin{frame}{中文}

\end{frame}

\end{document}


The font Microsoft YaHei can be replaced with any font. For example Linux users may prefer

\renewcommand\CJKfamilydefault{\CJKsfdefault}
\setCJKsansfont{WenQuanYi Zen Hei}


or just

\setCJKmainfont{WenQuanYi Zen Hei}


Only XeLaTeX solutions are provided here. These solutions are more mature and easier to use than other solutions using CJK (for pdfLaTeX) or luatex-ja (for LuaLaTeX). Anyway you may refer other sources to use them.

-