Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
3  
Related: How does one type Chinese in LaTeX? –  Leo Liu Feb 25 '12 at 9:09
2  
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

1 Answer 1

up vote 7 down vote accepted

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}{中文}
在 beamer 中使用中文。
\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}{中文}
在 beamer 中使用中文在 beamer 中使用中文。
\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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.