Latex的使用

1.语法规则

\ :是TeX中做为命令的标志

格式:\命令名[可选参数]{不可省略参数}

2.常用的宏包:

amsmath       数学符号与公式宏包
amsfonts      数学符号与字体宏包
Ctex          支持中文的排版
gaphicx       插图处理
Xcolor        颜色处理
Geometry      版面尺寸
graphicx      图像
Subfigure     并排放置两个图片
Fancyhdr      自定义页眉页脚
Pdfpages      插入首页
Verbatim      用于注释
lastpage      计算文档页数
booktabs      三线表格的制作

用法:\usepackages{宏包名字}

3.导言区

导言区目的:a.对文章格式进行准备,即\documentclass{文章格式&模板};

                       b.调用宏包

导言区中常用的包:

4.文章标题、作者、写作时间、目录等内容

这是一个LaTeX代码对应文章的例子,可编译自己看看,如果没有模板,这么个格式大概就够了

%%导言区
\documentclass{article}

\title{This is the title}
\author{ZuiYinXIngHe}
%\date{}

\usepackage{booktabs}		%制作三线表格,提供\toprule支持
\usepackage{tabularx}		%支持表格中的一些设置
\usepackage{makecell}		%支持表格中内容的换行
\usepackage{amsmath}		%生成较长表格时,自动切换页面
\usepackage{graphicx}		%要想用本文方式插入图片需添加的最基础包
\usepackage{subfigure}		%数列并排放置图片所需要的包
\usepackage{fancyhdr}
\usepackage[colorlinks,		%使得参考文献&图表等跳转的package
            	     linkcolor=blue,
                   anchorcolor=blue,
                   citecolor=blue]{hyperref}  %linkcolor=目录链接;

%%正文区
\begin{document}

\maketitle		%先title后content
\thispagestyle{empty}	%让这页没有页眉页脚

\newpage			%生成新页,因为目录要在新的一页啊
\pagestyle{empty}	%让这页之后的页没有页眉页脚
\tableofcontents	%显示目录


\newpage
\pagestyle{plain}
\setcounter{page}{1}

\begin{abstract}
This is a abstract!
\end{abstract}

\section{The First}
lalal lalala lalalalal lalalalal lalal lalala lalalalal lalalalal lalal lalala lalalalal lalalalal lalal lalala lalalalal lalalalal lalal lalala lalalalal lalalalal lalal lalala lalalalal lalalalal lalal lalala lalalalal lalalalal lalal lalala lalalalal lalalalal lalal lalala lalalalal lalalalal lalal lalala lalalalal lalalalal lalal lalala lalalalal lalalalal lalal lalala lalalalal lalalalal lalal lalala lalalalal lalalalal 

\end{document}

4.1  在导言区写明标题、作者、写作时间

\title{This is the title}
\author{ZuiYinXIngHe}
%\date{}

· 其中,要是有 “ \date{} ”这行代码,那么就意味着时间不显示,否则就是你编译产生这篇文章PDF的时间

· 注意是在导言区写的这些,一般放在\documentclass{}后  , \usepackage{}前

4.2 在正文区,先写\maketitle 后写 \tableofcontents 

· 没有理由,就是得这么写,不按这个顺序写编译不对

· 对于标题、作者和写作时间,一般来说都是自己一页,所以就 \maketitile 后,用\newpage开始新的一页,对于目录来说同样操作,上述代码就是标题作者一页、目录一页,这两页都没有页眉页码

 5.正文区的几个注意:

① 正文也是一个环境,所以正文必须由\begin {document}开始,由\end {document}结束

   环境也一样,比如想让某一(如表格、图片)居中,那么就要有一个center环境,那这段对图表的代码段就应该被圈在\begin {center}   和   \end {center}的环境之间

② 在英文论文写作时,每个标点后应该加上一个空格,即Aaaaa, bbbbbbb. Cccccccc

6. 页眉页码的显示&样式的切换

6.1 页眉页码的显示与否,样式间的切换 需要用到以下几个命令

  • \pagestyle  用于设置当前页以及后续页面的页眉显示情况(可称为页版式)。中间页版式可由\thispagestyle命令来指定。
  • \thispagestyle  设置当前页的页版式。
  • \setcounter{page}{1}  设置当前也页码为1,并且之后的页,页码递增

