Content

  • LaTeX的用途
  • LaTeX文件布局
  • LaTeX的文档格式
  • 公式环境
  • 图的排版
  • 表格的排版
  • 有序列表和无序列表
  • 引用
  • 伪代码
  • 参考文献

LaTeX的用途

LaTeX是一种基于TeX的排版系统,由美国计算机科学家Leslie Lamport开发。对于生成复杂表格和数学公式,这一点表现得尤为突出。因此它非常适用于生成高印刷质量的科技和数学类文档。


LaTeX文件布局

使用LaTeX生成PDF文档一般有两种方式:

  1. LaTeX -> dvi2pdf -> pdf document
  2. pdfLatex -> pdf document

    一个基本的论文LaTeX文件夹有这样四个部分,文件布局如下:
    eps          #文件夹用于放论文中使用到的.eps文件
llncs.cls #论文模板
paper.bib #论文参考文献
paper.tex #论文的正文内容

LaTeX文档格式

\documentclass{llncs}

\usepackage{graphicx}
%import some packages needed
\graphicspath{{eps/}} %set eps file path \renewcommand{\algorithmicrequire}{ \textbf{Input:}}
\begin{document}
\title{My document title}
\titlerunning{xxx}
\author{name1\inst{2} \and name2\inst{1\and 2} \and name3\inst{2} \and name3\inst{2}}
\authorrunning{Amble et al.}
\institute{place1 \email{xxx@xx}\\ \and place2 \email{b@mail}}
\maketitle \begin{abstract}
\keywords{word1,word2,word3}
\end{abstract} \section{section1}
\subsection{subsection1.1} \bibliographystyle{plain}
\bibliography{paper} \end{document}

公式环境

  • 内联的公式,即出现在正文中的公式使用$xxx$表示。注意:希腊字母或者任何数学符号必须要在双美元符号中间
  • 公式环境,这里是单独的公式,需要标号的那种
\begin{equation}
a=b+c
\end{equation}

图片的排版

图片使用以下的figure环境,需要导入的宏包:graphicx,然后使用\graphicspath{{eps/}}定义论文配图的位置

\begin{figure}[ht]
\centering
\includegraphics[width=8cm]{picture1.eps}
\caption{The picture title}
\end{figure}
  • h:当前位置
  • b:优先排在底部
  • t:优先排在每页顶部
  • !:加入感叹号表示强制性

表格的排版

要引入的包为multirow,简单的表格排版可以使用如下demo,其中(\\表示换行,\hline表示横线)。

\begin{table}[!hbp]
\caption{example of table}
\begin{tabular}{|c|c|c|c|c|}
\hline
\hline
lable 1-1 & label 1-2 & label 1-3 & label 1 -4 & label 1-5 \\
\hline
label 2-1 & label 2-2 & label 3-3 & label 4-4 & label 5-5 \\
\hline
\end{tabular}
\end{table}

复杂的多列合并参考如下代码参考百科。如下:

\begin{table}[!hbp]
\caption{example of table}
\begin{tabular}{|c|c|c|c|c|}
\hline
\mutirow{2}{*}{multi-row} & \muticolumn{2}{|c|}{Muti-Column} & multicolumn{2}{|c|}{\multirow{2}{*}{Muti-Row and Muti-Column}}\\
\cline{2-3} & column-1 & \multicolumn{2}{|c|}{}\\
\hline
\end{tabular}
\end{table}

列表

有序列表

导入的宏包为enumerate,正文中使用如下代码完成,另外可以使用中括号设定标号的格式,例如[(1)]

\begin{enumerate}[(1)]
\item this is sentence 1.
\item this is sentence 2.
\end{enumerate}

无序列表

\begin{itemize}
\item this is sentence 1.
\item this is sentence 2.
\end{itemize}

引用

在被引用的地方做如下标记:

\label{lab1}

在引用的地方使用:

\ref{lab1}

伪代码

导入包:algorithm、algorithmicx和algpseudocode

\renewcommand{\algorithmicrequire}{ \textbf{Input:}}
\renewcommand{\algorithmicensure}{ \textbf{Output:}}
\begin{algorithm}
\caption{algoritm name}
\begin{algorithmic}[1]
\Require input parameters
\Ensure output parameters
\Function {algorithm name}{input parameters}
\State $V \gets 0$
\For{$i \gets 1\quad to\quad len(GramArray)$}
\State $element \gets GramArray[i]$
\If{$GramInfo.exist(element)$}
\State $GramInfo[element].count++$
\Else
\State $GramInfo.Add(<element,i,1>)$
\EndIf
\EndFor
\While{$GramInfo.isNotEmpty()$}
\State $cell \gets GramInfo.popElement()$
\State $index \gets GramMap(cell.gram)$
\State $V[index] \gets <cell.pos,cell.count>$
\EndWhile
\State \Return{$V$}
\EndFunction
\end{algorithmic}
\end{algorithm}

参考文献

在整个\.tex结束的位置,也就是\end{document}之前加入如下代码:

\bibliographystyle{plain}
\bibliography{paper}

并单独创建一个.bib文件,该文件中存放参考文献的资料,具体存放的参考文献格式可以利用:

非常方便的获取。在文章中引用的地方只需要使用如下格式引用即可,这里需要注意的地方是:需要LaTeX -> bibtex -> LaTeX -> dvi2pdf

\cite{name}

中文处理方法

