LaTex安装环境搭建及排版教程

hxy    2017-11-01 13:31

1、安装软件:

简单说明:MikTex是LaTex 环境,而TexMaker是用这些package和你自己的文字来生成最终PDF文件的软件。

然后下载网上提供的模板,例如:LaTex模板

然后打开模板,会提示缺少库文件,让安装。

取消下面复选框,可以后台默认安装缺少的库文件。

 

2、大纲级别以及标题:

可选插入章节,小结,最多支持 三级小结, 如2.1.1 

{}内部的内容就是小结标题

段落换行用 \ 或者中间用回车空一行。

3、编译:

找到下图中按钮,点击快速构建,在模板目录下会生成同名的pdf文件。

4、插入图:
首先在导言区加入引用声明:

\usepackage{graphicx}
然后在模板.tex文件路径下,建立Figure文件夹,然后将论文中涉及到的所有图文件放入这里,支持png, jpg, bmp, eps格式。正文中插入图片如下:
\begin{figure}[h!]
\centering
\includegraphics[scale=1] {./Figure/Figure1.png}
\caption{Sample of edge clustering coefficient LC3}
\label{fig:fig1}
\end{figure}

说明:

scale =1 表示伸缩程度,范围为0-1

caption为图的说明性文字:例如 Figure Sample of edge clusetering coefficient $LC_3$

5、插入表:

%%% 表格 1
\begin{table}[tbp]
\centering  % 表居中
\caption{Partition result of Scotland corporation network by SLCDB (company nodes ascending)}
\begin{tabular}{p{1cm} p{1cm} p{10cm}}  % {ccc} 表示各列元素对齐方式,left-l,right-r,center-c
\hline
Group & Node & Local community result\\ \hline  % \hline 在此行下面画一横线

1 & 1 & [1, 3, 7, 116, 130, 131] \\ 
2 & 2 & [2, 20, 27, 29] \\ 
17&	96&	[96, 99, 105] \\ \hline

\end{tabular}
\end{table}
%%% 结束

说明:caption表示表格的说明文字;

表格可以限制宽度,自动换行,如 p{1cm} p{10cm}} % {ccc} 

有一些其他模板可能有特定的规则,如:

\Figure
  [<position>]                % optional
  (<extra options>)           % optional
  [<options>]                 % optional
  {<image>}                   % mandatory
  {<caption>\label{<label>}}  % mandatory

\Table
  [<position>]                % optional
  (<extra options>)           % optional
  {<caption>\label{<label>}}  % mandatory
  {<tabular contents>}        % mandatory

%% default values of optional arguments
% <position>      : "t!"
% <extra options> : "topskip=0pt,midskip=0pt,botskip=0pt"
% <options>       : "scale=1"

6、公式:

常用的下角标 k_i

上角标k^2

特殊字符参见:

公式插入:

%%% 公式(1)
\begin{equation}
R = \dfrac{B_{in}}{B_{in} + B_{out}},
\end{equation} 

说明:支持自动标号。

如提示报错:! Missing $ inserted.

需要在变量附近插入$

例如:$K_{a b}$ 用来表示KabK_{a b}

注意:在$$内表示变量,排版的时候自动斜体

7、关于参考文献:

简单引用,例如[1]

直接在正文内容 例如 \cite{article.1}

连续两个引用,例如[3,4]

在正文内容使用  例如\cite{article.3, article.4}

连续多个引用,例如[5-7]

在正文内容使用  例如\cite{article.5,article.6,article.7}

 

在文章末尾处标出连续编号样式,注意:40代表连续编号直到40,\bibitem{article.1}中的 article.1相当于一种唯一标识ID,也就是前文引用的 \cite{article.1}对应的 ID

%%% ENTER REFERENCES IN THE FORM
\begin{thebibliography}{40}
\bibitem{article.1}
Costa L. Structure and Function in Complex Networks[J]. 2016.
\bibitem{article.2}
Wang H, Hu J. Modeling and Analysis of Baoji Bus Line-station Network Based on the Bipartite Network[J]. Electrical Automation. 2016.
\bibitem{article.40}
Yongcheng XU, Chen L. Community Detection on Bipartite Networks Based on Ant Colony Optimization[J]. Journal of Frontiers of Computer Science \& Technology. 2014.
\end{thebibliography}

 

如果采用bibtex格式,需要将tex文件和bib文件保持同名,然后在bib文件中,先试用latex命令生成aux文件,再使用bibTex命令编译,这样生成的编译文件就可以在同名的tex文件里用了。然后再到tex文件里使用快速构建命令即可插入参考文献。

注意:如果bib编译无误,但是tex编译出错,应该考虑是不是参考文献中含有 & 字符需要转义,转义方法就是在 & 前面加上\

还有就是一点点关于 bibtex 获取途径,我是通过endnote导出的,具体可参考科学网的博客(http://blog.sciencenet.cn/blog-47991-537062.html)。

当然,也可以从各类学术搜索网站上直接导出bibtex格式。

 

8. 内容中插入伪代码:

在顶部引用宏

\usepackage{multirow}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{amsmath}
\usepackage{geometry}
\usepackage{algorithmicx}
\usepackage{algpseudocode}

\renewcommand{\algorithmicrequire}{\textbf{Input:}} % Use Input in the format of Algorithm
\renewcommand{\algorithmicensure}{\textbf{Output:}}   


\begin{algorithm}[h]  
      \caption{algorithm1}  
      \label{your label}  
      \begin{algorithmic}[1]  
        \Require  
          Enter .....;  
        \Ensure  
          Outpur......  
        \State state1......  
        \State state2......  
        \State state3......  
        \While{(a$>$b)}  
      
            \State  state4......  
            \If { c$<$d}  
                \State state5......  
            \Else  
                \State state6......  
            \EndIf  
            \State state7......  
        \EndWhile  
        \For{aaa}  
            \State state8......  
        \EndFor  
      \end{algorithmic}  
    \end{algorithm}

 

 

Last Modified: 2020-05-10 18:46
Views: 2.8K

[[total]] comments

Post your comment
  1. [[item.time]]
    [[item.user.username]] [[item.floor]]Floor
  2. Click to load more...
  3. Post your comment