6.2  如何在目录页去掉页码

可以在目录生成命令后加入\thispagestyle{empty}即可。

6.3 标准 LaTeX 提供下列四种页版式

  可用 \pagestyle{页版式} 命令来设置页面版式:

LaTeX标准页版式样式说明

empty

无页眉页脚

plain

无页眉,页脚为居中页码

headings

页眉为章节标题,无页脚

myheadings

页眉内容可自定义,无页脚

6.4 对于想新开始一个 无页眉页码 的新页,在该页中放目录

其代码可以为:

\newpage			%生成新页,因为目录要在新的一页啊
\pagestyle{empty}	%让这页之后的页没有页眉页脚
\tableofcontents	%显示目录

(这里有个问题,对于标题作者日期这一页不要页眉页码,只能用\thispagestytle{empty}来规定,用\pagestyle{empty}就不行。。。。) 

6.5 想开始新页写正文,并且从此页开始从1开始编号

其代码为可以为:

\newpage
\pagestyle{plain}
\setcounter{page}{1}

%.........这里就可以按要求写正文了。。。。。。%

上述参考博客:latex如何把目录页的页码去掉? - aou - 博客园

7. 在文中打印特殊符号

8. LaTeX中引用参考文献、章节、图表,公式并跳转

参考:

LaTeX中引用参考文献、章节、图表,并跳转_Tiesto_W的博客-CSDN博客_latex如何引用图表

8.1 首先:LaTeX的文件开头对应位置添加相应包

该包内容可以保证文中的链接、章节、图表公式的正常跳转

\usepackage[colorlinks,		        %使得参考文献&图表等跳转的package
            linkcolor=blue,	        %linkcolor=目录链接;
            anchorcolor=blue,
            citecolor=blue,
            urlcolor=blue] {hyperref}  


8.2 引用参考文献

8.2.1 参考文献的格式为:

\begin{thebibliography}{}
\bibitem{1} Mackay D J C . A practical Bayesian framework for backpropagation networks[J]. Neural Computation, 1992.
\bibitem{2} Macrossan P E ,  Abbass H A ,  Mengersen K , et al. Bayesian Neural Network Learning for Prediction in the Australian Dairy Industry[C]// Third International Symposium on Advances in Intelligent Data Analysis. 1999.
\end{thebibliography}

· 其中的\begin{thebibliography}{}第二个{}中参数可写可不写,看需要,但是一定要有这个{},第二个{}中的内容具体功能如下图所示:

\bibliographystyle{unsrt}:按照cite顺序自动排序文献编号

\bibliographystyle{plain}:按字母的顺序排列,比较次序为作者、年度和标题,其中作者中姓氏字母优先,如S.Zhang会排在 S.Li后边,姓名的书写顺序为名前姓后。

 通过设置 bibliographystyle就可以达到上述目的,Bibtex自身已具备排序的功能,而且可以选择自己想要的排序方式。Bibtex已自带有8种样式,分别如下(下面内容摘自 LaTeX 编辑部):
1. plain,按字母的顺序排列,比较次序为作者、年度和标题
2. unsrt,样式同plain,只是按照引用的先后排序
3. alpha,用作者名首字母+年份后两位作标号,以字母顺序排序
4. abbrv,类似plain,将月份全拼改为缩写,更显紧凑
5. ieeetr,国际电气电子工程师协会期刊样式
6. acm,美国计算机学会期刊样式
7. siam,美国工业和应用数学学会期刊样式
8. apalike,美国心理学学会期刊样式

8.2.2 文献在文中的引用

其格式是: \cite{label}

· 其中label就是该文献在参考文献列表的序号

参考链接:Latex的几种参考文献排序_ztguang的博客-CSDN博客_latex 参考文献排序

8.3 引用公式

8.3.1 在LaTeX中有几种公式嵌入方法:

①行内公式:

$公式$

②行间公式:

$$公式$$

③“最正统的”公式写法,即,在公式后会类似图片、表格一样为公式自动编号

\begin{equation} \label{equa1}
a+b=c
\end{equation}

 8.3.2 在文中引用公式

由于上面只有第③种方式可以加\label{XXX}这种引用标记,所以也只有第三种可以引用,引用方式为\ref {XXX}   

(XXX内容随你喜欢,就是一个引用标记,本例子中XXX对应的是equa1 ) 