\documentclass[12pt]{article}
\usepackage{CJK} \begin{document}
\begin{CJK*}{GBK}{song}
\title{大规模分布式系统环境下的性能监测与跟踪调试工具的\\研究成果综述}
\author{傅海平\footnote{电子邮件: haipingf@gmail.com,学号: 201128013229018}\\
中国科学院计算技术研究所\\} \date{2012年5月}
\maketitle
\newpage
latex中文排版
\end{CJK*}
\end{document}

才疏学浅,如有不足之处还请多多指教,感激不尽~

LaTeX简单使用方法的更多相关文章

  1. LaTeX中表格多行显示的最简单设置方法

    这事实上是一个非常easy的问题,可是这两天发现我之前的解决方式太麻烦了.简介一下这样的最简单的方法: 之前设置多行显示的时候,用类似于以下这样的方法进行多行显示: \begin{table} \ne ...

  2. MySQL笔记-最简单的方法来解决找不到mysqld.sock文件的问题

    首先,环境:ubuntu 14.04,采用apt-get的方式安装的,手动安装可能路径设置稍有区别. 1.安装MySQL后,用命令行首次启动时发现找不到Mysqld.sock文件,提示: ERROR ...

  3. mfc显示静态图片最简单的方法

    一致都是研究如何调用opencv显示动态图片,但是很多时候在显示图标的时候,都是需要显示静态图片,现在将最简单的方法总结下: 1.添加picture控件 2.添加资源,要求为bmp 3.修改属性 结果 ...

  4. ECshop设置301最快捷最简单的方法

    ECshop设置301最快捷最简单的方法 在 init.php中加入以下代码 if (strtolower($_SERVER['SERVER_NAME'])!='www.fz1688.com') { ...

  5. git 的简单使用方法

    git 的简单使用方法1. 服务器 安装完成2. ssh 中的账号创建完成3. 创建 ssh 账号,会在 ssh 的安装目录下的home 目录里面,多了用户家目录4. 进入该目录 ,创建一个新的文件夹 ...

  6. JavaScript,一个超级简单的方法判断浏览器的内核前缀

    先说明,此处的方法是说超级简单的方法,不是指代码超级少,而是用非常简单的知识点,只要懂得怎么写JavaScript的行内样式就可以判断. 大家应该还记得JavaScript行内样式怎么写吧?(看来我是 ...

  7. NET MVC1项目升级到MVC2最简单的方法

    NET MVC1项目升级到MVC2最简单的方法 把MVC1项目升级到MVC2,最简单的做法如下: 新建MVC2项目 新建一个MVC2项目,把原来MVC1的项目文件全部拷贝到新建MVC2项目目录里,依照 ...

  8. js 获取当天23点59分59秒 时间戳 (最简单的方法)

    js 获取当天23点59分59秒 时间戳 (最简单的方法) new Date(new Date(new Date().toLocaleDateString()).getTime()+24*60*60* ...

  9. [ASP.NET]更简单的方法:FormsAuthentication登录ReturnUrl使用绝对路径

    转自:http://www.cnblogs.com/dudu/p/formsauthentication-returnurl-absoluteuri.html [ASP.NET]更简单的方法:Form ...

随机推荐

  1. FragmentTabHost简单保存状态的方法

    private View rootView;@Overridepublic View onCreateView(LayoutInflater inflater, ViewGroup container ...

  2. [转]ExtJs基础--Html DOM、Ext Element及Component三者之间的区别

    要学习及应用好Ext框架,必须需要理解Html DOM.Ext Element及Component三者之间的区别. 每一个HTML页面都有一个层次分明的DOM树模型,浏览器中的所有内容都有相应的DOM ...

  3. php use memcached in ubuntu 14.04

    I assume you already had a lamp environment first step,we must to install memched in our Ubuntu Syst ...

  4. neo4j关闭和开启密码访问权限

    本例:neo4j-enterprise-2.3.1版本 neo4j默认安装是开启访问密码验证 可以发现,在conf/下的neo4j-server.properties配置文件 # Require (o ...

  5. java中静态方法和静态类的学习

    静态内部类可以有静态成员,而非静态类 则不能有静态成员 静态内部类的非静态成员可以访问外部类的静态成员,而不可以访问外部类的非静态成员 非静态方法与对象相关,而静态方法属于类的方法, 总上所述:静态方 ...

  6. 一些常用的git指令

    PyCharm编辑器 如何切换分支 git branch 查看当前在哪个分支,也会显示本地所有的分支名 git branch dev-chenqiao 新建分支 git checkout dev-ch ...

  7. coocs2d-x 分辨率

    config.lua: CC_DESIGN_RESOLUTION = { width = , height = , autoscale = "FIXED_HEIGHT", call ...

  8. 【20160722-20160728】NOI2016滚粗记&&酱油记&&游记

    先挖坑 #include <cstdio> using namespace std; int main(){ puts("转载请注明出处:http://www.cnblogs.c ...

  9. 开启A20线(部分译)

    开启A20线 在查看或编写操作系统内核时一定会遇到A20线这个问题.本人对此一直都是似懂非懂的,查了些资料,决定弄明白于是有了这篇文章.其中前一部分是翻译一篇外国博文,但光有这篇文章依旧不能清楚地说明 ...

  10. Leetcode 16. 3Sum Closest

    Given an array S of n integers, find three integers in S such that the sum is closest to a given num ...