LaTeX学习笔记

LaTeX常用用法

常用的环境

document 环境
所有文档必须在document环境下编辑

sheetsummary 环境
摘要内容环境

keywords 环境
关键词环境

itemize 环境
条目执行环境(配合item)

Theorem 环境
定理阐述环境

Lemma 环境
引理阐述环境

proof 环境
证明的环境

figure 环境
图片的环境

equation 环境
等式环境,自动编号

matrix,pmatrix,vmatrix 等环境
生成矩阵的环境

cases 环境
生成花括号环境

center 环境
居中环境

tabular 环境
表格环境

minipage 环境
生成2*2格子环境,可以做到让两个图或者表进行并排显示

thebibliography 环境
用于书写应用的环境

appendices 环境
用于书写附录说明的环境

用到的包

palatino:字体 amsthm, abstract, amsmath, amssymb,amstext,wasysym,enumerate,graphicx
usepackage[UTF8, nocap]{ctex} 可以中文输入

title

itle{Freeway Traffic Modal Based on Celluar Automata and Monte-carlo Method }
maketitle

其他用法

ewpage 开启新的一页
label{fig-1}
ef{fig-1} %引用

浮动体

documentclass{ctexart}

usepackage{graphicx}
graphicspath{{figures/}}
egin{document}
	排版位置默认tbp\	
	h, here 上下文位置\
	t, top 顶部\
	b, bottom 页底\
	p, page 独立的一页
	
	标题控制(caption ,bicaption)
	
	
	LaTeX{}中:TeX 暑假训练思维导图 
ef{fig-1}
	egin{figure}[htbp]
		centering
		includegraphics[scale=0.1]{train}
		caption{TeX 暑假训练思维导图}
		label{fig-1}
	end{figure}
	
	LaTeX{}中使用表格
ef{tab-score}
 	egin{table}[h] 	
 		centering	
 		caption{我的成绩单}label{tab-score}
 		egin{tabular}{|p{20mm}|p{20mm}|p{20mm}|p{20  mm}|}
 			hline
 			姓名 & 语文 & 数学 & 外语 \
 			hline
 			zh & 89 & 88 & 99 \
 			hline
 			li & 99 & 99 & 99 \
 			hline
 			wang & 100 & 12 & 232\
 			hline
 			dong & 100 & 100 &100 \
 			hline
 		end{tabular}
 	end{table}
	
end{document}

字体设置

documentclass{article}

usepackage{ctex}

egin{document}
	%设置字体族
		extrm{Roman Family}
	
		extsf{Sans Serif Family}
	
		exttt{Typewriter Family}
	
	
mfamily Roman Family
	
	{sffamily Sans Serif Family}
	
    {	tfamily Typewriter Family}
    
    %字体系列设置
    	extmd{Medium Series}
    
    	extbf{Boldface Series}
    
    {mdseries Medium Series}
    
    {fseries Boldface Series}
    
    %字体形状系列
    	extup{Upright Shape}
    
    	extit{Italic Shape}
    
    	extsl{Slanted Shape}
    
    	extsc{Small Caps Shape}
	
	{upshape Upright Shape}
	
	{itshape  Italic Shape}
	
	{slshape Slanted Shape}
	
	{scshape Small caps Shape}
	
	 
end{document}

论文头部设置

documentclass{article} %book,report,letter

usepackage{ctex}

	itle{My First Article}
author{董佩杰}
date{	oday}

ewcommanddegree{^circ}

%正文区
egin{document}
	maketitle
	Hello world
	
	Let $f(x)$ be defined by the formula 
	$$f(x)=3x^2+2x$$ which is a polynomial of degree 2.
	
	$angle C = 90degree$.
	
	egin{equation}
		AB^2 = BC^2 + AC^2.	
	end{equation}
	
	
end{document}

数学上的用法

documentclass{ctexart}
usepackage{graphicx}
graphicspath{{figures/}}
usepackage{amsmath}
usepackage{amssymb}