效果如图:

PS. 对于公式有的需要在引用时加个括号,那么在文中引用的格式为\eqref {XXX}

效果如图:

参考博客:https://blog.csdn.net/buling12346/article/details/115054294

8.4 引用表格

8.4.1 最简单的三线表画法:

%想要三线表,一些重要的包记得写上,如下:
\usepackage{booktabs}		%制作三线表格,提供\toprule支持
\usepackage{tabularx}		%支持表格中的一些设置
\usepackage{makecell}		%支持表格中内容的换行
\usepackage{amsmath}		%生成较长表格时,自动切换页面



\begin{table}
\begin{center}		%让表格居中
\setlength{\abovecaptionskip}{0pt}		%让表格标题上方没有多余的空白
\setlength{\belowcaptionskip}{10pt}	%让表格标题下方(即标题与表格之间)有10pt的空白

\caption{ the title of this table}\label{testTable}   %标题是caption{}中的内容;为了在文章中引用,label{}里面是引用时的标号
\begin{tabular}{cc}%表示表格有两列都居中,eg. \begin{tabular}{clrc}表示表格有四列,第一列第四列内容居中,第二列内容居左,第三列内容居右
\toprule
111111111 & aaaaaaa \\
\midrule
$A$ & lalalal\\		%$ A $使得里面的字母A是斜体
1     & lulululu\\
\bottomrule
\end{tabular}
\end{center}
\end{table}

8.4.2 一些复杂的表格&复杂的三线表画法&链接:

①一些复杂的三线表格画法和表格间的合并     LaTeX 中表格的用法总结(四)——三线表和复杂的表格_君的名字的博客-CSDN博客_latex 三线表   

②另一个如何插入复杂表格的教程:

LaTex学习教程——插入较复杂的表格(合并、换行以及加标题)_程颖不是陈颍是沉吟的博客-CSDN博客_latex表格合并

③一个较常见的三线表设置(设置不同列的宽度不同)

代码如下:

%想要三线表,一些重要的包记得写上,如下:
\usepackage{booktabs}		%制作三线表格,提供\toprule支持
\usepackage{tabularx}		%支持表格中的一些设置
\usepackage{makecell}		%支持表格中内容的换行
\usepackage{amsmath}		%生成较长表格时,自动切换页面


\begin{table}
\caption{TTTTTTTT}\label{ ttt }
\begin{tabular}{cc}
\toprule
\multicolumn{1}{m{3cm}}{\centering Symbol} & \multicolumn{1}{m{8cm}}{\centering Definition}\\
\midrule
$ABS$ & oppppsopp ppsoppppso ppppso	 \\ ppppso ppp	 ppppso ppp ppppso ppp p\\ pppso ppp ppppso ppp ppppso ppp ppppso ppp \\ppppso ppp ppppso ppp ppppso ppp ppppso ppp\\  	%在想换行的地方加上\\即可换行
supppper & GoOnGoOn! \\
\bottomrule
\end{tabular}
%\end{center}
\end{table}

可视化做表格转换成LaTeX代码的网站:   Create LaTeX tables online – TablesGenerator.com

这个绝了,点进去,自己制作表格(可视的),然后点generate表格对应的LaTeX代码就会出来,谁不夸一句流批.jpg

·还有一个软件,用Excel2LaTeX将Excel表格转化为Latex表格(下载链接和使用方法都在下面这个博客链接里面了,但我个人还是觉得上面的网址好,毕竟不用下软件)

将Excel表格转化为Latex表格——采用Excel2LaTeX_piaopiaopiaopiaopiao的博客-CSDN博客_excel2latex

8.4.3 表格在文中的引用跳转:

由于在6.3的第一节编写表格代码时,已经写好了以下内容

\caption{ the title of this table}\label{testTable}

表明了该表格的标题是“the title of this table ”, 其引用的标记是“testTable”,所以在文中需要引用该表格的时候,加入内容 \ref {testTable} 即可

8.4.4 参考博客:

LaTeX技巧:如何设置图形表格和标题之间的距离:

LaTeX技巧:如何设置图形表格和标题之间的距离_百度知道

LaTeX:表格内换行与各种居中完美解决

LaTeX:表格内换行与各种居中完美解决 - 简书

8.5 引用图片

