latex基本语法

来源:互联网 发布:长沙软件职业学院地址 编辑:程序博客网 时间:2024/05/18 03:59

初玩Latex,下面这些是基于sigmod17的latex模板观察到的,一般应该都是差不多的。


%:注释

\documentclass{...}:{}中可指定模板,一般只要把投稿会议或者期刊的模板名称(不加.cls后缀)填入即可

\-begin{document} ... \-end{document}:正文部分(去除‘-’)

\setcopyright{...}:声明版权信息的,一般只要把投稿会议或者期刊的相关版权文件名称(不加.sty后缀)填入{}中即可

\title{}:论文标题

{\ttlit ...}:指定部分内容为斜体

\titlenote{...}:题注,不显示的

\subtitle{...}:子标题

\numberofauthors{8} :指定作者数目

\alignauthor
Ben Trovato\titlenote{Dr.~Trovato insisted his name be first.}\\
       \affaddr{Institute for Clarity in Documentation}\\
       \affaddr{1932 Wallamaloo Lane}\\
       \affaddr{Wallamaloo, New Zealand}\\
       \email{trovato@corporation.com}:
指定作者信息,注意后面用的是\\换行

\additionalauthors{...}:这里的作者信息目测不显示,但包含在作者数目中

\date{30 July 1999}:指定日期,但是目测没显示

\maketitle:制作首页

\-begin{abstract} ... \-end{abstract}:摘要部分(去除‘-’)

{\em ...}:改变部分内容字体

\textit{...}{\em ...} + 斜体(该模板下,不同模板应该不一样)

\section{...}:一级标题

$\times$:符号‘*’

\footnote{...}:脚注

{\texttt{\char'134 numberofauthors}}:效果为: \numberofauthors

{\secit ...}:标题中的斜体

\textbf{...}:内容中加粗

\subsection{...}:二级标题

 {\subsecit ...}:二级标题中的斜体

\cite{Lamport:LaTeX}:加引用,“Lamport:LaTeX”需在.bib文件中标示,若是多个引用用逗号隔开即可

\subsubsection{...}:三级标题

\-begin{math}\lim_{n\rightarrow \infty}x=0\-end{math}:数学公式,rightarrow:向右的箭头;infty:无穷大,该公式嵌在内容中(去除‘-’)

\-begin{equation}\lim_{n\rightarrow \infty}x=0\-end{equation}:数学公式,下一行居中显示,并在右边有标号(去除‘-’)

\-begin{displaymath}\sum_{i=0}^{\infty} x + 1\-end{displaymath}:数学公式,下一行居中显示,右边无标号(去除‘-’)

\-begin{equation}\sum_{i=0}^{\infty}x_i=\int_{0}^{\pi+2} f\-end{equation}:x_i标示下标;int_:积分操作(去除‘-’)

\-begin{table}
\centering
\caption{Frequency of Special Characters}
\-begin{tabular}{|c|c|l|} \hline
Non-English or Math&Frequency&Comments\\ \hline
\O & 1 in 1,000& For Swedish names\\ \hline
$\pi$ & 1 in 5& Common in math\\ \hline
\$ & 4 in 5 & Used in business\\ \hline
$\Psi^2_1$ & 1 in 40,000& Unexplained usage\\
\hline\-end{tabular}
\-end{table}:定义表格,centering:居中;caption:指定表格名称;{|c|c|l|}:每列数据是居中还是靠左或者靠右;\hline ..\\ \hline:标题栏(去除‘-’)

\-begin{figure}
\centering
\includegraphics{fly}
\caption{A sample black and white graphic.}
\-end{figure}:引用图片,fly为图片文件名(格式为.eps)(去除‘-’)

\-begin{figure}
\centering
\includegraphics[height=1in, width=1in]{fly}
\caption{A sample black and white graphic
that has been resized with the \texttt{includegraphics} command.}
\-end{figure}:引用图片并指定图片大小(去除‘-’)

注意:table和figure后面加上*,此时占两栏。

$f$:表示一个公式,不换行

\-begin{theorem} ... \-end{theorem}:表示一个理论或者定理(去除‘-’)

\-begin{definition} ... \-end{definition}:表示一个定义(去除‘-’)

\-begin{proof} ... \-end{proof}:表示一个证明(去除‘-’)

1 0