egin{document}
		ableofcontents
	
	section{行内公式}
	subsection{美元符号}
	交换律是 $ a+b = b+a$
	subsection{math环境} 
		egin{math}
			交换律是$ a + b = b + a$ 
		end{math}
	subsection{小括号}
		交换律是 (a+b=b+a)
	section{上下标}
	$3x^{30}+2x^2+x+4$\
       $3x^{3x^{30}+2x^2+x+4}+2x^2+x+4$		\
   $a_0,b_0,c_0,d_{000}$
   	section{希腊字母}
   	$alpha$\
   	$eta$\
   	$gamma$\
   	$epsilon$\
   	$pi$\
   	$omega$\
   	
   	$Gamma$\
   	$Delta$\
   	$Theta$\
   	$Pi$\
   	$Omega$
   	section{数学函数}
   	$log  sin cos arcsin arccos ln$
   	
   	$sqrt[4]{2}$
   	
   	section{分式}
   	$3/4 \ frac{4}{5}$
   	section{行间公式}
   	 	$$ a+b = b+a $$
   	 	
   	 section{equation}
   	 egin{equation}
   	 	a+b = b+alabel{eq:commutative}
   	 end{equation}
   	 section{矩阵的表示}
   	 centering
   	 [
   	 egin{matrix}
		3 & 4 & 5\
		4 & 5 & 5\
		3\
   	 end{matrix}
   	 egin{pmatrix}
   	 3 & 4 & 5\
   	 4 & 5 & 5\
   	 3\
   	 end{pmatrix}
   	 egin{bmatrix}
   	 3 & 4 & 5\
   	 4 & 5 & 5\
   	 3\
   	 end{bmatrix}
   	 egin{Bmatrix}
   	 3 & 4 & 5\
   	 4 & 5 & 5\
   	 3\
   	 end{Bmatrix}
   	egin{vmatrix}
   	3 & 4 & 5\
   	4 & 5 & 5\
   	3\
   	end{vmatrix}
   	egin{Vmatrix}
   	3 & 4 & 5\
   	4 & 5 & 5\
   	3\
   	end{Vmatrix}
   	]
   	省略号
   	[
   	A = egin{bmatrix}
   	a_{11} & dots & a_{1n}\
   	&ddots & vdots\
   	0&&a_{nn}
   	end{bmatrix}_{n 	imes n}
   	]
   	[
   	egin{pmatrix}
   		hdotsfor{4}
   	end{pmatrix}
   	]
   	
   	行内小矩阵
   	egin{math}
	   	left(
	   	egin{smallmatrix}
	   	x & y\ a & b
	   	end{smallmatrix}
	   	
ight)	 
   	end{math}
   	
   	%array环境
   	
   [
   egin{array}{r|r}
  		frac{1}{2} & 0 \
  		hline
  		0 & 1
   end{array}
   ]
   
   section{多行公式排版问题}
   		egin{gather}
   			a + b = b + c\
   			ab = bc
   		end{gather}
   section{对齐}
   		egin{align}
   			 x &= t + t ^2\
   			 y &= t^4 + 2
   		end{align}
   % split 环境实现一个公式多行拍板
   egin{equation}
   		egin{split}
   			y &= 2cos x + 3sin ^2 x\
   			  &= 3sin^2 x + 2cos x
   		end{split}
   end{equation}
   
   % cases 环境 实现两部分分段函数的处理
   %text命令在数学中处理中文
   egin{equation}
   		D(x) = egin{cases}
   			1,& 	ext{如果} x in mathbb{Q};\
   			0,& 	ext{如果} x in mathbb{R} setminusmathbb{Q}	
   		end{cases}
   end{equation}
   	
end{document}

参考文献写法

dpj.bib


@article{Athanassopoulos:1995iw,
      author         = "Athanassopoulos, C. and others",
      title          = "{Candidate events in a search for anti-muon-neutrino --->
                        anti-electron-neutrino oscillations}",
      collaboration  = "LSND",
      journal        = "Phys. Rev. Lett.",
      volume         = "75",
      year           = "1995",
      pages          = "2650-2653",
      doi            = "10.1103/PhysRevLett.75.2650",
      eprint         = "nucl-ex/9504002",
      archivePrefix  = "arXiv",
      primaryClass   = "nucl-ex",
      reportNumber   = "LA-UR-95-1238",
      SLACcitation   = "%%CITATION = NUCL-EX/9504002;%%"
}

@article{MacGibbon:1995in,
	author         = "MacGibbon, B. E. and Garino, G. and Lucas, M. A. and
	Nathan, A. M. and Feldman, G. and Dolbilkin, B.",
	title          = "{Measurement of the electric and magnetic
	polarizabilities of the proton}",
	journal        = "Phys. Rev.",
	volume         = "C52",
	year           = "1995",
	pages          = "2097-2109",
	doi            = "10.1103/PhysRevC.52.2097",
	eprint         = "nucl-ex/9507001",
	archivePrefix  = "arXiv",
	primaryClass   = "nucl-ex",
	SLACcitation   = "%%CITATION = NUCL-EX/9507001;%%"
}

@article{Athanassopoulos:1996wc,
	author         = "Athanassopoulos, C. and others",
	title          = "{Evidence for neutrino oscillations from muon decay at
	rest}",
	collaboration  = "LSND",
	journal        = "Phys. Rev.",
	volume         = "C54",
	year           = "1996",
	pages          = "2685-2708",
	doi            = "10.1103/PhysRevC.54.2685",
	eprint         = "nucl-ex/9605001",
	archivePrefix  = "arXiv",
	primaryClass   = "nucl-ex",
	reportNumber   = "LA-UR-96-1326",
	SLACcitation   = "%%CITATION = NUCL-EX/9605001;%%"
}

latexReference.tex

documentclass{article}
ibliographystyle{plain}

egin{document}	
	centering
	这是一个参考文献的引用:cite{Athanassopoulos:1995iw}
	
	这是第二个参考文献的引用:cite{MacGibbon:1995in}
	
	这是第三篇参考文献的引用cite{Athanassopoulos:1996wc}
	
	应用cite{art1}

	ibliography{dpj}
	egin{thebibliography}{99}
		ibitem{art1}Collaboration, L. S. N. D., et al.emph{Top Cited Articles during 1994 in nucl-ex.} Phys. Rev. Lett Phys Rev Lett 75 (1995): 2650.
	end{thebibliography}

end{document}  

文章结构

documentclass{article}

usepackage{ctex}

egin{document}
		ableofcontents
	section{引言}
	
	section{试验方法}
	
	section{实验结果}
	subsection{1}
	subsubsection{1. 1}
	subsection{2}
	section{结论}
	'' 、、
	section{致谢}
end{document}
原文地址:https://www.cnblogs.com/pprp/p/8351478.html