8.5.1 最简单的插入图片:

%如果想插入图片一定要在开头对应位置加入的两个包

\usepackage{graphicx}		%要想用本文方式插入图片需添加的最基础包
\usepackage{subfigure}		%数列并排放置图片所需要的包

\begin{figure}
\centering		%图片居中
\includegraphics[scale=0.1]{pic.eps}
\caption{this is a figure demo} \label{fig1}
\end{figure}

效果如图:

上述代码对应的解释:

① \includegraphics 命令:

\includegraphics[scale=0.1]{pic.eps}

这里有两个参数,第一个参数是可选的,第二个参数是必须的。第二参数是我们的图片的名字全称(在这里要编译成功必须和我们的tex文件放在同一个路径下,若不放在同一路径下,也可以但是超级麻烦可以自己搜索一下)。第一参数设置的意义是,对要插入的图片规格做一些适当的调整。比如说设定图片的高度和宽度或者是按比例缩放。

eg: width=3cm, height=8 cm 或者 scale=0.4

所以,对应这一行也可以选择这种设置方式

\includegraphics[width=3cm, height=3cm]{pic.eps}

② \begin{figure}命令

\begin{figure}后面其实还可以加入一些参数,如\begin{figure}[ht]

其中参数的意义如下,

  • h 此处(here)
  • t 页顶(top)
  • b 页底(bottom)
  • p 独立一页(page)

 所以上述例子意思是该图片可以上下浮动,范围就是将图片放置在代码对应位置或者本页最上方(页顶)

8.5.2 一些复杂的图片的插入方法

并排插入两张图片,每个图片有自己的图题

%如果想插入图片一定要在开头对应位置加入的两个包

\usepackage{graphicx}		%要想用本文方式插入图片需添加的最基础包
\usepackage{subfigure}		%数列并排放置图片所需要的包


%并排插入两张图片,每个图片有自己的图题
\begin{figure}
\begin{minipage}[t]{0.45\linewidth}        %图片占用一行宽度的45%
\centering
\includegraphics[width=5.5cm,height=3.5cm]{cd.png}
\caption{the first} \label{fig2}
\end{minipage}
\begin{minipage}[t]{0.45\linewidth}		%图片占用一行宽度的45%
\hspace{2mm}						%两个图片间的距离
\includegraphics[width=5.5cm, height=3.5cm]{ggss.png}
\caption{the second} \label{fig3}
\end{minipage}
\end{figure}

效果如图:

②并排插入4张图片,4图片共用一个图题,每个小图有自己对应的小标题

%如果想插入图片一定要在开头对应位置加入的两个包

\usepackage{graphicx}		%要想用本文方式插入图片需添加的最基础包
\usepackage{subfigure}		%数列并排放置图片所需要的包


%并排插入4张图片,4图片共用一个图题
\begin{figure}[ht]
\centering
\subfigure[the one]		%第1张小图的名称
{ \includegraphics[width=4cm, height=3.5cm]{11} }
\hspace{0cm}			%两张图片中间的距离
\subfigure[the two]		%第2张小图的名称
{ \includegraphics[width=4cm, height=3.5cm]{22} }
\subfigure[the three]	%第3张小图的名称
{ \includegraphics[width=4cm, height=3.5cm]{yz} }
\subfigure[the four]		%第4张小图的名称
{ \includegraphics[width=4cm, height=3.5cm]{yz} }
\caption{the same title shared by above four pictures} \label{fig4}  %四张小图的共享大标题
\end{figure}

效果如图:

 (其实上面这个例子也说明了一件事就是这个图片,他可以同一个图片多次使用的)

③并排插入多张图片,小图没有自己单独对应的小标题

%如果想插入图片一定要在开头对应位置加入的两个包

\usepackage{graphicx}		%要想用本文方式插入图片需添加的最基础包
\usepackage{subfigure}		%数列并排放置图片所需要的包


%并排插入多张图片,小图没有单独对应的小标题
\begin{figure}
\centering
{ \includegraphics[width=2.5cm, height=2.5cm]{33} }
\hspace{0cm}    		%两张图片中间的距离
{ \includegraphics[width=2.5cm, height=2.5cm]{44} }
\hspace{0cm}
{ \includegraphics[width=2.5cm, height=2.5cm]{55} }
\hspace{0cm}
{ \includegraphics[width=2.5cm, height=2.5cm]{66} }
\hspace{0cm}
\caption{title of 4 pictures side by side} \label{fig5}
\end{figure}

