在这里整理一些做LaTeX PPT常用的代码以便复制
头文件 头文件加载及主题配置: 1 2 3 4 5 \documentclass {beamer} \usepackage {beamerthemesplit} \usetheme {Warsaw}\usecolortheme {seahorse}\usecolortheme [RGB={218,112,214}]{structure}
导入宏包: 1 2 3 4 5 6 7 8 9 10 \usepackage [utf8]{inputenc}\usepackage {ctex}\usepackage {tikz}\usepackage {subfigure}\usepackage {graphicx}\usepackage {float}\usepackage [style=verbose-ibid,backend=biber]{biblatex}\addbibresource {XXX.bib}
对主题进行微调: 调整格式细节: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 \setbeamerfont {caption}{size=\footnotesize }\setbeamertemplate {caption}[numbered] \usefonttheme [onlymath]{serif} \AtBeginSubsection []{ \begin {frame} \transfade \tableofcontents [sectionstyle=show/shaded,subsectionstyle=show/shaded/hide] \addtocounter {framenumber}{-1} \end {frame} } \AtBeginSection []{ \begin {frame} \transfade \tableofcontents [sectionstyle=show/shaded,subsectionstyle=show/shaded/hide] \addtocounter {framenumber}{-1} \end {frame} }
自定义颜色: 1 2 3 4 5 6 7 8 9 10 \definecolor {mpurple}{HTML}{d9b8f1}\definecolor {mlightpurple}{HTML}{F5F2FF}\definecolor {mblue}{HTML}{b8f1ed}\definecolor {mlightblue}{HTML}{F2FFFE}\definecolor {mgreen}{HTML}{b8f1cc}\definecolor {mlightgreen}{HTML}{F2FFF6}\definecolor {mblue}{RGB}{0,0,225}
自定义块及列表样式: 1 2 3 4 5 6 7 8 9 10 11 12 \setbeamercolor {block body}{fg=black,bg=mlightpurple}\setbeamercolor {block title}{fg=black,bg=mpurple}\setbeamercolor {block body alerted}{fg=black,bg=mlightblue}\setbeamercolor {block title alerted}{fg=black,bg=mblue}\setbeamercolor {block body example}{fg=black,bg=mlightgreen}\setbeamercolor {block title example}{fg=black,bg=mgreen}\setbeamertemplate {enumerate items}[circle]
页脚: 三段式页脚 包含:作者,标题,页码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 \defbeamertemplate {footline}{NGEGFootlineTemplate}{ \leavevmode \hbox { \begin {beamercolorbox}[wd=0.2\paperwidth ,ht=2.25ex,dp=1ex,center]{author in head/foot} \ifnum \the \value {page}>1 \usebeamerfont {author in head/foot}\insertshortauthor \fi \end {beamercolorbox} \begin {beamercolorbox}[wd=0.6\paperwidth ,ht=2.25ex,dp=1ex,center]{title in head/foot} \ifnum \the \value {page}>1 \usebeamerfont {title in head/foot}\insertshorttitle \fi \end {beamercolorbox} \begin {beamercolorbox}[wd=0.2\paperwidth ,ht=2.25ex,dp=1ex,center]{author in head/foot} \ifnum \the \value {page}>1 \insertframenumber {} / \inserttotalframenumber \fi \end {beamercolorbox}} } \setbeamertemplate {footline}[NGEGFootlineTemplate]
简介页脚 只含右下角页码,以便给脚注留出空间
1 2 3 4 5 6 7 \renewcommand {\footnotesize }{\tiny }\setbeamertemplate {footline}{ \hfill \insertframenumber {} / \inserttotalframenumber \hspace *{2ex} \vskip 6pt }
文档开始: 1 2 \begin {document}\end {document}
个人信息: 1 2 3 4 5 6 7 8 9 10 11 12 \title {XXX} \author [XXX]{XXX}\institute [*]{XX大学XX系}\date {\today }\begin {frame} \titlepage \end {frame}\begin {frame} \tableofcontents \end {frame}
文档内部常用代码 新建PPT页面 1 2 \begin {frame}\end {frame}
标题 1 2 3 \section {XXX}\subsection {XXX}\frametitle {XXX}
插入定理块 1 2 3 4 5 6 7 8 9 10 11 \begin {block}{定理标题} 定理内容 \end {block}\begin {alertblock}{定理标题}定理内容 \end {alertblock}\begin {exampleblock}{定理标题}定理内容 \end {exampleblock}
插入图片 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 \begin {figure} \centering \includegraphics [width=\textwidth ]{figure1.png} \caption {XXX} \end {figure}可选: \includegraphics {test} \includegraphics {logo} \includegraphics [scale=0.3]{test} \includegraphics [scale=0.03]{logo} \includegraphics [height=2cm]{test} \includegraphics [height=2cm]{logo} \includegraphics [height=0.01\textheight ]{test} \includegraphics [height=0.01\textheight ]{logo} \includegraphics [width=2cm]{test} \includegraphics [width=2cm]{logo} \includegraphics [width=0.01\textwidth ]{test} \includegraphics [width=0.01\textwidth ]{logo} \includegraphics [angle=-45,width=0.2\textwidth ]{test} \includegraphics [angle=-45,width=0.2\textwidth ]{logo} \begin {figure}[!h] \centering \begin {subfigure} \centering \includegraphics [height=0.45\columnwidth ]{figure1.png} \caption {XXX} \end {subfigure} \begin {subfigure} \centering \includegraphics [height=0.45\columnwidth ]{figure4.png} \caption {XXX} \end {subfigure} \end {figure}插入子图: \begin {figure}[!h] \centering \subfigure [子图名]{ \centering \includegraphics [width=0.3\textwidth ]{Brange_ 1D.png} } \subfigure [子图名]{ \centering \includegraphics [width=0.3\textwidth ]{Brange_ 2D.png} } \subfigure [子图名]{ \centering \includegraphics [width=0.3\textwidth ]{Brange_ 3D.png} } \caption {图标题} \end {figure}
常用词汇:
1 2 3 4 \text \column height width
脚注
1 2 3 4 5 6 \footnotemark \footnotetext \footnotetext {\fullcite {XXX}}
PPT排版与调整 页面顶格开始书写 1 2 \begin {frame}[t]\end {frame}
行间距 1 2 3 4 5 6 7 8 \usepackage {setspace}\singlespacing \onehalfspacing \doublespacing \linespread {1.5}\vspace {20pt}\setlength {\baselineskip }{1.5\baselineskip }
分栏 1 2 3 \begin {columns}\column {0.5\textwidth }\end {columns}
字体大小 1 2 3 4 5 6 7 8 9 10 {\tiny 小小} {\scriptsize 脚注} {\footnotesize 脚注} {\small 小} {\normalsize 正常} {\large 大} {\Large 更大} {\LARGE 极大} {\huge 巨大} {\Huge 宇宙}
结尾文档 参考文献 1 2 3 4 5 6 7 8 9 \textsuperscript {\cite {_ 2006_ }}\cite {_ 2006_ }\footfullcite {_ 2006_ }\appendix \begin {frame}[t, allowframebreaks]{References}\small \printbibliography \end {frame}