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

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

其他用法

\newpage 开启新的一页
\label{fig-1}
\ref{fig-1} %引用

浮动体

\documentclass{ctexart}

\usepackage{graphicx}
\graphicspath{{figures/}}
\begin{document}
	排版位置默认tbp\\	
	h, here 上下文位置\\
	t, top 顶部\\
	b, bottom 页底\\
	p, page 独立的一页
	
	标题控制(caption ,bicaption)
	
	
	\LaTeX{}中:\TeX 暑假训练思维导图 \ref{fig-1}
	\begin{figure}[htbp]
		\centering
		\includegraphics[scale=0.1]{train}
		\caption{\TeX 暑假训练思维导图}
		\label{fig-1}
	\end{figure}
	
	\LaTeX{}中使用表格\ref{tab-score}
 	\begin{table}[h] 	
 		\centering	
 		\caption{我的成绩单}\label{tab-score}
 		\begin{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}

\begin{document}
	%设置字体族
	\textrm{Roman Family}
	
	\textsf{Sans Serif Family}
	
	\texttt{Typewriter Family}
	
	\rmfamily Roman Family
	
	{\sffamily Sans Serif Family}
	
    {\ttfamily Typewriter Family}
    
    %字体系列设置
    \textmd{Medium Series}
    
    \textbf{Boldface Series}
    
    {\mdseries Medium Series}
    
    {\bfseries Boldface Series}
    
    %字体形状系列
    \textup{Upright Shape}
    
    \textit{Italic Shape}
    
    \textsl{Slanted Shape}
    
    \textsc{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}

\title{My First Article}
\author{董佩杰}
\date{\today}
\newcommand\degree{^\circ}

%正文区
\begin{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 = 90\degree$.
	
	\begin{equation}
		AB^2 = BC^2 + AC^2.	
	\end{equation}
	
	
\end{document}

数学上的用法

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

\begin{document}
	\tableofcontents
	
	\section{行内公式}
	\subsection{美元符号}
	交换律是 $ a+b = b+a$
	\subsection{math环境} 
		\begin{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$\\
   	$\beta$\\
   	$\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}
   	 \begin{equation}
   	 	a+b = b+a\label{eq:commutative}
   	 \end{equation}
   	 \section{矩阵的表示}
   	 \centering
   	 \[
   	 \begin{matrix}
		3 & 4 & 5\\
		4 & 5 & 5\\
		3\\
   	 \end{matrix}
   	 \begin{pmatrix}
   	 3 & 4 & 5\\
   	 4 & 5 & 5\\
   	 3\\
   	 \end{pmatrix}
   	 \begin{bmatrix}
   	 3 & 4 & 5\\
   	 4 & 5 & 5\\
   	 3\\
   	 \end{bmatrix}
   	 \begin{Bmatrix}
   	 3 & 4 & 5\\
   	 4 & 5 & 5\\
   	 3\\
   	 \end{Bmatrix}
   	\begin{vmatrix}
   	3 & 4 & 5\\
   	4 & 5 & 5\\
   	3\\
   	\end{vmatrix}
   	\begin{Vmatrix}
   	3 & 4 & 5\\
   	4 & 5 & 5\\
   	3\\
   	\end{Vmatrix}
   	\]
   	省略号
   	\[
   	A = \begin{bmatrix}
   	a_{11} & \dots & a_{1n}\\
   	&\ddots & \vdots\\
   	0&&a_{nn}
   	\end{bmatrix}_{n \times n}
   	\]
   	\[
   	\begin{pmatrix}
   		\hdotsfor{4}
   	\end{pmatrix}
   	\]
   	
   	行内小矩阵
   	\begin{math}
	   	\left(
	   	\begin{smallmatrix}
	   	x & y\\ a & b
	   	\end{smallmatrix}
	   	\right)	 
   	\end{math}
   	
   	%array环境
   	
   \[
   \begin{array}{r|r}
  		\frac{1}{2} & 0 \\
  		\hline
  		0 & 1
   \end{array}
   \]
   
   \section{多行公式排版问题}
   		\begin{gather}
   			a + b = b + c\\
   			ab = bc
   		\end{gather}
   \section{对齐}
   		\begin{align}
   			 x &= t + t ^2\\
   			 y &= t^4 + 2
   		\end{align}
   % split 环境实现一个公式多行拍板
   \begin{equation}
   		\begin{split}
   			y &= 2\cos x + 3\sin ^2 x\\
   			  &= 3\sin^2 x + 2\cos x
   		\end{split}
   \end{equation}
   
   % cases 环境 实现两部分分段函数的处理
   %text命令在数学中处理中文
   \begin{equation}
   		D(x) = \begin{cases}
   			1,& \text{如果} x \in \mathbb{Q};\\
   			0,& \text{如果} x \in \mathbb{R} \setminus\mathbb{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}
\bibliographystyle{plain}

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

	\bibliography{dpj}
	\begin{thebibliography}{99}
		\bibitem{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}

\begin{document}
	\tableofcontents
	\section{引言}
	
	\section{试验方法}
	
	\section{实验结果}
	\subsection{1}
	\subsubsection{1. 1}
	\subsection{2}
	\section{结论}
	'' 、、
	\section{致谢}
\end{document}
posted @ 2018-01-25 15:31  pprp  阅读(1688)  评论(0编辑  收藏  举报