效果如图:

8.5.3 图片在文中的引用跳转:

以上这几种方式无论是哪一种画法,他们的引用跳转的方式都是一样的:

(只不过 并排插入两张图片,每个图片有自己的图题  这个例子相较于其他的多个图片插入有点特殊,他是因为每个图都有自己的标题,并且并非这两个图共享一个标题,所以,这两个图中的每一个图都可以有自己单独的引用跳珠;而上述②③这两种情况其小图就不能拥有自己的单独跳转)

我们以6.4中 1. 最简单的插入图片 中对应的代码来介绍:

\caption{this is a figure demo} \label{fig1}

         代码段中包含这样一行代码,同表格的引用跳转一样,在图的caption后面加 \label{XXX} ,就表明把这个图片加上了一个引用标记,在文中需要引用该图片的地方加上\ref {XXX} 就行了。(XXX内容随你喜欢,就是一个引用标记,本例子中XXX对应的是fig1) 

8.5.4 参考博客链接:

LaTeX插入单个多个图片的一些技巧(就是上述内容,参考的这篇博客):

latex中插入图片_我就是我--不一样的烟火的博客-CSDN博客_latex如何插入图片

8.6 引用段落(文章中有目录,点击即可跳转)

事实上,加了第6章的这个package,文章内容中有正确写法的\tableofcontents 就可以自动生成链接,如果目录链接想让他是其他颜色可以改一下package中linkcolor参数,改成对应颜色就可以了

8.7 引用网址

不用加任何包,直接在代码中加入 \url{XXXXX}

XXXX为对应的网址即可,你就能自动跳转了

9. 包含上述例子的总样例代码:

%%导言区
%command+T 编译执行
\documentclass{article}

\title{This is the title}
\author{ZuiYinXIngHe}
%\date{}					%注释掉就会显示时间
\usepackage{booktabs}		%制作三线表格,提供\toprule支持
\usepackage{tabularx}		%支持表格中的一些设置
\usepackage{makecell}		%支持表格中内容的换行
\usepackage{amsmath}		%生成较长表格时,自动切换页面
\usepackage{graphicx}		%要想用本文方式插入图片需添加的最基础包
\usepackage{subfigure}		%数列并排放置图片所需要的包
\usepackage{fancyhdr}
\usepackage[colorlinks,		%使得参考文献&图表等跳转的package
            	     linkcolor=blue,	%linkcolor=目录链接;
                      anchorcolor=blue,
                      citecolor=blue,
                      urlcolor=blue] {hyperref}  

%%正文区
\begin{document}

\maketitle		%先title后content
\thispagestyle{empty}	%让这页没有页眉页脚

\newpage			%生成新页,因为目录要在新的一页啊
\pagestyle{empty}	%让这页之后的页没有页眉页脚
\tableofcontents	%显示目录


\newpage
\pagestyle{plain}
\setcounter{page}{1}

\begin{abstract}
This is a abstract! 
\end{abstract}


\section{The First}
%also,you should realize that no matter how many spaces in the sentence(or only an 'enter'[not with an empty,but just two line ]),they only mean one space(s)
hello everyone
this is the first section
and,the \\ or an empty line both mean the 'new line'
also ,we can use \par to begin the new paragraph, so there is an indentation for the new paragraph
aaaaaaaa aaa aaa aaaa aaaa aaaaaa aaa aaa aaaaa aaaaaaaaaaaa aaaaaaaaa aaa aaaaa aaaa aaaaa aaaaaa aaaaaaa aaaa  aaaaaa aaaa aaaaaaaaaa aaaaa aaaa aaaaaaaa aaaaaaa aaaaaa aaaaaaaaaa  aaaaaaaaaaaaaaaa aaaaaa aa a aaa aa aaaaa aaaaaaa aaaaaa aaaaa aaaaa aaa aaa aa aaaaaa aaa a

