6 Commits
6 changed files with 124 additions and 20 deletions
+67 -1
View File
@@ -1,3 +1,69 @@
report.aux
## LaTeX 编译中间文件
# 主文件对应的所有辅助文件
report.aux
report.log
report.toc
report.lof
report.lot
report.out
report.synctex.gz
report.synctex(busy)
report.fls
report.fdb_latexmk
report.xdv
report.bbl
report.blg
report.spl
report.idx
report.ilg
report.ind
report.nav
report.snm
report.vrb
report.lol
report.lox
report.glo
report.ist
report.acn
report.acr
report.alg
report.gls
report.glsdefs
report.run.xml
report.bcf
report.tag
report.maf
report.mtc*
report.ttt
report.ptc*
# 通用模式(覆盖所有文件名)
*.aux
*.log
*.toc
*.lof
*.lot
*.out
*.synctex.gz
*.fls
*.fdb_latexmk
*.xdv
*.bbl
*.blg
*.idx
*.ilg
*.ind
*.nav
*.snm
*.vrb
*.lol
*.glo
*.glg
*.gls
*.ist
*.bcf
*.run.xml
# 保留 PDF 成品
!report.pdf
+57 -2
View File
@@ -1,3 +1,58 @@
# 中国海洋大学科技报告Latex模板
# 中国海洋大学科技报告 LaTeX 模板
科技报告模板,可以用来撰写科技报告、教程、说明文档等。
一个基于 `ctexart`科技报告模板,可用于撰写科技报告、实验讲义、教程、说明文档等。由 DrYangyangyq@ouc.edu.cn)创建。
## 特性
- **中英文字体一体化**:英文默认使用鸿蒙字体(HarmonyOS Sans),中文使用方正书宋 / 小标宋 / 楷体 / 仿宋 / 中等线,字体文件随模板附于 `font/` 目录,编译时自动调用,**无须安装任何字体**;
- **模块化文档类**`report.cls` 按功能拆分为 `cls/` 下的多个模块(全局设定、字体、页面布局、标题、页眉页脚、信息框、代码块等),便于按需修改;
- **三种信息框**`titledbox`(带标题)、`notebox`(提示)、`importantbox`(重要),基于 tcolorbox 实现;
- **代码排版**:基于 listings 预设了多种样式,支持行内命令 `shellbox` / `invertedshellbox` 展示 shell 命令及输出;
- **自动水印**:默认以「单位 + 部门」作为全页水印,可在 `input/setting.tex` 中调整文字、透明度与大小;
- **图表与引用**:tabularx 表格、图片插入、自动编号与交叉引用、目录 / 图目录 / 表目录;
- **图标支持**:通过 fontawesome 可直接使用 `\faHeart` 等图标命令(详见根目录 `fontawesome.pdf`)。
## 环境要求
- **TeX 发行版**TeX Live 2022 及以上(必须使用 **XeLaTeX** 编译);
- 无需额外安装字体或其他依赖,使用 `scheme-full` 或包含常用宏包的发行版即可。
## 使用方法
1. 克隆仓库,在 `input/info.tex` 中填写标题、副标题、作者、单位、部门等信息;
2.`report.tex` 中撰写正文(或按 `\input` 方式组织章节文件);
3. 使用 XeLaTeX 编译**两遍**(第一遍生成目录与交叉引用信息,第二遍写入正文):
```bash
xelatex report.tex
xelatex report.tex
```
4. 临时切换字体可使用命令:`\fzss`(方正书宋)、`\fzxbs`(方正小标宋)、`\fzkai`(方正楷体)、`\fzfs`(方正仿宋)、`\fzzdx`(方正中等线)、`\hm`(鸿蒙字体)。
## TeX Live 版本兼容性分支
模板按能通过编译的 TeX Live 年份维护分支,`main` 始终为最新版本:
| 分支 | 兼容的 TeX Live | 说明 |
|------|----------------|------|
| `2022` | TeX Live 2022 | 基线版本 |
| `2023` | TeX Live 2023 | 已验证通过 |
| `2024` | TeX Live 2024 | 已验证通过 |
| `2025` | TeX Live 2025 | 已验证通过 |
| `2026` | TeX Live 2026 | 已验证通过(与 `main` 同步) |
如需在特定年份的 TeX Live 下使用,请切换到对应分支。在新版 TeX Live 下发现编译问题时,欢迎反馈。
## 目录结构
```
.
├── report.cls # 文档类(模块化加载 cls/ 下各子模块)
├── cls/ # 功能模块:全局设定、字体、页面、标题、信息框、代码块等
├── input/ # 文档内容:封面、目录、摘要、信息与整体设置
├── figs/ # 图片资源
├── font/ # 鸿蒙及方正字体文件(自动加载)
├── fontawesome.pdf # fontawesome 图标使用手册
└── report.tex # 主文件(XeLaTeX 编译入口)
```
-2
View File
@@ -1,2 +0,0 @@
\contentsline {figure}{\numberline {1}{\ignorespaces 这是一个示例图片\relax }}{3}{figure.caption.2}%
\contentsfinish
-2
View File
@@ -1,2 +0,0 @@
\contentsline {table}{\numberline {1}{\ignorespaces 一个表格的实例\relax }}{2}{table.caption.1}%
\contentsfinish
BIN
View File
Binary file not shown.
-13
View File
@@ -1,13 +0,0 @@
\contentsline {section}{\numberline {1.}准备工作}{1}{section.1}%
\contentsline {section}{\numberline {2.}字体}{1}{section.2}%
\contentsline {section}{\numberline {3.}标题}{1}{section.3}%
\contentsline {subsection}{\numberline {3.1}这里是二级标题}{1}{subsection.3.1}%
\contentsline {subsubsection}{\numberline {3.1.1}这里是三级标题}{1}{subsubsection.3.1.1}%
\contentsline {section}{\numberline {4.}列表}{1}{section.4}%
\contentsline {subsection}{\numberline {4.1}无序列表}{1}{subsection.4.1}%
\contentsline {subsection}{\numberline {4.2}有序列表}{2}{subsection.4.2}%
\contentsline {section}{\numberline {5.}图表信息}{2}{section.5}%
\contentsline {section}{\numberline {6.}代码}{3}{section.6}%
\contentsline {section}{\numberline {7.}文本框}{4}{section.7}%
\contentsline {section}{\numberline {8.}图标}{5}{section.8}%
\contentsfinish