LATEX课程论文模板,因为电脑缺少字体不能使用,求热心网友救救孩子帮忙找找字体
下面给出了模板cls代码和texstudio的报错
cauthesis.cls文件代码如下:
%% cauthesis.cls
%% Copyright 2018 阎彧萱
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% https://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status maintained'.
\CurrentOption'}%
%%
%% The Current Maintainer of this work is 阎彧萱.
%%
%% This work consists of the file cauthesis.cls
%% and the derived files:
%% Logo.jpg
%% CAU_Course_Thesis_Template.tex
%% CAU_Course_Thesis_Template.pdf
%% gb7714-2015.bbx
%% 中国农业大学课程论文写作格式.doc
%% ---------------------------------------------------------------------------
%% Class Name : cauthesis
%% Description : China Agricultural University Course Thesis LaTeX Template
%% Repository : https://github.com/Cdmium/CAUTemplate
%% Version : 1.2
%% Copyright : 2018 阎彧萱
%% E-mail : yanyuxuan@cau.edu.cn
%% License : LaTeX Project Public License v1.3c or later
%% License URI : https://www.latex-project.org/lppl.txt
%% Files : cauthesis.cls
%% Logo.jpg
%% CAU_Course_Thesis_Template.tex
%% CAU_Course_Thesis_Template.pdf
%% 中国农业大学课程论文写作格式.doc
%% ---------------------------------------------------------------------------
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{cauthesis}%
[2018/12/24 v1.2 China Agricultural University Course Thesis LaTeX Template]
\newif\if@oneside\@onesidefalse
\newif\if@twoside\@twosidefalse
\newif\if@clearaftp\@clearaftpfalse
\newif\if@maketable\@maketablefalse
\DeclareOption{oneside}{%
\@onesidetrue%
}
\DeclareOption{twoside}{%
\@twosidetrue%
}
\DeclareOption{maketable}{%
\@maketabletrue%
}
\DeclareOption*{%
\ClassWarning{cauthesis}%
{Unknown option
}
\ProcessOptions\relax
\if@oneside%
\if@twoside%
\@clearaftpfalse%
\ClassWarning{You can only choose one of the oneside and twoside options.%
Automatically set to oneside.}%
\fi%
\else%
\if@twoside%
\@clearaftptrue%
\fi%
\fi%
\LoadClass[a4paper]{article}%加载article类型
%% ---------------------------------------------------------------------------
%页面布局调节
\RequirePackage{geometry}
\geometry{left=2.5cm,right=2.5cm,top=3.5cm,bottom=2.5cm,footskip=0.8cm}
\pagestyle{plain}
\linespread{1.25}\selectfont
%% ---------------------------------------------------------------------------
\RequirePackage{graphicx}%图片插入
\RequirePackage[section]{placeins}
\def\@captype{figure}
%% ---------------------------------------------------------------------------
\RequirePackage{etoolbox}%编程辅助
\RequirePackage{ifthen}%编程辅助
\RequirePackage[normalem]{ulem}%下划线
\RequirePackage{array}%数学
%% ---------------------------------------------------------------------------
%书签功能,选项去掉链接红色方框,
\RequirePackage[CJKbookmarks,%
%debug=true,%
colorlinks=true,%
bookmarksnumbered=true,%
pdfstartview=FitH,%
linkcolor=magenta,%
anchorcolor=magenta,%
citecolor=magenta,%
linkcolor=black,]{hyperref}
%linkcolor=green,blue,red,cyan, magenta,
%yellow, black, gray,white, darkgray, lightgray, brown,
%lime, olive, orange, red,purple, teal, violet.
%下面这两句保证多篇文章一起排时的超链接正确性
\newcounter{Hsection}
\preto\section{\stepcounter{Hsection}}
\RequirePackage{titleref} %标题引用
%% ---------------------------------------------------------------------------
%英文字体控制
\RequirePackage{fontspec}
\setmainfont{Noto Serif}
%% ---------------------------------------------------------------------------
%中文环境
%中文字体控制
\RequirePackage[zihao=-4]{ctex}
\RequirePackage{xeCJKfntef}
\setCJKmainfont[BoldFont={Noto Sans CJK SC},ItalicFont={方正仿宋}]{Noto Serif CJK SC}
\setCJKsansfont{Noto Sans Serif CJK SC}
\setCJKmonofont{方正仿宋}
\setCJKfamilyfont{zhli}{方正隶书简体}
\setCJKfamilyfont{zhboldsong}{NotoSerifCJK-Bold.ttc}
%% ---------------------------------------------------------------------------
%章节标题格式
\RequirePackage{titlesec}
\renewcommand{\contentsname}{\centerline{目\hspace{2em}录}}%目录居中
\titleformat{\section}{\linespread{1.5}\selectfont\bfseries\zihao{-3}}{\thesection\hspace{1em}}{0pt}{}
\titlespacing*{\section}{0pt}{*1}{11pt}
\titleformat{\subsection}{\linespread{1.5}\selectfont\bfseries\zihao{4}}{\thesubsection\hspace{1em}}{0pt}{}
\titlespacing*{\subsection}{0pt}{*1.5}{*1}
\titleformat{\subsubsection}{\linespread{1.5}\selectfont\bfseries\zihao{-4}}{\thesubsubsection\hspace{1em}}{0pt}{}
\titlespacing*{\subsubsection}{0pt}{*1.5}{*1}
%% ---------------------------------------------------------------------------
%无编号section
\newcommand{\specialsection}[1]{%
\makeatletter\setcounter{secnumdepth}{-2}\makeatother
\phantomsection
\section{#1}
\makeatletter\setcounter{secnumdepth}{3}\makeatother}
%% ---------------------------------------------------------------------------
%数学
\RequirePackage{bbding,pifont} %特殊字体,参考latexfriend
\RequirePackage{xltxtra} %用于输出tex的特殊文本格式,以及上下标的字符
\RequirePackage{mflogo,texnames}%用于输出tex的特殊文本格式,texnames的说明文档没有找到
\RequirePackage{amsmath}%使用宏包{美国数学协会数学},有个功能可以将章节和方程号联系起来。
\RequirePackage{amssymb} %使用宏包{美国数学协会符号}
\RequirePackage{mathrsfs}%数学字体
%% ---------------------------------------------------------------------------
%绘图和绘制统计图
\RequirePackage{metalogo}
\RequirePackage{xcolor}
\RequirePackage{pgf,tikz}
%\RequirePackage{pgfplots}
%\RequirePackage{pgfplotstable}
%\pgfplotsset{compat=newest}
%\usepgfmodule{shapes}
%\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri}
%\usetikzlibrary{math,mindmap,shapes.geometric,calc,intersections,through}
%\usetikzlibrary{knots}
%% ---------------------------------------------------------------------------
%表格
\RequirePackage{float}
\RequirePackage{multirow} %for excel2latex
\RequirePackage{booktabs} %for excel2latex
%\RequirePackage{longtable} %注意longtable无法在multicol中使用
\RequirePackage{supertabular} %使用supertabular来实现可以跨页的表格
\RequirePackage{tabularx}
\newcolumntype{Y}{>{\raggedleft\arraybackslash}X}
%% ---------------------------------------------------------------------------
%图表
\RequirePackage{subfigure}
\RequirePackage{ccaption}
\captiondelim{~} %图序图题中间的间隔符号
\captionnamefont{\zihao{-5}\heiti} %图序样式
\captiontitlefont{\zihao{-5}\heiti} %图题样式
\captionwidth{0.8\linewidth} %标题宽度
\changecaptionwidth
%\captionstyle{} can be used to alter this. Sensible values for<br>
%style are: \centering, \raggedleft or \raggedright<br>
\captionstyle{\centering}<br>
%\precaption{\rule{\linewidth}{0.4pt}\par}<br>
%\postcaption{\rule[0.5\baselineskip]{\linewidth}{0.4pt}}<br>
\setlength{\belowcaptionskip}{0.1cm} %设置caption上下间距<br>
\setlength{\abovecaptionskip}{0.1cm}<br>
\setlength{\abovelegendskip}{0.1cm} %设置legend上下间距<br>
\setlength{\belowlegendskip}{0.1cm}<br>
%注意用中文的图题时,用\好像出错,而用\newline就没有问题<br>
%浮动体外使用标题,使用\tabcaptionfix命令产生在浮动体外<br>
%与table中默认的caption一致的标题效果<br>
\newfixedcaption{\tabcaption}{table}<br>
\newfixedcaption{\figcaption}{figure}<br>
%\newfixedcaption{\tabcaptionfix}{table}<br>
%% ---------------------------------------------------------------------------<br>
%参考文献<br>
\RequirePackage{url}<br>
\RequirePackage[backend=biber,%<br>
style=gb7714-2015]{biblatex}%biber<br>
\renewcommand{\bibfont}{\zihao{-5}\songti}<br>
\newcommand{\bibname}{参考文献}<br>
\setlength{\bibitemsep}{2pt}<br>
\defbibheading{bibliography}[\bibname]{%<br>
\specialsection{#1}}%<br>
%% ---------------------------------------------------------------------------<br>
%分层次enumerate<br>
\RequirePackage{enumitem}<br>
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{%<br>
\node<a href="char">shape=circle,draw,inner sep=1pt</a> {#1};}}<br>
\newenvironment{level}[1]{%<br>
\ifnumequal{#1}{2}{%<br>
\begin{enumerate}[label=\protect\circled{\arabic*}]%<br>
}{%<br>
\ifnumequal{#1}{1}{}{\ClassWarning{cauthesis}{Invalid argument. Treated as one.}}%<br>
\begin{enumerate}[label=(\arabic*)]%<br>
}%<br>
}{%<br>
\end{enumerate}%<br>
}<br>
%% ---------------------------------------------------------------------------<br>
%封面<br>
\newcommand{\@schoolyear}{20\hspace{1em}-20\hspace{1em}}<br>
\newcommand{\schoolyear}[1]{\renewcommand{\@schoolyear}{#1}}<br>
\newcommand{\@semester}{\hspace{1em}}<br>
\newcommand{\semester}[1]{\renewcommand{\@semester}{#1}}<br>
\DeclareListParser*{\forcsvlista}{;}<br>
\def\tpitem#1{\def\tpitemlist{}%<br>
\forcsvlista{\listadd\tpitemlist}{#1}}<br>
\def\zhkeywords#1{\def\zhkeywordslist{}%<br>
\forcsvlista{\listadd\zhkeywordslist}{#1}}<br>
\def\enkeywords#1{\def\enkeywordslist{}%<br>
\forcsvlista{\listadd\enkeywordslist}{#1}}<br>
\newlength{\@maxlen}<br>
\newlength{\@temporary}<br>
\newcounter{cycling}<br>
\newcounter{exlcyc}<br>
\deflength{\@maxlen}{0pt}<br>
%% ---------------------------------------------------------------------------<br>
%摘要<br>
\newcommand{\@zhabstract}{}<br>
\newcommand{\zhabstract}[1]{\renewcommand{\@zhabstract}{#1}}<br>
\newcommand{\@enabstract}{}<br>
\newcommand{\enabstract}[1]{\renewcommand{\@enabstract}{#1}}<br>
%% ---------------------------------------------------------------------------<br>
%生成封面<br>
\AtBeginDocument{%<br>
\begin{titlepage}%<br>
\pagestyle{empty}%<br>
\begin{flushleft}%<br>
\includegraphics[width=3.18cm,height=2.41cm]{./Picture/Logo.jpg}%<br>
\end{flushleft}%<br>
\centering%<br>
\begin{tabularx}{\textwidth}{@{}Y@{}c@{}X@{}}%<br>
& \begin{minipage}[t]{0.75\textwidth}%<br>
\CJKfamily{zhli}%<br>
\begin{center}%<br>
\linespread{1}\selectfont%<br>
\zihao{0}中国农业大学\par{}课程论文\par%<br>
\zihao{1}(\textrm{\@schoolyear}学年\@semester{}季学期)\par%<br>
\end{center}%<br>
\vspace{66pt}%1%<br>
\zihao{-2}%<br>
\CJKfamily{zhboldsong}%<br>
\defcounter{cycling}{0}%<br>
\renewcommand*{\do}[1]{%<br>
\stepcounter{cycling}%<br>
\ifnumequal{\value{cycling}}{1}{\settowidth{\@temporary}{#1}%<br>
\ifdimgreater{\@temporary}{\@maxlen}{\deflength{\@maxlen}{\@temporary}}{}}{%<br>
\ifnumequal{\value{cycling}}{3}{\defcounter{cycling}{0}}{%<br>
\ifnumgreater{#1}{0}{\defcounter{cycling}{0}}{}}}}%<br>
\dolistloop{\tpitemlist}%<br>
\centering%<br>
\begin{minipage}[t]{0.75\textwidth}%<br>
\centering%<br>
\linespread{1.75}\selectfont%2%<br>
\defcounter{cycling}{0}%<br>
\renewcommand*{\do}[1]{\stepcounter{cycling}\ifnumequal{\value{cycling}}{1}{\makebox[\@maxlen][s]{#1}:}{%<br>
\ifnumequal{\value{cycling}}{3}{\uline{#1\hfill}\par\defcounter{cycling}{0}}{%<br>
\ifnumgreater{#1}{0}{\defcounter{exlcyc}{0}%<br>
\whiledo{\value{exlcyc}<#1}{%<br>
\uline{\hfill}\par\stepcounter{exlcyc}}\defcounter{cycling}{0}}{}}}}%<br>
\dolistloop{\tpitemlist}%<br>
\end{minipage}%<br>
\end{minipage} %<br>
& \begin{minipage}[t]{0.15\textwidth}%<br>
\vspace{-0.5cm}%<br>
\linespread{1.5}\selectfont%<br>
\begin{tabular}[t]{|p{2.1cm}<{\centering}|}%<br>
\hline%<br>
\zihao{-4}\CJKfamily{zhboldsong} 成绩 \%<br>
\hline%<br>
\zihao{-4} \\hline%<br>
\end{tabular}%<br>
\renewcommand{\arraystretch}{1}%<br>
\end{minipage} \%<br>
\end{tabularx}%<br>
\end{titlepage}%<br>
\pagebreak%<br>
\if@clearaftp%<br>
\pagestyle{empty}%<br>
\cleardoublepage%<br>
\fi%<br>
%% ---------------------------------------------------------------------------<br>
%生成摘要<br>
\renewcommand\arraystretch{1}%<br>
\setcounter{page}{1}%<br>
\pagenumbering{Roman}%<br>
\maketitle%<br>
\ifdefempty{\@zhabstract}{\ClassWarning{cauthesis}{Empty Zhabstract.}}{%<br>
\phantomsection%<br>
\addcontentsline{toc}{section}{摘要}%<br>
\begin{center}%<br>
\linespread{1.5}\selectfont%<br>
\zihao{-3}\textbf{摘\hspace{2em}要}%<br>
\vspace{11pt}%<br>
\end{center}%<br>
\linespread{1.25}\selectfont%<br>
\setlength{\parindent}{2em}%<br>
\par\@zhabstract\%<br>
\newline%<br>
\ifdefvoid{\zhkeywordslist}{\ClassWarning{cauthesis}{Empty Enkeywords.}}{%<br>
\noindent%<br>
\textbf{关键词:}%<br>
\renewcommand*{\do}[1]{\textbf{#1};}%<br>
\dolistloop{\zhkeywordslist}\par}}%<br>
\ifdefempty{\@enabstract}{\ClassWarning{cauthesis}{Empty Enabstract.}}{%<br>
\phantomsection%<br>
\addcontentsline{toc}{section}{ABSTRACT}%<br>
\begin{center}%<br>
\linespread{1.5}\selectfont%<br>
\zihao{-3}\textbf{ABSTRACT}%<br>
\vspace{11pt}%<br>
\end{center}%<br>
\linespread{1.25}\selectfont%<br>
\setlength{\parindent}{2em}%<br>
\par\@enabstract\%<br>
\newline%<br>
\ifdefvoid{\enkeywordslist}{\ClassWarning{cauthesis}{Empty Enkeywords.}}{%<br>
\noindent%<br>
\textbf{Key Words: }%<br>
\renewcommand*{\do}[1]{\textbf{#1}; }%<br>
\dolistloop{\enkeywordslist}\par}}%<br>
\clearpage%<br>
\if@maketable%<br>
\tableofcontents%<br>
\fi%<br>
\clearpage%<br>
\setcounter{page}{1}%<br>
\pagestyle{plain}%<br>
\pagenumbering{arabic}%<br>
}<br>
%% ---------------------------------------------------------------------------</p>
<p>CAU-Course-Thesis-Template.tex报错如下<br>
<img src="https://img-ask.csdn.net/upload/202008/14/1597411882_451755.png" alt="图片说明"></p>
<p><img src="https://img-ask.csdn.net/upload/202008/14/1597411929_25807.png" alt="图片说明"></p>
<p><img src="https://img-ask.csdn.net/upload/202008/14/1597411936_779140.png" alt="图片说明"></p>
<p><img src="https://img-ask.csdn.net/upload/202008/14/1597411946_660516.png" alt="图片说明"></p>