rrrrrrrrrrr rrrrrrrr rrr rrrrrrrrrrrrrrr rrrrrr rrrrr rrrrr rrrrrr rrrrrrr  rrrrrrrrrrrrrrrr rrrrrrrr  rrrrr rrrrrrrrrrrrrrr rrrr  rrr rrrrrrrrrrrrr rrrrrrrrrr rrrrrrrr rrrrrr rrrrr rrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrr rrrrrrrrr rrrrrrrrrrr rrrrrrr rrrrrrrr rrrr rrrrrrrrrrrr rrrrrrr rrrrrrrr rrrr rrrrr rrrrrrrr rrrr rrrr rrrrr rrrrrrrr rrrrrrrr rrrrrr rrrrrrr rrrrrrrrrrr rrrrrrrrrrr rrrrrrrrr rrrrrrr rrrrrrrr rrrrrrrrr rrrrrrrrrrrrrrrrr rrrrrrrrrrrr rrrrr rrrrrrrrrrrrr rrrrrrrrr \url{https://www.baidu.com} rr rr rrrrrrrrrrr rrrrrrr  rrrrrr


\subsection{The first-first}
this section is about subsection,it's a section which has a lower level than section ,you can see it has different form between section 

\paragraph{ALLL}                   you can see that, the paragraph's word in \{\} is not the paragraph's title ,it's just the word which bold

\subparagraph{BHHHH}   also,there can exist subparagraph ,also subsubparagraph,also section ,subsection,subsubsection. but ,the level of both paragraph and section is only three,there are no subsubsubsubsection anymore.

%特殊符号来区分格式
\section{special level}
let's show some other way to show the new paragraph or section :

\begin{itemize}
\item AAAAAA
\item BBBBBB
\item CCCCCC
\end{itemize}

\begin{enumerate}
\item three
\item two
\item one
\end{enumerate}

\paragraph{}and then ,this one should have an empty line before it's use,it is :

1) this is the first
2) this is the second
3) this is the third

also ,it's should has an empty line after it's end.
if there are no two empty line between follow words,it's like :
aaaaaaaaaaaaaaa 1) this is the first 2) this is the second 3) this is the third bbbbbbbbbbbbbbbbb

then ,this way \cite{1}with the import word bold is also \cite{1,2} a great way to show the level
\begin{description}
\item{ONE:}      ooooooooooo
\item{TWO:}ttttttttttttttttttt
\end{description}

\section{special signal}
%输出连字号:
AAAAA-BBBBBBB

%输出一个表示数字范围的符号,eg.3-5  (连着两个-即可)
the page is 3--5

%输出西文中的破折号:(连着三个-即可)
oh, it is mean --- the brilliant thing 

\section{formula}
There are three types of formula: $\frac{a}{b} =\beta$ and this 
$$2^{\frac{\alpha}{m}}$$

\begin{equation}\label{H}
a+b=c
\end{equation}


oh, here it is ! The formula lalal \ref{H} The formula lalal \eqref{H}The formula lalal The formula lalal The formula lalal The formula lalal The formula lalal The formula lalal The formula lalal The formula lalal The formula lalal The formula lalal The formula lalal The formula lalal The formula lalal The formula lalal The formula lalal The formula lalal The formula lalal The formula lalal The formula lalal The formula lalal The formula lalal The formula lalal The formula lalal The formula lalal The formula lalal The formula lalal The formula lalal The formula lalal The formula lalal The formula lalal The formula lalal The formula lalal 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{table}

\begin{table}
\begin{center}		%让表格居中
\setlength{\abovecaptionskip}{0pt}		%让表格标题上方没有多余的空白
\setlength{\belowcaptionskip}{10pt}	%让表格标题下方(即标题与表格之间)有10pt的空白

\caption{ the title of this table}\label{testTable}
\begin{tabular}{l|r}%表示两列都居中
\toprule
111 & aa \\
\midrule
$A$ & lalalaaaaaaaaaaaal\\		%$ A $使得里面的字母A是斜体
1     & lulululu\\
\bottomrule
\end{tabular}
\end{center}
\end{table}

\begin{table}
\caption{TTTTTTTT}\label{ttt}
\begin{tabular}{cc}
\toprule
\multicolumn{1}{m{3cm}}{\centering Symbol} & \multicolumn{1}{m{8cm}}{\centering Definition}\\
\midrule
$ABS$ & oppppsopp ppsoppppso ppppso	 \\ ppppso ppp	 ppppso ppp ppppso ppp p\\ pppso ppp ppppso ppp ppppso ppp ppppso ppp \\ppppso ppp ppppso ppp ppppso ppp ppppso ppp\\  	%在想换行的地方加上\\即可换行
supppper & GoOnGoOn! \\
\bottomrule
\end{tabular}
\end{table}


