I always wanted to create a beamer presentation in XeTeX. After a long time, I finally got it done, and finally generated the replicable/copy/search file.
Cable/bookmarks without garbled PDF documentation. My system is windows 7 + Texlive 2010
Currently, only simple text, illustrations, and pgf plot are tested, which is basically no problem. Other complex functions have not been tested yet. It is enough for general scenarios.
The following code is the source code in the appendix.
\ Documentclass [dvipdfm] {beamer} % if compilation gets stuck here, remove the dvipdfm option. Earlier versions require this option to pass
\ Usepackage {fontspec, xunicode, xltxtra, beamerthemesptra}
\ Usetheme {Luebeck}
\ Setsansfont [Mapping = tex-text, BoldFont = {Bold}] {}
\ Title {Beamer package and \ XeTeX application example}
\ Author {XIE Bengui (IOZ, CAS )}
\ Date {\ today}
\ Begin {document}
\ XeTeXlinebreaklocale "zh" % indicates a broken line in Chinese
\ XeTeXlinebreakskip = 0pt plus 1pt % more adjusted Space
% The following code is used to fix the invalid navigation bar button. Thank you for the LeoLiu of the CTex forum.
\ Makeatletter
\ Def \ beamer @ linkspace #1 {%
\ Begin {pgfpicture} {0pt} {-1.5pt} {#1} {5.5pt}
\ Pgfsetfillopacity {0}
\ Pgftext [x = 0pt, y =-1.5pt] {.}
\ Pgftext [x = #1, y = 5.5pt] {.}
\ End {pgfpicture }}
\ Makeatother
\ Frame {\ titlepage}
\ Section * {outline}
\ Frame {\ tableofcontents}
\ Section {introduction}
\ Subsection {Beamer class and xetex overview} % do not use \ xetex
% Write xetex directly for these complex commands.
\ Frame {
\ Frametitle {features of the Beamer class}
\ Begin {itemize}
\ Item <1-> common \ latex class
\ Item <2-> easy Overlays
\ Item <3-> external program not required
\ End {itemize}
\ XeTeXpicfile "./logo.jpg" xscaled 100 yscaled 100% illustrations are correct.
% The [options] in the \ XeTeXpicfile command use the following keywords:
% Width <dimen>
% Height <dimen>
% Scaled <scalefactor>
% Xscaled <scalefactor>
% Yscaled <scalefactor>
% Rotated <degrees>
}
\ Frame {
\ Frametitle {\ XeTeX features}
\ Begin {itemize}
\ Item <1-> supports Unicode
\ Item <2-> Generate PDF documents that can \ textbf {copy/search/without garbled bookmarks}
\ Item <3-> supports common \ LaTeX packages
\ End {itemize}
}
\ Subsection {use XeTeX and beamer to create a presentation (slide )}
\ Frame {
\ Frametitle {preparation}
\ Begin {itemize}
\ Item <1-> TexLive 2007 with \ XeTeX (\ the \ XeTeXversion \ XeTeXrevision) \ & beamer
\ Item <2-> a text editor that supports UTF-8 encoding because \ XeTeX requires source code to be stored in UTF-8 format
\ End {itemize}
}
\ End {document}
If you want to use Chinese normally in verbatim, refer to another article:
Enable verbatim environment to support Chinese Characters in XeTeX
Ps: This article was first published by myself and updated on 2011.08.27 with the color.