LaTeX简单使用方法
Content
- LaTeX的用途
- LaTeX文件布局
- LaTeX的文档格式
- 公式环境
- 图的排版
- 表格的排版
- 有序列表和无序列表
- 引用
- 伪代码
- 参考文献
LaTeX的用途
LaTeX是一种基于TeX的排版系统,由美国计算机科学家Leslie Lamport开发。对于生成复杂表格和数学公式,这一点表现得尤为突出。因此它非常适用于生成高印刷质量的科技和数学类文档。
LaTeX文件布局
使用LaTeX生成PDF文档一般有两种方式:
- LaTeX -> dvi2pdf -> pdf document
- 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简单使用方法的更多相关文章
- LaTeX中表格多行显示的最简单设置方法
这事实上是一个非常easy的问题,可是这两天发现我之前的解决方式太麻烦了.简介一下这样的最简单的方法: 之前设置多行显示的时候,用类似于以下这样的方法进行多行显示: \begin{table} \ne ...
- MySQL笔记-最简单的方法来解决找不到mysqld.sock文件的问题
首先,环境:ubuntu 14.04,采用apt-get的方式安装的,手动安装可能路径设置稍有区别. 1.安装MySQL后,用命令行首次启动时发现找不到Mysqld.sock文件,提示: ERROR ...
- mfc显示静态图片最简单的方法
一致都是研究如何调用opencv显示动态图片,但是很多时候在显示图标的时候,都是需要显示静态图片,现在将最简单的方法总结下: 1.添加picture控件 2.添加资源,要求为bmp 3.修改属性 结果 ...
- ECshop设置301最快捷最简单的方法
ECshop设置301最快捷最简单的方法 在 init.php中加入以下代码 if (strtolower($_SERVER['SERVER_NAME'])!='www.fz1688.com') { ...
- git 的简单使用方法
git 的简单使用方法1. 服务器 安装完成2. ssh 中的账号创建完成3. 创建 ssh 账号,会在 ssh 的安装目录下的home 目录里面,多了用户家目录4. 进入该目录 ,创建一个新的文件夹 ...
- JavaScript,一个超级简单的方法判断浏览器的内核前缀
先说明,此处的方法是说超级简单的方法,不是指代码超级少,而是用非常简单的知识点,只要懂得怎么写JavaScript的行内样式就可以判断. 大家应该还记得JavaScript行内样式怎么写吧?(看来我是 ...
- NET MVC1项目升级到MVC2最简单的方法
NET MVC1项目升级到MVC2最简单的方法 把MVC1项目升级到MVC2,最简单的做法如下: 新建MVC2项目 新建一个MVC2项目,把原来MVC1的项目文件全部拷贝到新建MVC2项目目录里,依照 ...
- js 获取当天23点59分59秒 时间戳 (最简单的方法)
js 获取当天23点59分59秒 时间戳 (最简单的方法) new Date(new Date(new Date().toLocaleDateString()).getTime()+24*60*60* ...
- [ASP.NET]更简单的方法:FormsAuthentication登录ReturnUrl使用绝对路径
转自:http://www.cnblogs.com/dudu/p/formsauthentication-returnurl-absoluteuri.html [ASP.NET]更简单的方法:Form ...
随机推荐
- [LeetCode] Implement Queue using Stacks 用栈来实现队列
Implement the following operations of a queue using stacks. push(x) -- Push element x to the back of ...
- 如何用卷积神经网络CNN识别手写数字集?
前几天用CNN识别手写数字集,后来看到kaggle上有一个比赛是识别手写数字集的,已经进行了一年多了,目前有1179个有效提交,最高的是100%,我做了一下,用keras做的,一开始用最简单的MLP, ...
- Redis的三种启动方式
转载:http://www.tuicool.com/articles/aQbQ3u Part I. 直接启动 下载 官网下载 安装 tar zxvf redis-2.8.9.tar.gz cd red ...
- smarty使用
smarty-牛刀小试 smarty 初识 官网 http://www.smarty.net/ Smarty is a template engine for PHP(PHP模板引擎) smarty使 ...
- sqlmap --dns-domain模拟实践
因为看到乌云的这一篇文章 http://drop.xbclub.org/static/drops/tips-5283.html 里面的提到的用sqlmap 的--dns-domain 进行dns 注入 ...
- js修改伪类的值
css文件 p.change:after { content: attr(data-content); } js文件 $(this).addClass('change').attr('data-con ...
- linux文件目录结构
1./ 文件系统的入口,最高一级目录 2./bin 存放基础系统所需的命令 3./boot 包含Linux内核及系统引导程序所需要的文件 4./dev 设备文件存储目录(声卡.磁盘.分区..) 5./ ...
- Beta阶段第七次Scrum Meeting
Beta阶段第七次Scrum Meeting 情况简述 BETA阶段第七次Scrum Meeting 敏捷开发起始时间 2016/12/20 00:00 敏捷开发终止时间 2016/12/21 00: ...
- C语言变量类型和具体的范围
什么是变量?变量自然和常量是相对的.常量就是 1.2.3.4.5.10.6......等固定的数字,而变量则根我们小学学的 x 是一个概念,我们可以让它是 1,也可以让它是 2,我们想让它是几是我们的 ...
- c语言数据结构复习
1)线性表 //顺序存储下线性表的操作实现 #include <stdio.h> #include <stdlib.h> typedef int ElemType; /*线性表 ...