And, here is the cite of the table \ref{testTable} lala lala lal lala lalal alal alala lal alala alal alalal a lalal ala la lala l lala lalal alal alala lal alala ala l lala lalal alal \ref{ttt} alala lal alala ala l lala lalal alal alala lal alala ala l lala lalal alal alala lal alala ala

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{picture}

We will have a picture here ! Ohhh , this is the picture \ref{fig1} , which is so great .  which is so great .  which is so great .  which is so great .  which is so great .  which is so great .  which is so great .  which is so great .  which is so great .  which is so great \ref{fig2} .  which is so great \ref{fig3}  .  which is so great .  which is so great .  which is so great \ref{fig4} .  which is so great \ref{fig5}  .  which is so great .  which is so great .  which is so great .  which is so great .  which is so great .  which is so great .  which is so great .  which is so great .  which is so great .  which is so great .  which is so great .  which is so great .  which is so great .  which is so great .  which is so great .  which is so great . 

\begin{figure}
\centering		%图片居中
\includegraphics[width=3cm, height=3cm]{pic.eps}
\caption{this is a figure demo} \label{fig1}
\end{figure}

%并排插入两张图片,每个图片有自己的图题
\begin{figure}
\begin{minipage}[t]{0.45\linewidth}        %图片占用一行宽度的45%
\centering
\includegraphics[width=5.5cm,height=3.5cm]{cd.png}
\caption{the first} \label{fig2}
\end{minipage}
\begin{minipage}[t]{0.45\linewidth}		%图片占用一行宽度的45%
\hspace{2mm}						%两个图片间的距离
\includegraphics[width=5.5cm, height=3.5cm]{ggss.png}
\caption{the second} \label{fig3}
\end{minipage}
\end{figure}

%并排插入4张图片,4图片共用一个图题
\begin{figure}[ht]
\centering
\subfigure[the one]		%第1张小图的名称
{ \includegraphics[width=4cm, height=3.5cm]{11} }
\hspace{0cm}			%两张图片中间的距离
\subfigure[the two]		%第2张小图的名称
{ \includegraphics[width=4cm, height=3.5cm]{22} }
\subfigure[the three]	%第3张小图的名称
{ \includegraphics[width=4cm, height=3.5cm]{yz} }
\subfigure[the four]		%第4张小图的名称
{ \includegraphics[width=4cm, height=3.5cm]{yz} }
\caption{the same title shared by above four pictures} \label{fig4}  %四张小图的共享大标题
\end{figure}

%并排插入多张图片,小图没有单独对应的标题
\begin{figure}
\centering
{ \includegraphics[width=2.5cm, height=2.5cm]{33} }
\hspace{0cm}    		%两张图片中间的距离
{ \includegraphics[width=2.5cm, height=2.5cm]{44} }
\hspace{0cm}
{ \includegraphics[width=2.5cm, height=2.5cm]{55} }
\hspace{0cm}
{ \includegraphics[width=2.5cm, height=2.5cm]{66} }
\hspace{0cm}
\caption{title of 4 pictures side by side} \label{fig5}
\end{figure}




%参考文献部分:
\newpage
\begin{thebibliography}{}
%在文中对应位置引用就直接\cite{x}
\bibitem{1} Mackay D J C . A practical Bayesian framework for backpropagation networks[J]. Neural Computation, 1992.
\bibitem{2} Macrossan P E ,  Abbass H A ,  Mengersen K , et al. Bayesian Neural Network Learning for Prediction in the Australian Dairy Industry[C]// Third International Symposium on Advances in Intelligent Data Analysis. 1999.
\end{thebibliography}

\end{document}

对应文件夹目录如下,其实就是图片和tex文件放在一起

然后,那一堆.aux .log .out .pdf .gz .toc 文件都没有用,可以删去,下次在编译一次就又有了(.pdf 就是该tex文件的对应PDF)只有.tex文件是有用的别删错了----

10. 补充内容:

