本文采用仙交大大佬制作的easymcm宏包,在模板上稍作修改,建议先学习一些latex基础。具体更新信息与使用请前往大佬博客:
https://www.cnblogs.com/xjtu-blacksmith/p/easymcm.html
(再次向仙交大的大佬表示感谢:
注意事项:
1.目录已在easymcm.sty文件中定义,使用tableofcontents生成
\tableofcontents % 生成目录
2.每一部分
由section,subsection,subsubsection组成
\section{Introduction}
\subsection{Problem Background}
\subsubsection{Detail 1 about Model 1}
...
...
\subsection{Our Work}
...
...
3.enumerate可以列出1,2,3,…点,itemiz可以以圆点方式给出各点
\begin{enumerate}[\bf 1.]
\item ...
\item ...
\item ...
\item ...
\end{enumerate}
\begin{itemize}
\item First one...
\item Second one ...
\end{itemize}
\subsection{Notations}
The primary notations used in this paper are listed in \textbf{Table \ref{Ntt}}. There can be some
other notations to be described in other parts of the paper.
\begin{table}[!htbp]
\begin{center}
\caption{Notations}
\begin{tabular}{cl}
\toprule
\multicolumn{1}{m{3cm}}{\centering Symbol}
&\multicolumn{1}{m{8cm}}{\centering Definition}\\
\midrule
%只需填写下面部分
$I$&The Intensity of the Heat Source\\
$k$&The Material's Conductivity\\
$h$&The Heat Transfer Coefficient\\
$c$&The Heat Capacity of Water (=4200 J/(kg$\cdot^\circ$C))\\
$\rho$&The Density of Water (=10$^3$ kg/m$^3$)\\
\bottomrule
\end{tabular}\label{tb:notation}
\end{center}
\end{table}
5.引用参考文献用\cite
\cite{label1}
6.关于附录中的代码模板
摘自:
https://blog.csdn.net/lydyangliu/article/details/9208635
首先在文章开始前加入lstlisting的设置代码
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{listings}
\lstset{%
alsolanguage=Java,
%language={[ISO]C++}, %language为,还有{[Visual]C++}
%alsolanguage=[ANSI]C, %可以添加很多个alsolanguage,如alsolanguage=matlab,alsolanguage=VHDL等
%alsolanguage= tcl,
alsolanguage= XML,
tabsize=4, %
frame=shadowbox, %把代码用带有阴影的框圈起来
commentstyle=\color{red!50!green!50!blue!50},%浅灰色的注释
rulesepcolor=\color{red!20!green!20!blue!20},%代码块边框为淡青色
keywordstyle=\color{blue!90}\bfseries, %代码关键字的颜色为蓝色,粗体
showstringspaces=false,%不显示代码字符串中间的空格标记
stringstyle=\ttfamily, % 代码字符串的特殊格式
keepspaces=true, %
breakindent=22pt, %
numbers=left,%左侧显示行号 往左靠,还可以为right,或none,即不加行号
stepnumber=1,%若设置为2,则显示行号为1,3,5,即stepnumber为公差,默认stepnumber=1
%numberstyle=\tiny, %行号字体用小号
numberstyle={\color[RGB]{0,192,192}\tiny} ,%设置行号的大小,大小有tiny,scriptsize,footnotesize,small,normalsize,large等
numbersep=8pt, %设置行号与代码的距离,默认是5pt
basicstyle=\footnotesize, % 这句设置代码的大小
showspaces=false, %
flexiblecolumns=true, %
breaklines=true, %对过长的代码自动换行
breakautoindent=true,%
breakindent=4em, %
escapebegin=\begin{CJK*}{GBK}{hei},escapeend=\end{CJK*},
aboveskip=1em, %代码块边框
tabsize=2,
showstringspaces=false, %不显示字符串中的空格
backgroundcolor=\color[RGB]{245,245,244}, %代码背景色
%backgroundcolor=\color[rgb]{0.91,0.91,0.91} %添加背景色
escapeinside=``, %在``里显示中文
%% added by http://bbs.ctex.org/viewthread.php?tid=53451
fontadjust,
captionpos=t,
framextopmargin=2pt,framexbottommargin=2pt,abovecaptionskip=-3pt,belowcaptionskip=3pt,
xleftmargin=4em,xrightmargin=4em, % 设定listing左右的空白
texcl=true,
% 设定中文冲突,断行,列模式,数学环境输入,listing数字的样式
extendedchars=false,columns=flexible,mathescape=true
% numbersep=-1em
}
然后附录部分输入即可
\section{Appendix}
\begin{lstlisting}[language=matlab,caption={The matlab Source code of Algorithm}]
kk=2;[mdd,ndd]=size(dd);
while ~isempty(V)
[tmpd,j]=min(W(i,V));tmpj=V(j);
for k=2:ndd
[tmp1,jj]=min(dd(1,k)+W(dd(2,k),V));
tmp2=V(jj);tt(k-1,:)=[tmp1,tmp2,jj];
end
tmp=[tmpd,tmpj,j;tt];[tmp3,tmp4]=min(tmp(:,1));
if tmp3==tmpd, ss(1:2,kk)=[i;tmp(tmp4,2)];
else,tmp5=find(ss(:,tmp4)~=0);tmp6=length(tmp5);
if dd(2,tmp4)==ss(tmp6,tmp4)
ss(1:tmp6+1,kk)=[ss(tmp5,tmp4);tmp(tmp4,2)];
else, ss(1:3,kk)=[i;dd(2,tmp4);tmp(tmp4,2)];
end;end
dd=[dd,[tmp3;tmp(tmp4,2)]];V(tmp(tmp4,3))=[];
[mdd,ndd]=size(dd);kk=kk+1;
end; S=ss; D=dd(1,:);
\end{lstlisting}
\begin{lstlisting}[language=c,caption={The lingo source code}]
kk=2;
[mdd,ndd]=size(dd);
while ~isempty(V)
[tmpd,j]=min(W(i,V));tmpj=V(j);
for k=2:ndd
[tmp1,jj]=min(dd(1,k)+W(dd(2,k),V));
tmp2=V(jj);tt(k-1,:)=[tmp1,tmp2,jj];
end
tmp=[tmpd,tmpj,j;tt];[tmp3,tmp4]=min(tmp(:,1));
if tmp3==tmpd, ss(1:2,kk)=[i;tmp(tmp4,2)];
else,tmp5=find(ss(:,tmp4)~=0);tmp6=length(tmp5);
if dd(2,tmp4)==ss(tmp6,tmp4)
ss(1:tmp6+1,kk)=[ss(tmp5,tmp4);tmp(tmp4,2)];
else, ss(1:3,kk)=[i;dd(2,tmp4);tmp(tmp4,2)];
end;
end
dd=[dd,[tmp3;tmp(tmp4,2)]];V(tmp(tmp4,3))=[];
[mdd,ndd]=size(dd);
kk=kk+1;
end;
S=ss;
D=dd(1,:);
\end{lstlisting}