# 东北大学讲稿Latex模板 **Repository Path**: neucloudlab/neu-beamer-template ## Basic Information - **Project Name**: 东北大学讲稿Latex模板 - **Description**: 自用东北大学讲稿模板 - **Primary Language**: TeX/LaTeX - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 5 - **Forks**: 0 - **Created**: 2025-04-23 - **Last Updated**: 2026-05-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 自用东北大学 Beamer 模板使用说明 ## 1. 模板简介 东北大学 Beamer 模板是基于 SCU-beamer-template 修改而来的 LaTeX 演示文稿模板 SCU-beamer-template原作者为Linrong Wu. - https://github.com/FvNCCR228/SCU-Beamer-Theme - https://gitee.com/NCCR/SCU_Beamer_Slide-demo/tree/main ### 主要特性 - 支持中文和英文模式 - 提供多种主题颜色(宝石蓝, 锦绣红等) - 支持代码高亮(minted 和 listing) - 丰富的数学环境和定理区块 --- ## 2. 快速开始 ### 2.1 基本文档结构 ```latex \documentclass{beamer} \usetheme[选项]{neu} % 中文设置, 若为英文环境可以不添加下列代码,具体参见main-en.tex \usepackage[UTF8]{ctex} \setCJKsansfont[ItalicFont={楷体},BoldFont={黑体}]{宋体} % 封面信息 \title[短标题]{完整标题} \subtitle{子标题} \author[作者简称]{作者全名} \institute{机构信息} \date{\today} \begin{document} \begin{frame}{目录} \tableofcontents[hideallsubsections] \end{frame} \section{章节标题} \begin{frame}{帧标题} 内容... \end{frame} \end{document} ``` ### 2.2 编译方法 推荐latexmk完成自动化编译,vscode的编译工具配置如下 ```json // VSCode LaTeX Workshop 配置 { "latex-workshop.latex.outDir": "%DIR%/build", "latex-workshop.latex.tools": [ { "name": "latexmk", "command": "latexmk", "args": [ "-synctex=1", "-interaction=nonstopmode", "-file-line-error", "-shell-escape", "-pdf", "-8bit", "-outdir=%OUTDIR%", "%DOC%" ] }, { "name": "latexmk-cn", "command": "latexmk", "args": [ "-xelatex", "-8bit", "-synctex=1", "-shell-escape", "-interaction=nonstopmode", "-file-line-error", "-outdir=%OUTDIR%", "%DOC%" ] } ], "latex-workshop.latex.recipes": [ { "name": "latexmk", "tools": [ "latexmk", ] }, { "name": "latexmk-cn", "tools": [ "latexmk-cn", ] }, ], } ``` 由于本模板需要一定的编译时间,overleaf往往会超时,在线编译推荐使用texhub.com ---- ## 3. 模板选项 ```latex \usetheme[ ColorDisplay=BSblue, % BSblue(默认) | JXred | Custom → 主题色显示设置 CodeDisplay=minted, % minted (默认) | listing → 代码高亮显示设置, 若未配置minted Python包,请替换为listing MintedStyle=lightmode, % lightmode(默认) | darkmode | ⟨custom⟩ → minted 样式设置 (需优先设置 CodeDisplay=minted) BlockDisplay=followtheme, % followtheme(默认) | colorful| allgrey → 区块颜色显示设置 LanguageMode=cn, % en(默认) | cn → 语言模式设置, 会进一步设置术语语言 Miniframes=separate,% separate(默认) | follow | none → 页眉小节迷你帧设置 NavigationTool=1-2-3, % ⟨参考 Manual 设置⟩ | none → 页脚导航工具栏设置 BIBMode=biber, % biber(默认) | none → 参考文献引擎设置 BIBStyle=biber-gb7714, % biber-gb7714(默认) → 参考文献样式设置(设置 BIBMode=none 时无效) ContentMuticols=true, % true(默认) | false → 目录帧双栏显示设置 Background=true, % true(默认) | false → 背景显示设置, 在draft模式下无效 AutoTabofContents=both, % both (默认) | section | subsection 在哪里绘制目录进度页 LogoType=sc % neu (默认) | sc 使用何种图标, neu: 东北大学图表 sc: 东北大学软件学院图表 ]{neu} ``` ---- ## 4. 封面信息设置 ### 4.1 基本封面信息 ```latex \title[NEU beamer模板]{东北大学模板示例} \subtitle{Beamer模板使用答辩} \author[作者姓名]{示例\inst{1} \and 示例\inst{2}} \institute{% \inst{1} 示例地址1,东北大学南湖校区 ~(\textit{example@swc.neu.edu.cn}) \vspace*{-6pt} \and \inst{2} Northeastern University \\(\textit{example@mail.neu.edu.cn}) } \date{\today} ``` ### 4.2 多作者设置 使用 `\and` 命令分隔不同作者,使用 `\inst{}` 标记机构: ```latex \author[作者1, 作者2]{作者1\inst{1} \and 作者2\inst{2}} \institute{% \inst{1} 东北大学计算机学院 \vspace*{-6pt} \and \inst{2} 东北大学软件学院 } ``` ## 5. 页面元素 ### 5.1 帧环境 ```latex \begin{frame}[选项]{标题} 内容... \end{frame} ``` 常用选项: - `fragile`: 保护脆弱命令(代码环境必需) - `allowframebreaks`: 允许自动分页 - `t`: 顶部对齐(默认居中) ### 5.2 列表环境 ```latex \begin{itemize} \item 项目1 \item 项目2 \item 项目3 \end{itemize} \begin{enumerate} \item 有序项目1 \item 有序项目2 \end{enumerate} ``` ### 5.3 分栏布局 ```latex \begin{columns} \begin{column}[t]{0.35\linewidth} 栏一内容... \end{column} \begin{column}[t]{0.4\linewidth} 栏二内容... \end{column} \begin{column}[t]{0.25\linewidth} 栏三内容... \end{column} \end{columns} ``` ## 6. 图表插入 ### 6.1 单张图片 注意图片、表格、代码的插入页需要配合frame的fragile实现 ```latex \begin{figure}[h] \centering \includegraphics[width=0.6\columnwidth]{image-file} \caption{图片标题} \label{fig:label} \end{figure} ``` ### 6.2 子图排列 ```latex \begin{figure}[h] \begin{subfigure}{.4\columnwidth} \centering \includegraphics[width=\columnwidth]{image1} \caption{子图1} \end{subfigure} \quad \begin{subfigure}{.4\columnwidth} \centering \includegraphics[width=\columnwidth]{image2} \caption{子图2} \end{subfigure} \caption{总标题} \end{figure} ``` ### 6.3 三线表格 ```latex \begin{table}[htbp] \centering \caption{表格标题} \label{tab:label} \begin{tabular}{rlc} \toprule 列1 & 列2 & 列3 \\ \midrule 数据1 & 数据2 & 数据3 \\ 数据4 & 数据5 & 数据6 \\ \bottomrule \end{tabular} \end{table} ``` ## 7. 代码环境 ### 7.1 代码区块 ```latex \begin{neucode}{标题}[label]{语言} 代码内容... \end{neucode} ``` 示例: ```latex \begin{neucode}{Hello World程序}[helloworld]{c} #include int main() { printf("Hello World!"); return 0; } \end{neucode} ``` ### 7.2 从文件读入代码 ```latex \neucodeinput{标题}[label]{语言}{filename} ``` ## 8. 数学环境 ### 8.1 定理类环境 ```latex \begin{neutheorem}{定理标题}[label] 定理内容... \end{neutheorem} \begin{neuproof}{证明标题}[label] 证明内容... \end{neuproof} \begin{neuexample}{示例标题}[label] 示例内容... \end{neuexample} ``` ### 8.2 可用环境列表 | 环境名称 | 命令 | 标签前缀 | |---------|------|----------| | 定理 | `neutheorem` | `theo:` | | 证明 | `neuproof` | 无 | | 示例 | `neuexample` | `exam:` | | 定义 | `neudefinition` | `def:` | | 算法 | `neualgorithm` | `algo:` | | 引理 | `neulemma` | `lemm:` | | 推论 | `neucorollary` | `coro:` | ### 8.3 数学公式 ```latex % 行内公式 $f(x) = x^2 + 2x + 1$ % 行间公式 \[ E = mc^2 \] % 编号公式 \begin{equation} v_{rms} = \sqrt{\frac{3kT}{\mu}} \end{equation} % 多行公式 \begin{align} x &= a + b \\ y &= c + d \end{align} ``` ## 9. 交叉引用 ### 9.1 引用命令 | 命令 | 显示内容 | 示例 | |------|----------|------| | `\ref{label}` | 序号 | 1.1 | | `\nameref{label}` | 标题 | 章节标题 | | `\vref{label}` | 标题+页码 | 图1见第5页 | | `\cref{label}` | 类型+序号 | 图1.1 | | `\pageref{label}` | 页码 | 5 | ### 9.2 引用前缀约定 - 图片: `fig:` - 表格: `tab:` - 代码: `code:` - 定理: `theo:` - 算法: `algo:` ## 10. 参考文献 ### 10.1 基本引用 ```latex 虚拟偶像研究\cite{ref1},多篇引用\cite{ref1,ref2}。 % 脚注引用 虚拟偶像\footnote{这是脚注内容}。 虚拟偶像\footfullcite[页码]{ref1}。 ``` ### 10.2 参考文献列表 ```latex \begin{frame}[allowframebreaks]{参考文献} \printbibliography[heading=none] \end{frame} ``` ## 11. 编译注意事项 ### 11.1 minted 配置 1. 安装 Python 和 Pygments: ```bash pip install Pygments ``` 2. 编译时添加 `-shell-escape` 和 `-8bit` 参数 ### 11.2 常见问题 **问题1**: `\verb` 命令报错 **解决**: 在 frame 环境中添加 `[fragile]` 选项 **问题2**: 参考文献空白 **解决**: 确保使用 biber 引擎编译 **问题3**: 迷你帧不显示 **解决**: 多次编译文档 ## 12. 进阶功能 ### 12.1 动画效果 使用 `\pause` 命令创建逐项显示效果: ```latex \begin{itemize}[<+-| alert@+>] \item 第一项 \item 第二项 \item 第三项 \end{itemize} ``` ### 12.2 自定义颜色 ```latex \definecolor{mycolor}{RGB}{255,0,0} \textcolor{mycolor}{自定义颜色文本} ``` ### 12.3 TikZ 绘图 建议单独创建 TikZ 图形文件并通过 `\input` 引入: ```latex \begin{figure}[h] \resizebox{.8\textwidth}{!}{\input{tikz-figure.tex}} \caption{TikZ 图形} \end{figure} ``` ## 13. 文件结构 ``` NEU-Beamer-Template/ ├── fonts/ # 字体文件 ├── image/ # 图片资源 ├── main.tex # 主文档(中文) ├── main-en.tex # 主文档(英文) ├── ref.bib # 参考文献数据库 └── beamerthemeneu.sty # 主题文件 ``` ## 14. 更新日志 ### v3.0.1 - 修复语言相关内容,当前 main-en.tex 仅需 pdflatex 编译 - 修改中文字体设置位置,从而应对不同字体 - 设定英文和数学字体为 serif 字体,不再支持自定义 - 支持 beamer 的 draft(草稿)编译选项,加速编译 - 支持不同的 aspectratio 参数 ### v3.0.2 - 增加 AutoTabofContents 参数 ### v3.0.3 - 代码重新模块化处理 - 修复 miniframes 显示 bug ### v3.0.4 - 增加 LogoType 区别东北大学和东北大学软件学院两套图表 - 修复图/表题注的中文显示问题 - 增加自定义 neucustom 盒子,并统一样式 ## 15.字体/tikz学习下载地址: 下载地址: - 百度网盘: - https://pan.baidu.com/s/1Tz7EfdhQVOR7el4GY1hSJg?pwd=4bek - 夸克网盘: - 链接:https://pan.quark.cn/s/9dff7711747e - 提取码:EaDX *本模板基于 SCU-beamer-template 修改,感谢原作者的贡献。*