1. 首先如果是为了写论文,杂志期刊一般都会有提供模板(Word & LaTeX),下载那个模板就好了。那个模板,以IEEE为例,他应该会有个文件夹,里面也是一堆东西,找到里面的.cls文件,把它移到你的要写论文的tex文件包里,这个.cls文件就类似于一个格式模板,所以必须包含在你的论文文件夹里面。然后,IEEE文件夹里面应该还会有一个tex文件,那个就类似于例子程序了,你看看他的要求,怎么写,就把你的论文内容对应上去补充完整就好啦。

2. cls文件的较详细说明:

cls文件是latex2e的格式文件,它决定了latex源文件的排版布局。最一般的cls文件就是我们常用的article.cls,这表现在 
/documentclass{article} 
这一句里面。如果出版方提供了cls文件,我们可以下面两个方法使用(假如cls文件名为xxx.cls): 
1)cls文件和你自己的latex文件放到同一个文件夹里面,在源文件里面用 
/documentclass{xxx} 
而不是 
/documentclass{article} 
2)将cls文件放到 
C:/CTeX/localtexmf/tex/latex下一个文件夹里面(可以自己建一个文件夹) 
然后刷新数据库,方法如下: 
开始-->所有程序-->中文tex套装-->miktex-->Miktex Options--->refresh, 
OK啦。 
在源文件里面用 
/documentclass{xxx} 
而不是 
/documentclass{article}

参考链接:Latex中的cls文件使用(转)_owldestiny的博客-CSDN博客_cls文件

3. 一个IEEE模板的小问题解释:

用Latex写学术论文:作者(Author)&摘要(Abstract)_weixin_30532837的博客-CSDN博客

11. 友情(超有用)链接:

国外的一个LaTeX模板网站: LaTeX Templates - Home

可视化公式转LaTeX格式网站:https://latex.codecogs.com/eqneditor/editor.php

可视化表格转LaTeX格式网站:Create LaTeX tables online – TablesGenerator.com

30分钟入门LaTeX:LaTeX新人教程,30分钟从完全陌生到基本入门[转载] - LaTeX科技排版工作室

再配合连大的这个视频 【2020亚太赛前培训】【LaTeX排版】_哔哩哔哩_bilibili  就可以七七八八了,当然了,我觉得自己写(整理)得也不错嘿嘿

还有几篇特别长的,但是写得很细的,可以找自己需要的看看

Latex 安装及学习教程_Packed的博客-CSDN博客_latex安装教程

Latex:入门教程_-柚子皮-的博客-CSDN博客_latex教程

都很详细-----也很棒-----

  • 12
    点赞
  • 92
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
LaTeX是一种排版系统,用于专业且高质量的文档制作。下面是一些常用的LaTeX命令和技巧,供初学者参考: 1. 使用LaTeX平台:LaTeX可以在多个平台上使用,比如Overleaf、TeX Live等。选择合适的平台是个人习惯问题,但是LaTeX的语法是通用的。 2. LaTeX命令:LaTeX中的命令用于控制文档的格式和样式。例如,使用\documentclass命令定义文档类,\section命令用于创建章节,\subsection命令用于创建小节等等。 3. 标题和目录:LaTeX中可以使用自动编号的章节命令,比如\section{标题}。如果不需要自动编号,可以使用\section*{标题}命令。生成目录的方法很简单,只需在适当的位置插入\tableofcontents命令即可。 4. 数学公式:LaTeX在排版数学公式方面非常强大。使用\begin{equation}和\end{equation}命令可以创建带有自动编号的数学公式。使用$符号可以创建行内公式。 5. 图片和表格:LaTeX可以插入图片和创建表格。使用\includegraphics命令插入图片,使用\begin{table}和\end{table}命令创建表格。 6. 引用和参考文献:LaTeX可以轻松管理引用和参考文献。使用\cite命令可以引用文献,并使用bibliography命令指定参考文献列表。 以上是关于LaTeX使用教程的一些基本排版方法和命令。希望对初学者有所帮助。任何问题都可以在评论区留言,同时也可以参考本文末尾的小实例来进一步学习和实践。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [LaTeX基本命令使用教程(清晰实例)(Overleaf平台)(论文排版)](https://blog.csdn.net/Gentleman_Qin/article/details/79963396)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* *3* [LaTeX教程(三)——文档格式排版](https://blog.csdn.net/ifhuke/article/details/128212990)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值