自用中文文档模板(1.4改)(普通报告用)
代码和对比图如下:
\documentclass[cs4size,a4paper]{ctexart} %小四号字(12pt),A4纸
%==================== 数学符号公式 ============
\usepackage{amsmath} % AMS LaTeX宏包
\usepackage[style=1]{mdframed}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{mathrsfs} % 英文花体字 体
\usepackage{bm} % 数学公式中的黑斜体
\usepackage{bbding,manfnt} % 一些图标,如 \dbend
\usepackage{lettrine} % 首字下沉,命令\lettrine
\def\attention{\lettrine[lines=2,lraise=0,nindent=0em]{\large\textdbend\hspace{1mm}}{}}
\usepackage{longtable}
\usepackage[toc,page]{appendix} % 添加附录
\usepackage{geometry} % 页边距调整
\geometry{top=3.0cm,bottom=2.7cm,left=2.5cm,right=2.5cm} % 调整页面边距
%====================公式按章编号==========================
\numberwithin{equation}{section}
\numberwithin{table}{section}
\numberwithin{figure}{section}
%================= 基本格式预置 ===========================
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[C]{\zihao{5} xxxx}
\fancyfoot[C]{~\zihao{5} \thepage~}
\renewcommand{\headrulewidth}{0.65pt}
\CTEXsetup[format={\bfseries\zihao{-2}}]{section}
\CTEXsetup[nameformat={\bfseries\zihao{3}}]{subsection}
\CTEXsetup[nameformat={\bfseries\zihao{4}}]{subsubsection}
%================== 图形支持宏包 =========================
\usepackage{subfigure}
\usepackage{graphicx} % 嵌入png图像
\usepackage{color,xcolor} % 支持彩色文本、底色、文本框等
\usepackage{hyperref} % 交叉引用
\usepackage{caption}
\captionsetup{figurewithin=section}
%==================== 源码和流程图 =====================
\usepackage{listings} % 粘贴源代码
\usepackage{xcolor}
\usepackage{color}
\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82}
\usepackage{xcolor}
\lstset{
%行号
numbers=left,
%背景框
framexleftmargin=8mm,
frame=none,
%背景色
%backgroundcolor=\color[rgb]{1,1,0.76},
backgroundcolor=\color[RGB]{245,245,244},
%样式
keywordstyle=\bf\color{blue},
identifierstyle=\bf,
numberstyle=\color[RGB]{0,192,192},
commentstyle=\it\color[RGB]{0,96,96},
stringstyle=\rmfamily\slshape\color[RGB]{128,0,0},
%显示空格
showstringspaces=false
}
%--------------------
\hypersetup{hidelinks}
\usepackage{booktabs}
\usepackage{shorttoc}
\usepackage{tabu,tikz}
\usepackage{float}
\usepackage{multirow}
\tabcolsep=1ex
\tabulinesep=\tabcolsep
\newlength\tikzboxwidth
\newlength\tikzboxheight
\newcommand\tikzbox[1]{%
\settowidth\tikzboxwidth{#1}%
\settoheight\tikzboxheight{#1}%
\begin{tikzpicture}
\path[use as bounding box]
(-0.5\tikzboxwidth,-0.5\tikzboxheight)rectangle
(0.5\tikzboxwidth,0.5\tikzboxheight);
\node[inner sep=\tabcolsep+0.5\arrayrulewidth,line width=0.5mm,draw=black]
at(0,0){#1};
\end{tikzpicture}%
}
\makeatletter
\def\hlinew#1{%
\noalign{\ifnum0=`}\fi\hrule \@height #1 \futurelet
\reserved@a\@xhline}
\newcommand{\tabincell}[2]{\begin{tabular}{@{}#1@{}}#2\end{tabular}}%
\usepackage{subfigure}
\usepackage{CJK}
\usepackage{ifthen}
\usepackage{graphicx}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
\newtheorem{Theorem}{定理}
\newtheorem{Lemma}{引理}
%%使得公式随章节自动编号
\makeatletter
\@addtoreset{equation}{section}
\makeatother
\renewcommand{\theequation}{\arabic{section}.\arabic{equation}}
%-------------------------
\usepackage{pythonhighlight}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usepackage{abstract}
\usetikzlibrary{shapes,arrows,positioning}
\begin{document}
\bibliographystyle{gbt7714-2005} %论文引用格式
%=================== 定理类环境定义 ===================
\newtheorem{example}{例} % 整体编号
\newtheorem{algorithm}{算法}
\newtheorem{theorem}{定理} % 按 section 编号
\newtheorem{definition}{定义}
\newtheorem{axiom}{公理}
\newtheorem{property}{性质}
\newtheorem{proposition}{命题}
\newtheorem{lemma}{引理}
\newtheorem{corollary}{推论}
\newtheorem{remark}{注解}
\newtheorem{condition}{条件}
\newtheorem{conclusion}{结论}
\newtheorem{assumption}{假设}
%==================重定义 ===================
\renewcommand{\abstractname}{} %让摘要两字消失,实现摘要两个字在摘要正文开头
%\renewcommand{\abstractname}{摘要} 摘要中文,但是在摘要正上方
\renewcommand{\refname}{参考文献}
\renewcommand{\indexname}{索引}
\renewcommand{\figurename}{图}
\renewcommand{\tablename}{表}
\renewcommand{\appendixname}{附录}
\renewcommand{\proofname}{证明}
\renewcommand{\algorithm}{算法}
\newcommand{\upcite}[1]{\textsuperscript{\textsuperscript{\cite{#1}}}}
%==================封面 ===================
\begin{titlepage}
\centering
\vspace*{1.75cm}
% \quad\includegraphics[width=10.53cm,height=1.64cm]{xx.jpg}\\插入图片学校名字校徽等
\vspace*{1cm}
{\fontsize{70pt}\baselineskip 课\qquad\ 程\qquad\ 设\qquad\ 计}
\vskip 7cm
\fontsize{19pt}\baselineskip
\makebox[30mm]{设计题目}
\underline{\makebox[75mm][c]{ 题目}}\\%在这里修改成自己的题目
\vskip 0.9cm
\makebox[30mm]{学生姓名}
\underline{\makebox[75mm][c]{ 姓名}}\\
\vskip 0.9cm
\makebox[30mm]{学\qquad\qquad 号}
\underline{\makebox[75mm][c]{ \LARGE 2016214000}}\\
\vskip 0.9cm
\makebox[30mm]{专业班级}
\underline{\makebox[75mm][c]{ 班级}}\\
\vskip 0.9cm
\makebox[30mm]{指导教师}
\underline{\makebox[75mm][c]{ 教师}}\\
\vskip 2cm
\LARGE \textbf{\number \year }~年~\textbf{\number\month}~月~\textbf{\number\day}~日
\end{titlepage}
%==================正文开始 ===================
\title{xxxx} %大括号里填写标题
\author{xxxx} %大括号里填写作者姓名
\date{} %大括号里填写\today会自动生成当前的日期
\maketitle %我们写了以上内容以后一定要添加这个,制作标题,否则上面的内容都是无效的。
\thispagestyle{fancy}
\begin{onecolabstract}
\noindent{}\textbf{摘要:} %摘要不缩进,加粗
。。。。。。 % 摘要内容
\par % 摘要内容,\noindent要求在“摘要”二字之前不缩进
\noindent{}\normalsize \textbf{关键词:}xx;xx;xxx;xxx; % 关键字,\noindent要求不缩进
\end{onecolabstract}
\section*{引言}
内容
\section{xxx}
内容
\subsection{xx}
内容
\subsubsection{xx}
内容
\begin{enumerate}
\item 内容
\item 内容
\item 内容
\item 内容
\end{enumerate}
。
\subsubsection{xx}
\subsection{xx}
\subsubsection{xxx}
\subsubsection{xxx}
\subsubsection{xxx}
\subsection{xxxx}
\section{原理}
\begin{thebibliography}{x}
\bibitem{name1}
xxx
\bibitem{name2}
xxx
\bibitem{name3}
xxx
\bibitem{name4}
xxx
%\upcite{name1}文章里用这个加引用上标
\end{thebibliography}
\end{document}