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. [LeetCode] Binary Watch 二进制表

    A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom ...

  2. [LeetCode] Missing Ranges 缺失区间

    Given a sorted integer array where the range of elements are [0, 99] inclusive, return its missing r ...

  3. python基础-面向对象进阶

    一.什么是反射 反射的概念是由Smith在1982年首次提出的,主要是指程序可以访问.检测和修改它本身状态或行为的一种能力(自省).这一概念的提出很快引发了计算机科学领域关于应用反射性的研究.它首先被 ...

  4. day7_subprocess模块和面向对象,反射

    常用subprocess方法示例 #执行命令,返回命令执行状态 , 0 or 非0>>> retcode = subprocess.call(["ls", &qu ...

  5. jQuery种种

    jquery UI autocomplete获得焦点自动弹出跟随下拉框--http://blog.csdn.net/jiusong_mi/article/details/49249853 $(&quo ...

  6. jquery-读取form表单中的所有数据列表

    代码: <script> $(function() { $('#submit').click(function() { var d = {}; var t = $('form').seri ...

  7. pyMysql

    本篇对于Python操作MySQL主要使用两种方式: 原生模块 pymsql ORM框架 SQLAchemy pymsql pymsql是Python中操作MySQL的模块,其使用方法和MySQLdb ...

  8. 【poj3071】 Football

    http://poj.org/problem?id=3071 (题目链接) 题意 ${2^n}$个队伍打淘汰赛,输的被淘汰.第1个队打第2个队,第3个队打第4个队······给出第i个队伍打赢第j个队 ...

  9. Javascript获取div真实高度

    第一种情况就是宽高都写在样式表里,就比如#div1{width:120px;}.这中情况通过#div1.style.width拿不到宽度,而通过#div1.offsetWidth才可以获取到宽度. 第 ...

  10. mongodb未授权访问漏洞

    catalogue . mongodb安装 . 未授权访问漏洞 . 漏洞修复及加固 . 自动化检测点 1. mongodb安装 apt-get install mongodb 0x1: 创建数据库目录 ...