##效果图
本教程一定要配合代码来看,下面有附录源码了,代码文件也已上传CSDN资源戳这里下载资料文件
##tex安装
看这个链接就可以了
我安装的是texlive,自带的texwork还挺好用,如果打开模板中文是乱码,是utf8编码和gbk编码的问题,右下角更换编码方式,参加下面常见问题1。
##从头到尾的奶妈式教程
##常见问题
##源码
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% LaTeX 模板,主要针对 A4 纸的中文Paper。
%%
%% Ver 1.0 By Tstar RLCgroup
%%
%% You can mofify it and distribute it freely ?
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 文章模板:utf-8编码,A4 纸,10磅,文章类型为article,
% 这里设置UTF8后,下面只需要使用ctex包就能直接用中文
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[UTF8,a4paper,10pt]{article}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% packages
% 这部分声明需要用到的包
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{ctex} % 中文支持
\usepackage{fancyhdr}
\usepackage{multicol} % 正文单双栏混排
\usepackage{lastpage} % 用于获得最大页数,页眉显示用
\usepackage{geometry} % 用于设置页边距
\usepackage[subfigure,AllowH]{graphfig} %图片相关
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%定义页边距
%geometry使用手册
%http://www.ctex.org/documents/packages/layout/geometry.htm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\geometry{left=3cm,right=3.8cm,top=2.5cm,bottom=2.5cm}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%定义行间距为1.1倍行距
\renewcommand{\baselinestretch}{1.1}
%重新定义缩进长度 pt是字号
\parindent 22pt
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 页眉页脚定义
% 因为首页会自动定义成plain格式 http://www.ctex.org/documents/packages/layout/fancyhdr.htm
% but我喜欢每一页都有页眉,so重定义plain型,
% 后面就全设置成plain型好了orz,其实应该改成fancy型再设置fancy的属性
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\fancypagestyle{plain}{
\fancyhf{}
\lhead{Month, Year}
\chead{\centering{chinese latex template}}
\rhead{Page \thepage\ of \pageref{LastPage}}
\lfoot{}
\cfoot{}
\rfoot{}}
\pagestyle{plain}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 标题,作者,通信地址定义
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% texbf{…}为加粗
% huge{…}等等调节字体的
\title{\textbf{\huge{Latex中文模板}}}
\author{author1,author2\
(南京大学工程管理学院)}
\date{} % 这一行用来去掉默认的日期显示
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 文章正文
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 此行使文献引用以上标形式显示
\newcommand{\supercite}[1]{\textsuperscript{\cite{#1}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 显示title
\maketitle
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 中文摘要
% 调整摘要、关键词,中图分类号的页边距
% 中英文同时调整
% 因为geometry命令不能用在正文区只能用这看起来很麻烦的方法了orz
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setlength{\oddsidemargin}{ 1cm} % 3.17cm - 1 inch
\setlength{\evensidemargin}{\oddsidemargin}
\setlength{\textwidth}{13.50cm}
%添加标题和摘要的距离
%vspace{…}是竖直距离
%hspace{…}是水平距离
\vspace{-0.2cm}
%center是居中用的
\begin{center}
%在这里写中文摘要
%heiti表示…黑体,kaishu是楷书,还有songti宋体,lishu隶书,fangsong仿宋
\parbox{\textwidth}{
{\heiti 摘~~~要}\quad {\kaishu 这是一个菜菜的latex中文模板,课程论文、大作业的时候可以用用吧。}\
{\heiti 关键词} \quad {\kaishu latex,菜菜的,中文模板,课程论文}}
\end{center}
\vspace{0.5cm}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 英文摘要
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \为换行,可以附加行间距;\par是结束并开始下一段,多一个首行缩进
\begin{center}
\large{\textbf{chinese latex template}}\
%writer and communication address
\textbf{author1, author2}\[2pt]
\small{\textit{(Nanjing University, School of Management and Engineering, Department of Automation)}}\[14pt]
\parbox{\textwidth}{
%English abstract
\small{\textbf{Abstract}\quad This is a basic chinese latex template for novice,could be used for course eassy\
%English key word
\textbf{Key Words}\quad latex, basic, chinese template, course eassy}}
\end {center}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 目录页-------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage
\tableofcontents
\newpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 正文由此开始-------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 恢复正文页边距
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setlength{\oddsidemargin}{-.5cm} % 3.17cm - 1 inch
\setlength{\evensidemargin}{\oddsidemargin}
\setlength{\textwidth}{17.00cm}
\section{引用文献}
%\indent 为首行缩进
%引用文献
\indent 文献\supercite{ref1,ref2}中提到:南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛
\subsection{列表}
\begin{itemize}
\item 身是菩提树,心如明镜台
\item 时时勤拂拭,勿使惹尘埃.
\item 菩提本无树,明镜亦非台
\item 本来无一物,何处惹尘埃.
\end{itemize}
南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛
\section{插入图片}
\begin{Figure}[H]{aaa}[qwad]
%pic和tex文件保存在同一路径下
\graphfile[30]{1.png}[picture]
%相对路径(推荐),可以在tex所在路径建立一个fig 文件夹放图片
%\graphfile[60]{fig//1.png}[picture]
%绝对路径,从电脑任意位置寻找图片
%\graphfile[30]{C://Users//TstarYSY//Desktop//fig//1.png}[picture]
\end{Figure}
\vspace{3ex}
% \noindent 取消首行缩进
\noindent 南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛\par
南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛
\par
\begin{Figure}[H]{asdf}[111]
\graphfile[34]{1.png}[picture1]
\graphfile[36]{1.png}[picture2]
\par
\end{Figure}
\section{表格}
南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛
\par
\vspace{3ex}
\begin{table}[h]
\centering
%{|l|c|c|}指明有3列而且对其方式是左中中,|表示要加竖线
%\hline表示添加横线
\begin{tabular}{|l|c|c|}\hline
%&表示一个单元格内容结束
%multicolumn{n}{…}{…}表示合并n个单元格,指明对齐方式和内容
Setting&\multicolumn{2}{c|}{A4 size paper}\\hline
&mm&inches\
Top&25&1.0\
Bottom&25&1.0\
Left&20&0.8\
Right&20&0.8\
Column Width&82&3.2\
Column Spacing&6&0.25\\hline
\end{tabular}
\caption{a table}
\label{tab:table1}
\end{table}
\vspace{3ex}
\noindent 南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛
\section{公式}
南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛
\noindent
\begin{figure}[h]
\begin{minipage}[h]{0.48\linewidth}
[\alpha \ge \delta {\rm{ + }}\overline {\eta * \beta } ]
\end{minipage}
\begin{minipage}[h]{0.48\linewidth}
[\left[ {\begin{array}{*{20}{c}}
{{a_1}}&{{a_2}}&\alpha &\beta \
\chi &\varphi &\gamma &\eta \
\theta &{{\zeta _3}}&\xi &\omega
\end{array}} \right]]
\end{minipage}
\vspace{3ex}
\caption{aaa}
\end {figure}
\par\noindent
南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛南无阿弥陀佛
\section{结束}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 参考文献
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\small
\begin{thebibliography}{99}
\setlength{\parskip}{0pt} %段落之间的竖直距离
\bibitem{ref1}吴承恩. 西游记~[M], 明14XX年.
\bibitem{ref2} 玄奘. 大唐西域记学报~[J], 唐6XX年, 1(2): 23-55.
\end{thebibliography}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 文章结束
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\clearpage
\end{document}