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. 《如何正确学习JavaScript》读后小结

    在segmentfault上读的一篇学习JavaScript路线的文章,做个小结. 一.简介.数据类型.表达式和操作符 (1)<JavaScript权威指南>前言1-2章&< ...

  2. Ajax跨域实现

    Ajax Ajax,Asynchronus JavaScript and XML,字母意思:异步的 JavaScript 和 XML,是指一种创建交互式网页应用的网页开发技术.用于异步地去获取XML作 ...

  3. javaMd5加密

    package com.md5Test; import java.security.MessageDigest; public class Md5Test { public void toMD5(St ...

  4. 启动 Eclipse 弹出“Failed to load the JNI shared library jvm.dll”错误的解决方法

    原因1:给定目录下jvm.dll不存在. 对策:(1)重新安装jre或者jdk并配置好环境变量.(2)copy一个jvm.dll放在该目录下. 原因2:eclipse的版本与jre或者jdk版本不一致 ...

  5. Python 【第五章】:线程、进程和协程

    Python线程 Threading用于提供线程相关的操作,线程是应用程序中工作的最小单元. #!/usr/bin/env python # -*- coding:utf-8 -*- import t ...

  6. JavaScript replace() 方法

    参考:http://www.w3school.com.cn/jsref/jsref_replace.asp 需要有一点注意的是:可以是函数的形式做为返回值,如下: "test{0}" ...

  7. View的绘制、事件传递过程

    View绘制过程 onMeasure() onLayout() onDraw() 过程详解 onMeasure() 计算尺寸 onLayout() 为viewGroup类型布局子视图用的. onDra ...

  8. substr()函数

    substr 定义于头文件 <string> string substr (size_t pos = 0, size_t len = npos) const;复制子字符串,要求从指定位置开 ...

  9. 查看Mysql版本号 (最简单的是status )

    一.使用命令行模式进入mysql会看到最开始的提示符;二.命令行中使用status可以看到;三.使用系统函数等等,   查看版本信息 #1使用命令行模式进入mysql会看到最开始的提示符 Your M ...

  10. spring context上下文(应用上下文webApplicationContext)(转载)

    (此文转载:http://www.cnblogs.com/brolanda/p/4265597.html) 一.先说ServletContext javaee标准规定了,servlet容器需要在应用项 ...