├── .gitignore ├── .vscode └── settings.json ├── Picture └── Logo.jpg ├── 中国农业大学课程论文写作格式.doc ├── CAU-Course-Thesis-Template.pdf ├── README.md ├── Change Log.md ├── bibsource.bib ├── CAU-Course-Thesis-Template.tex └── cauthesis.cls /.gitignore: -------------------------------------------------------------------------------- 1 | 方案 2 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /Picture/Logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cdmium/CAUTemplate/HEAD/Picture/Logo.jpg -------------------------------------------------------------------------------- /中国农业大学课程论文写作格式.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cdmium/CAUTemplate/HEAD/中国农业大学课程论文写作格式.doc -------------------------------------------------------------------------------- /CAU-Course-Thesis-Template.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cdmium/CAUTemplate/HEAD/CAU-Course-Thesis-Template.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CAUTemplate 2 | China Agricultural University Course Thesis LaTeX Template 3 | 中国农业大学课程论文模板 4 | ## 功能 5 | - 自动生成中国农业大学课程论文封面 6 | - 自动填入封面信息或生成指定空白行 7 | - 自动生成目录 8 | - 自动控制格式 9 | - 使用bibLaTeX生成参考文献 10 | - 定义两个层次enumerate环境 11 | ## 说明 12 | - 编译中文需要使用XeLaTeX进行编译,参考文献使用biber(BibLaTeX)进行编译,推荐编译链为XeLaTeX -> biber -> XeLaTeX*2 13 | - 推荐使用最新的TeX Live套件,或者MiKTex套件。cTeX套件多年未进行更新,其中的ctex宏包版本过老,没有\zihao{}指令,无法使用此模板。 14 | - 默认使用思源字体(Noto)与方正字体,对字体有需要的请自行.cls文件中更改 15 | -------------------------------------------------------------------------------- /Change Log.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | ## 2020-08-06 v1.4 4 | ### 模板文件 5 | #### 修改 6 | - 更改默认字体为思源和方正字体 7 | ### 说明指南 8 | #### 增加 9 | - 增加字体说明 10 | 11 | ## 2020-08-06 v1.3 12 | ### 模板文件 13 | #### 修复 14 | - 修改 15 | ### 说明指南 16 | #### 增加 17 | - 增加LaTeX套件说明 18 | 19 | ## 2018-12-24 v1.2 20 | ### 模板文件 21 | #### 修复 22 | - 页码无法正常显示 23 | #### 更改 24 | - 修改footskip大小,使页码位置更合理 25 | ### 说明指南 26 | #### 增加 27 | - 版本更新地址链接 28 | #### 修复 29 | - 错别字与语法错误 30 | 31 | ### Class file 32 | #### Fixed 33 | - Page number error 34 | #### Modified 35 | - Modify value of footskip to make page number display at a more suitable position 36 | ### Manual 37 | #### Added 38 | - URL link for Change Log 39 | #### Fixed 40 | - Typo and grammatical error 41 | 42 | ## 2018-10-24 v1.1 43 | ### 说明指南 44 | #### 增加 45 | - 版本标记 46 | #### 修复 47 | - 表格错误 48 | 49 | ### Manual 50 | #### Added 51 | - Version sign 52 | #### Fixed 53 | - Table error 54 | -------------------------------------------------------------------------------- /bibsource.bib: -------------------------------------------------------------------------------- 1 | @Online{Huzhenzhen2018, 2 | Title = {\LaTeX{}文档中文参考文献的biblatex解决方案}, 3 | Author = {胡振震}, 4 | Volume = {}, 5 | Number = {}, 6 | Year = {2018}, 7 | Journaltitle = {}, 8 | Pages = {}, 9 | Url = {https://github.com/hushidong/biblatex-solution-to-latex-bibliography} 10 | } 11 | @Book{王夫之1845--, 12 | Title = {宋论}, 13 | Author = {王夫之}, 14 | Edition = {刻本}, 15 | Publisher = {曾氏}, 16 | Location = {金陵}, 17 | Year = {1845(清同治四年)} 18 | } 19 | @Book{汪昂1881--, 20 | Title = {增订本草备要:四卷}, 21 | Address = {京都}, 22 | Author = {汪昂}, 23 | Edition = {刻本}, 24 | Publisher = {老二酉堂}, 25 | Location = {上海}, 26 | Year = {1881(清光绪七年)} 27 | } 28 | @Article{KENNEDY1975-339-360, 29 | Title = {Morphology and genesis of nodular chalks and hardgrounds in the Upper 30 | Cretacesous of southern England}, 31 | Author = {W. J. KENNEDY and R. E. GARRISON}, 32 | Date = {1975}, 33 | Journaltitle = {Lethaia}, 34 | Pages = {339-360}, 35 | Volume = {8} 36 | } -------------------------------------------------------------------------------- /CAU-Course-Thesis-Template.tex: -------------------------------------------------------------------------------- 1 | \documentclass[twoside,maketable]{cauthesis} 2 | %% oneside 用于单面打印(默认值) 3 | %% twoside 用于双面打印,在标题页后会生成空白页,清除双数页。注:正规的课程论文应使用单面打印 4 | %% maketable 在摘要后打印目录 5 | \addbibresource{./bibsource.bib}%添加bib文件 6 | \title{中国农业大学课程论文\LaTeX{}模板}%输入标题 7 | \date{}%用于清除标题下的时间 8 | \author{}%用于清除标题下作者 9 | \tpitem{%请使用英文分号隔开,请严格按照格式填写 10 | 论文题目;2;%输入2生成2行空白下划线 11 | 课程名称;1;%输入1生成1行空白下划线 12 | 任课老师;0;老师;%输入0并输入第三项自动填写内容 13 | 班级;0;班级; 14 | 学号;0;0123456789012; 15 | 姓名;0;姓名; 16 | 测试信息;0;测试过长信息会自动换行;%信息过长会自动换行 17 | }%无法输入过多信息,会引起错误,如有需求,可以手动修改cauthesis.cls中标记%1%处(修改信息与上方文字空白距离)或%2%处(信息行间距) 18 | \schoolyear{2018-2019}%输入学年信息,注释此命令为“20 -20 ” 19 | \semester{秋}%输入学期信息,注释此命令为“ ” 20 | \zhabstract{ 21 | 这是使用\LaTeX{}编写的中国农业大学课程论文模板,参照中国农业大学课程论文格式编写(吐槽下,教务处的文件打不开),制作了可自定义的封面 22 | 添加了Bib\LaTeX{}宏包作为文献引用,同时添加了许多常用宏包。 23 | 24 | 编写过程主要参考胡振震编写的模板\cite{Huzhenzhen2018}。 25 | }%填写中文摘要 26 | \zhkeywords{\LaTeX{};中国农业大学;课程论文模板}%填写中文关键词,使用英文分号隔开 27 | \enabstract{ 28 | This the China Agricultural University Course Thesis \LaTeX{} Template. 29 | This template is made according to China Agricultural University course thesis writing format. 30 | Customizable title page is available. 31 | Bib\LaTeX{} marco is used to produce bibliography. 32 | 33 | The template made by HU Zhenzhen is used as the main reference in the process\cite{Huzhenzhen2018}. 34 | }%填写英文摘要,删除此命令可取消显示英文摘要和英文关键词 35 | \enkeywords{\LaTeX{};China Agricultural University;Thesis template}%填写英文关键词,使用英文分号隔开 36 | \begin{document} 37 | \section{引言} 38 | \LaTeX{}是应该是世界上目前最专业的论文写作软件,有很完备的系统,以及数千的宏包支持,许多顶级期刊只接收\TeX{}格式的投稿,很多大学都有官方的\LaTeX{}模板。 39 | 在中国\LaTeX{}的使用并不算普遍,为了方便之后课程论文的写作,同时推广\LaTeX{}的使用,编写了此模板。 40 | 此模板可以解决课程论文的写作,并对一些复杂功能提供简便的使用。 41 | \section{声明} 42 | 本模板根据中国农业大学课程论文格式制作,设计供中国农业大学学生使用。 43 | 44 | 当前版本为2018/12/24 v1.2 45 | 46 | 本模板是以article为基类,并加载ctex中文环境和xeCJKfntef中文字体。 47 | 使用与article.cls基本相同,但必须保存为UTF8编码,建议使用\XeLaTeX{}+biber进行编译,建议的编译链为\XeLaTeX{}->biber->\XeLaTeX{}*2。 48 | 49 | 模板加载了多种常用宏包,部分为实现模板所必须,其余可自行根据需要关闭或添加。 50 | 51 | 模板发行包包括以下文件: 52 | 53 | \begin{table}[H] 54 | \begin{tabular}{ll} 55 | cauthesis.cls & 模板主文件(必须) \\ 56 | CAU-Course-Thesis-Template.tex & 本文件源文件 \\ 57 | CAU-Course-Thesis-Template.pdf & 本文件 \\ 58 | bibsource.bib & 参考内容 \\ 59 | gb7714-2015.bbx & 参考文献模板 \\ 60 | Logo.jpg & 校徽 \\ 61 | 中国农业大学课程论文写作格式.doc & 编写模板的依据 62 | \end{tabular} 63 | \end{table} 64 | 65 | 模板的最新版本可以通过\url{https://github.com/Cdmium/CAUTemplate}获取。 66 | 67 | 有关模板的任何内容,如Bug提交、功能建议等均可通过GitHub或邮箱\url{yanyuxuan@cau.edu.cn}联系作者。 68 | 69 | 版本更新记录\url{https://github.com/Cdmium/CAUTemplate/blob/master/Change%20Log.md}。 70 | 71 | 本模板是LPPL协议下的项目,全文可在\url{https://www.latex-project.org/lppl.txt}查看。 72 | 73 | 重要声明: 74 | \begin{level}{1} 75 | \item 任何个人和团体可以无限制的自由使用和更改此模板 76 | \item 本模板为非官方模板,模板作者对使用该模板所引起的后果不负任何责任 77 | \end{level} 78 | 79 | \section{使用} 80 | 为了增加模板文件的兼容性,没有添加listing宏包,在本文中添加代码和说明,使用时请参照源文件使用。 81 | 更多功能和方法请参考lshort、The TeX Book及宏包手册。 82 | 83 | \subsection{插入图片} 84 | 图\ref{fig:1}%引用 85 | \begin{figure}[H] 86 | \centering 87 | \includegraphics{./Picture/Logo.jpg} 88 | \figcaption{演示插入图片}%建议使用定义好的\figcaption{}可以避免出现错误 89 | \label{fig:1}%引用标记 90 | \end{figure} 91 | 92 | \subsection{插入表格} 93 | 表\ref{tab:1}%引用 94 | \begin{table}[H] 95 | \centering 96 | \begin{tabular}{lc} 97 | \hline 98 | Atom & Radius(nm) \\ 99 | \hline 100 | Hydrogen & 0.12 \\ 101 | Oxygen & 0.14 \\ 102 | Nitrogen & 0.15 \\ 103 | Carbon & 0.17 \\ 104 | Sulfur & 0.18 \\ 105 | Phosphorus & 0.19 \\ 106 | \hline 107 | \end{tabular} 108 | \tabcaption{演示插入表格}%建议使用定义好的\tabcaption{}可以避免出现错误 109 | \label{tab:1}%引用标记 110 | \end{table} 111 | 112 | \subsection{参考文献} 113 | \cite{王夫之1845--}\cite{KENNEDY1975-339-360}%使用\cite{}引用bib文件中的内容 114 | \nocite{汪昂1881--}%使用\nocite{}引用但不会在文中显示[1],最后参考文献会显示 115 | %可以使用\nocite{*}一次引用所有内容 116 | 117 | \subsection{层次使用} 118 | 定义了具有两个层次的带序号的罗列环境,基于enumerate环境, 119 | \begin{level}{1} 120 | \item 层次一标题 121 | \begin{level}{2} 122 | \item 层次二标题 123 | \item \ldots 124 | \end{level} 125 | \item \ldots 126 | \end{level} 127 | 128 | \section{宏包列表} 129 | \begin{center} 130 | \begin{supertabular}{lll} 131 | \hline 132 | 宏包名称&功能&状态\\ 133 | \hline 134 | geometry&控制页面布局&必须\\ 135 | graghicx&插入图片&必须\\ 136 | placeins&控制浮动体浮动范围&可选默认开启\\ 137 | etoolbox&编程辅助&必须\\ 138 | ifthen&编程辅助&必须\\ 139 | ulem&多种字体修饰&必须\\ 140 | array&表格拓展&必须\\ 141 | \hline 142 | hyperref&超链接&必须\\ 143 | titleref&章节标题超链接&必须\\ 144 | fontspec&英文字体&必须\\ 145 | ctex&中文环境&必须\\ 146 | xeCJKfntef&中文字体&必须\\ 147 | titlesec&章节标题格式&必须\\ 148 | \hline 149 | bbding&特殊字体&可选默认开启\\ 150 | pifont&特殊字体&可选默认开启\\ 151 | xltxtra&特殊文本&可选默认开启\\ 152 | mfloho&特殊文本&可选默认开启\\ 153 | texames&特殊文本&可选默认开启\\ 154 | \hline 155 | amsmath&数学&可选默认开启\\ 156 | amssymb&数学&可选默认开启\\ 157 | mathrsfs&数学字体&可选默认开启\\ 158 | \hline 159 | xcolor&颜色控制&必须\\ 160 | pgf&绘图&必须\\ 161 | tikz&绘图&必须\\ 162 | pgfplots&统计图&可选默认关闭\\ 163 | pgftable&统计图表格&可选默认关闭\\ 164 | \hline 165 | float&浮动体&必须\\ 166 | multirow&表格合并行&可选默认开启\\ 167 | booktabs&表格加强&可选默认开启\\ 168 | longtable&长表格&可选默认关闭\\ 169 | supertabular&跨页表格&可选默认开启\\ 170 | tabularx&表格加强&必须\\ 171 | subfigure&子图片&可选默认开启\\ 172 | \hline 173 | ccpation&说明文字加强&必须\\ 174 | url&网址&必须\\ 175 | biblatex&参考文献&必须\\ 176 | enumitem&罗列加强&必须\\ 177 | \hline 178 | \end{supertabular} 179 | \end{center} 180 | 181 | \section{测试一级标题} 182 | \subsection{测试二级标题} 183 | \subsubsection{测试三级标题} 184 | 185 | \specialsection{致谢}%使用\specialsection{}生成没有编号但编入目录的章节。 186 | %请勿在此section下添加subsection或subsubsection会产生标号紊乱。 187 | \printbibliography%打印引用文献 188 | \end{document} -------------------------------------------------------------------------------- /cauthesis.cls: -------------------------------------------------------------------------------- 1 | %% cauthesis.cls 2 | %% Copyright 2018 阎彧萱 3 | %% 4 | %% This work may be distributed and/or modified under the 5 | %% conditions of the LaTeX Project Public License, either version 1.3 6 | %% of this license or (at your option) any later version. 7 | %% The latest version of this license is in 8 | %% https://www.latex-project.org/lppl.txt 9 | %% and version 1.3 or later is part of all distributions of LaTeX 10 | %% version 2005/12/01 or later. 11 | %% 12 | %% This work has the LPPL maintenance status `maintained'. 13 | %% 14 | %% The Current Maintainer of this work is 阎彧萱. 15 | %% 16 | %% This work consists of the file cauthesis.cls 17 | %% and the derived files: 18 | %% Logo.jpg 19 | %% CAU_Course_Thesis_Template.tex 20 | %% CAU_Course_Thesis_Template.pdf 21 | %% gb7714-2015.bbx 22 | %% 中国农业大学课程论文写作格式.doc 23 | %% --------------------------------------------------------------------------- 24 | %% Class Name : cauthesis 25 | %% Description : China Agricultural University Course Thesis LaTeX Template 26 | %% Repository : https://github.com/Cdmium/CAUTemplate 27 | %% Version : 1.2 28 | %% Copyright : 2018 阎彧萱 29 | %% E-mail : yanyuxuan@cau.edu.cn 30 | %% License : LaTeX Project Public License v1.3c or later 31 | %% License URI : https://www.latex-project.org/lppl.txt 32 | %% Files : cauthesis.cls 33 | %% Logo.jpg 34 | %% CAU_Course_Thesis_Template.tex 35 | %% CAU_Course_Thesis_Template.pdf 36 | %% 中国农业大学课程论文写作格式.doc 37 | %% --------------------------------------------------------------------------- 38 | %% 39 | \NeedsTeXFormat{LaTeX2e} 40 | \ProvidesClass{cauthesis}% 41 | [2018/12/24 v1.2 China Agricultural University Course Thesis LaTeX Template] 42 | \newif\if@oneside\@onesidefalse 43 | \newif\if@twoside\@twosidefalse 44 | \newif\if@clearaftp\@clearaftpfalse 45 | \newif\if@maketable\@maketablefalse 46 | \DeclareOption{oneside}{% 47 | \@onesidetrue% 48 | } 49 | \DeclareOption{twoside}{% 50 | \@twosidetrue% 51 | } 52 | \DeclareOption{maketable}{% 53 | \@maketabletrue% 54 | } 55 | \DeclareOption*{% 56 | \ClassWarning{cauthesis}% 57 | {Unknown option `\CurrentOption'}% 58 | } 59 | \ProcessOptions\relax 60 | \if@oneside% 61 | \if@twoside% 62 | \@clearaftpfalse% 63 | \ClassWarning{You can only choose one of the oneside and twoside options.% 64 | Automatically set to oneside.}% 65 | \fi% 66 | \else% 67 | \if@twoside% 68 | \@clearaftptrue% 69 | \fi% 70 | \fi% 71 | \LoadClass[a4paper]{article}%加载article类型 72 | %% --------------------------------------------------------------------------- 73 | %页面布局调节 74 | \RequirePackage{geometry} 75 | \geometry{left=2.5cm,right=2.5cm,top=3.5cm,bottom=2.5cm,footskip=0.8cm} 76 | \pagestyle{plain} 77 | \linespread{1.25}\selectfont 78 | %% --------------------------------------------------------------------------- 79 | \RequirePackage{graphicx}%图片插入 80 | \RequirePackage[section]{placeins} 81 | \def\@captype{figure} 82 | %% --------------------------------------------------------------------------- 83 | \RequirePackage{etoolbox}%编程辅助 84 | \RequirePackage{ifthen}%编程辅助 85 | \RequirePackage[normalem]{ulem}%下划线 86 | \RequirePackage{array}%数学 87 | %% --------------------------------------------------------------------------- 88 | %书签功能,选项去掉链接红色方框, 89 | \RequirePackage[CJKbookmarks,% 90 | %debug=true,% 91 | colorlinks=true,% 92 | bookmarksnumbered=true,% 93 | pdfstartview=FitH,% 94 | linkcolor=magenta,% 95 | anchorcolor=magenta,% 96 | citecolor=magenta,% 97 | linkcolor=black,]{hyperref} 98 | %linkcolor=green,blue,red,cyan, magenta, 99 | %yellow, black, gray,white, darkgray, lightgray, brown, 100 | %lime, olive, orange, red,purple, teal, violet. 101 | %下面这两句保证多篇文章一起排时的超链接正确性 102 | \newcounter{Hsection} 103 | \preto\section{\stepcounter{Hsection}} 104 | \RequirePackage{titleref} %标题引用 105 | %% --------------------------------------------------------------------------- 106 | %英文字体控制 107 | \RequirePackage{fontspec} 108 | \setmainfont{Noto Serif} 109 | %% --------------------------------------------------------------------------- 110 | %中文环境 111 | %中文字体控制 112 | \RequirePackage[zihao=-4]{ctex} 113 | \RequirePackage{xeCJKfntef} 114 | \setCJKmainfont[BoldFont={Noto Sans CJK SC},ItalicFont={方正仿宋}]{Noto Serif CJK SC} 115 | \setCJKsansfont{Noto Sans Serif CJK SC} 116 | \setCJKmonofont{方正仿宋} 117 | \setCJKfamilyfont{zhli}{方正隶书简体} 118 | \setCJKfamilyfont{zhboldsong}{NotoSerifCJK-Bold.ttc} 119 | %% --------------------------------------------------------------------------- 120 | %章节标题格式 121 | \RequirePackage{titlesec} 122 | \renewcommand{\contentsname}{\centerline{目\hspace{2em}录}}%目录居中 123 | \titleformat{\section}{\linespread{1.5}\selectfont\bfseries\zihao{-3}}{\thesection\hspace{1em}}{0pt}{} 124 | \titlespacing*{\section}{0pt}{*1}{11pt} 125 | \titleformat{\subsection}{\linespread{1.5}\selectfont\bfseries\zihao{4}}{\thesubsection\hspace{1em}}{0pt}{} 126 | \titlespacing*{\subsection}{0pt}{*1.5}{*1} 127 | \titleformat{\subsubsection}{\linespread{1.5}\selectfont\bfseries\zihao{-4}}{\thesubsubsection\hspace{1em}}{0pt}{} 128 | \titlespacing*{\subsubsection}{0pt}{*1.5}{*1} 129 | %% --------------------------------------------------------------------------- 130 | %无编号section 131 | \newcommand{\specialsection}[1]{% 132 | \makeatletter\setcounter{secnumdepth}{-2}\makeatother 133 | \phantomsection 134 | \section{#1} 135 | \makeatletter\setcounter{secnumdepth}{3}\makeatother} 136 | %% --------------------------------------------------------------------------- 137 | %数学 138 | \RequirePackage{bbding,pifont} %特殊字体,参考latexfriend 139 | \RequirePackage{xltxtra} %用于输出tex的特殊文本格式,以及上下标的字符 140 | \RequirePackage{mflogo,texnames}%用于输出tex的特殊文本格式,texnames的说明文档没有找到 141 | \RequirePackage{amsmath}%使用宏包{美国数学协会数学},有个功能可以将章节和方程号联系起来。 142 | \RequirePackage{amssymb} %使用宏包{美国数学协会符号} 143 | \RequirePackage{mathrsfs}%数学字体 144 | %% --------------------------------------------------------------------------- 145 | %绘图和绘制统计图 146 | \RequirePackage{metalogo} 147 | \RequirePackage{xcolor} 148 | \RequirePackage{pgf,tikz} 149 | %\RequirePackage{pgfplots} 150 | %\RequirePackage{pgfplotstable} 151 | %\pgfplotsset{compat=newest} 152 | %\usepgfmodule{shapes} 153 | %\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri} 154 | %\usetikzlibrary{math,mindmap,shapes.geometric,calc,intersections,through} 155 | %\usetikzlibrary{knots} 156 | %% --------------------------------------------------------------------------- 157 | %表格 158 | \RequirePackage{float} 159 | \RequirePackage{multirow} %for excel2latex 160 | \RequirePackage{booktabs} %for excel2latex 161 | %\RequirePackage{longtable} %注意longtable无法在multicol中使用 162 | \RequirePackage{supertabular} %使用supertabular来实现可以跨页的表格 163 | \RequirePackage{tabularx} 164 | \newcolumntype{Y}{>{\raggedleft\arraybackslash}X} 165 | %% --------------------------------------------------------------------------- 166 | %图表 167 | \RequirePackage{subfigure} 168 | \RequirePackage{ccaption} 169 | \captiondelim{~} %图序图题中间的间隔符号 170 | \captionnamefont{\zihao{-5}\heiti} %图序样式 171 | \captiontitlefont{\zihao{-5}\heiti} %图题样式 172 | \captionwidth{0.8\linewidth} %标题宽度 173 | \changecaptionwidth 174 | %\captionstyle{