latex入门教程

最近几天改论文,由于information science 只提供latex模板,因此突击学习了一下latexhtml

latex的编辑软件主要用到的是ctxt,安装地址ide

连接:http://pan.baidu.com/s/1o8BNpHK 密码:vv9y学习

一路点击下一步就能够了网站

而后安装插文献的软件jabref,安装地址ui

连接:http://pan.baidu.com/s/1c2mzkWw 密码:2q7pgoogle

打开Elsevier提供的latex模板文件elsarticle-template-num.tex就能够开始编辑了、url

首先确认你要用的模板类型及版面大小,Elsevier一共提供了2种文件类型,一种是preprint就是默认提交给elsevier的格式,review是增长了行间距的格式,有3种版面大小设置,1p,3p和5p,经过\documentclass[preview,3p,12pt]{elsarticle}进行设置spa

接下来设置须要的参考文献的格式类型,咱们在文中用到的是[1-4]这种压缩的格式,用的是数字,因此设置成rest

\biboptions{numbers,sort&compress}

接下来开始写文章code

总体来讲,latex有点相似于html的语法,文章从\begin{document}开始,到\end{document}结束

咱们按照提示填入\title{}\author[1]{chao shen},\author[2]{zhao wang},\address[1]{xi'an jiaotong university}

而后填入摘要,关键字等等\begin{abstract}…………\end{abstract},\begin{keyword}…………\end{keyword}

下面就开始写正式章节了

一级标题应该用 \section{Introduction}这样的形式

二级标题用\subsection{xxx}

三级标题用\subsubsection{xxx}

四级标题没有定义,应该用\paragraph{(1)Detection Performance Comparison}

参考文献

参考文献直接用jabref插入,在jabref中选好文件以后,点击右上角的推送到winedt,winedt的路径要先选一下,在首选项,外部程序里面找到D:\program files\CTEX\WinEdt\WinEdt.exe,选择以后确认。

创建bib文件,每一条搜索以后铜鼓google导出bib,复制粘贴就加入了一条记录,记得要把库文件保存到个tex文件同一个文件夹,而后在tex文件中指定参考文件\bibliographystyle{elsarticle-num}\bibliography{ref}

在推送以前,必定要先编译纯粹的latex,而后编译bib,再编译latex,再编译bib以后才能推送,否则文献会是

编译没法经过的时候能够加入\usepackage{epstopdf}

而后每次选中几条,鼠标放到tex文件中须要插入的地方,直接点击推送到winedt就好了

插入url时要用到以下包\usepackage{url}

插入图片

咱们要插入的方式是一行插入多张图片,使用下述的程序段

使用前要先声明用了以下包:\usepackage{subfigure}

%
\begin{figure}[t]
\noindent
\centering
\subfigure[]{
\includegraphics[width=.3\textwidth]{6-1.eps}
}
\subfigure[]{
\includegraphics[width=.3\textwidth]{6-2.eps}
}
\subfigure[]{
\includegraphics[width=.3\textwidth]{6-3.eps}
}
\caption{EER curves against different user sizes:(a) nearest neighbor (Mahalanobis), (b) One-class support vector machine, (c) Mahalanobis (normed).}
\label{Figure 6}
\end{figure}
%

放一张图时用以下程序

\begin{figure}[t]
  \centering
  % Requires \usepackage{graphicx}
  \includegraphics[width=0.5\textwidth]{2.eps}\\
  \caption{EER curves at varying operating length using the three detectors. X-axis represents the number of touch operations to verify a user's identity}
  \label{Figure 2}
\end{figure}

插入表格

latex绘制表格比较麻烦,所以咱们用网站进行绘制:table generator

在网站上绘制好以后,咱们使用compress whitespace而后点击scale缩放到跟纸张同样大

以后直接粘贴到咱们的文件中就好了,要声明用到以下包:

\usepackage{multirow}
\usepackage{booktabs,graphicx}

若是某条线要加粗,须要把hline替换为\Xhline{1.2pt}

插入的时候能够在\begin{table}后面加上选择放置的位置,[t]表明top,[h]表示hear,[b]表示bottom

在表格中要加入空格的时候能够用这个命令\hspace*{75pt}

若是要改变表格与文字之间的距离,使用\setlength{\textfloatsep}{10pt plus 1.0pt minus 2.0pt}

其中后面这个\textfloatsep分类以下所示:

Change one or more of the following lengths:

  • \textfloatsep — distance between floats on the top or the bottom and the text;
  • \floatsep — distance between two floats;
  • \intextsep — distance between floats inserted inside the page text (using h) and the text proper.

参考文献

参考文献的插入主要有两种方式,

  1. 第一种是经过JabRef, 在google上下载bibtxt文件, 保存到jabref的库中, 保存为bib文件,经过jabref菜单中的插入winedit进行插入, 在tex文件中写入

    \bibliographystyle{elsarticle-num}
    \bibliography{ref}
  2. 第二种是直接将参考文献放入tex文件中:

    \bibliographystyle{named}
    \begin{thebibliography}{}
    \bibitem{Password1}
    Klein D V. Foiling the cracker: A survey of, and improvements to, password security[C]//Proceedings of the 2nd USENIX Security Workshop. 1990: 5-14.

相关文章
相关标签/搜索