数学建模 | LaTeX入门

学习视频地址:latex中文教程-15集从入门到精通包含各种latex操作
快捷键:Latex论文写作-Texsdudio 快捷键总结
符号表:Latex常见符号对照表
美赛论文模版:如何使用美赛模板 mcmthesis


导言区、引言区、公式、newcommand

%导言区
\documentclass{article}

\newcommand\degree{^\circ}

\title{My First Document}
\author{Kun}
\date{\today}

%正文区
\begin{document}
	\maketitle
	Hello World!
	
	% zhushi
	Let $f(x)$ be defined by the formular $$f(x)= 3x^2+x- 1$$ which is a polynomial of degree 2.
	
	$\angle C=90\degree$
\end{document}

在这里插入图片描述

打开常见问题集

在这里插入图片描述
在这里插入图片描述

打开宏集手册

在这里插入图片描述
在这里插入图片描述

字体字号设置

%导言区
\documentclass[10pt]{article} %确定normalsize大小,为可选参数,在中括号内,此为10磅,只有101112磅三个选项。

\usepackage{ctex} 

%自定义字体
\newcommand{\myfont}{\textit{\textbf{\textsf{Fancy Text}}}}

%文稿区
\begin{document}
	%字体族设置(罗马字体、无衬线字体、打印机字体)
	\textrm{Roman Family} \textsf{Sans Serif Family} \texttt{Typewriter Family}    
	
	{\rmfamily Roman Family} {\sffamily Sans Serif Family} {\ttfamily Typewriter Family}
	
	{\sffamily who you are? you find self on everyone around. take you as the same as others!}
	
	{\ttfamily Are you wiser than others? definitely on. in some days, my it is true. What can you achieve? a luxurious house? a brillilant car? an admirable career? who knows?}
	
	%字体系列设置(粗细、宽度)
	\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}
	
	%中文字体
	{\songti 宋体} \quad {\heiti 黑体} \quad {\fangsong 仿宋} \quad {\kaishu 楷书}
	
	中文字体的 \textbf{粗体} 和 \textit{斜体}%字体大小,根据normalsize的大小确定,normalsize 在文档类的参数决定
	{\tiny           Hello}\\
	{\scriptsize     Hello}\\
	{\footnotesize   Hello}\\
	{\small          Hello}\\
	{\normalsize      Hello}\\
	{\large          Hello}\\
	{\Large          Hello}\\
	{\LARGE          Hello}\\
	{\huge           Hello}\\
	{\Huge           Hello}\\
	
	%中文字号设置命令、
	\zihao{-0} 你好!
	\zihao{5} 你好!
	
	\myfont
	
\end{document}

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

基本结构(section、subsection、\par、目录)

\documentclass{article}

\usepackage{ctex}

\begin{document}
	\section{引言}
	Latex 本来是只支持英文的,但是实在太好用了,遂结合中国的团队以及有识之士,开发了这个 CTEXCTEX 有 TexLive( TexLive 为 Latex 安装包的名字)的所有内容,还包括了中文的支持。所以这里我们仅仅需要安装 CTEX。
	
	Latex 本来是只支持英文的,但是实在太好用了,遂结合中国的团队以及有识之士,开发了这个 CTEXCTEX 有 TexLive( TexLive 为 Latex 安装包的名字)\par 的所有内容,还包括了中文的支持。所以这里我们仅仅需要安装 CTEX。
	\section{实验方法}
	\section{实验结果}
	\subsection{数据}
	\subsection{图表}
	\subsubsection{实验条件}
	\subsubsection{实验过程}
	\subsection{实验结果}
	\section{结论}
	\section{致谢}
\end{document}

在这里插入图片描述

\documentclass{article}

%\usepackage{ctex}

\begin{document}
	\tableofcontents
	
	\section{fdddd}
	\subsection{dsfd}
	\section{sddf}
	\subsection{dfsd}
	\section{fdddd}
	\subsection{dsfd}
	\subsubsection{dsf}
	
\end{document}

在这里插入图片描述

特殊字符

在这里插入图片描述

两个quad空格 a \qquad b a b a \qquad b 两个m的宽度
quad空格 a \quad b a b a \quad b 一个m的宽度
大空格 a\ b a   b a\ b 1/3m宽度
中等空格 a\;b a    b a\;b 2/7m宽度
小空格 a\,b a   b a\,b 1/6m宽度
没有空格 ab a b ab
紧贴 a\!b a ​ b a\!b 缩进1/6m宽度
\section{排版符号}
\S \P \dag \ddag \copyright \pounds

在这里插入图片描述

插入图片

\documentclass{article}

\usepackage{ctex}

\usepackage{graphicx}
\graphicspath{{figures/}}
\begin{document}
	\LaTeX{}中的插图:
	
	\includegraphics{heng}
	
	\includegraphics[scale=0.7]{heng}
	
	\includegraphics[height=2cm]{heng}
	
	\includegraphics[width=3cm]{heng}
	
	\includegraphics[height=0.1\textheight]{heng}
	
	\includegraphics[width=0.2\textwidth]{heng}
	
	\includegraphics[angle=-45,width=0.2\textwidth]{heng}
	
\end{document}

在这里插入图片描述

表格

\documentclass{article}

\usepackage{ctex}

\begin{document}
	\begin{tabular}{| l | c | c | c | p{1cm} |}
		\hline
		姓名 & 语文 & 数学 & 外语 & 备注 \\
		\hline
		张三 & 99 & 44 & 33 & 哈哈哈 \\
		\hline
		李四 & 9 & 8 & 3 & 补考另行通知 \\
		\hline
		王五 & 3 & 5 & 5 & \\
		\hline
	\end{tabular}
\end{document}

在这里插入图片描述

其他表格:
在这里插入图片描述

浮动体

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

\documentclass{article}

\usepackage{graphicx}
\graphicspath{{figures/}}

\usepackage{ctex}



\begin{document}
	图\ref{fig-heng}:
	\begin{figure}[htbp]
		\centering
		\includegraphics[scale=0.7]{heng}
		\caption{ 一只哼}
		\label{fig-heng}
	\end{figure}
	
	
	表格:
	\begin{table}[h]
		\centering
		\caption{成绩单}
		\begin{tabular}{| l | c | c | c | p{1cm} |}
			\hline
			姓名 & 语文 & 数学 & 外语 & 备注 \\
			\hline
			张三 & 99 & 44 & 33 & 哈哈哈 \\
			\hline
			李四 & 9 & 8 & 3 & 补考另行通知 \\
			\hline
			王五 & 3 & 5 & 5 & \\
			\hline
		\end{tabular}
	\end{table}

	图\ref{fig-chuini}:
	\begin{figure}[htbp]
		\centering
		\includegraphics[scale=0.7]{chuini}
		\caption{ 捶你}
		\label{fig-chuini}
	\end{figure}
	
\end{document}

在这里插入图片描述

数学公式初步

1.行內公式
在这里插入图片描述

2.上下标
在这里插入图片描述
3.希腊字母
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

4.数学函数
在这里插入图片描述

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

5.分式

在这里插入图片描述
在这里插入图片描述
6.行间公式
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

矩阵

\documentclass{article}

%\usepackage{graphicx}
%\graphicspath{{figures/}}
%
%\usepackage{ctex}
\usepackage{amsmath}

\begin{document}
	\[
	\begin{matrix}
		0 & 1 \\
		1 & 0
	\end{matrix} \qquad	
	\begin{pmatrix}
		0 & 1 \\
		1 & 0
	\end{pmatrix} \qquad	
	\begin{bmatrix}
		0 & 1 \\
		1 & 0
	\end{bmatrix} \qquad	
	\begin{Bmatrix}
		0 & 1 \\
		1 & 0
	\end{Bmatrix} \qquad
	\begin{vmatrix}
		0 & 1 \\
		1 & 0
	\end{vmatrix} \qquad
	\begin{Vmatrix}
		0 & 1 \\
		1 & 0
	\end{Vmatrix}
	\]
\end{document}

在这里插入图片描述

\documentclass{article}

%\usepackage{graphicx}
%\graphicspath{{figures/}}
%
%\usepackage{ctex}
\usepackage{amsmath}

\newcommand{\adots}{\mathinner{
	\mkern2mu\raisebox{0.1em}{.}
	\mkern2mu\raisebox{0.4em}{.}
	\mkern2mu\raisebox{0.7em}{.}
	\mkern1mu}}

\begin{document}
	
	\[
		A = \begin{pmatrix}
			a_{11}^2 & a_{12}^2 & a_{13}^2 \\
			0 		 & a_{22}   & a_{23} \\
			0 		 & 0 		& a_{33}
		\end{pmatrix}
	\]
	
	\[
		A = \begin{bmatrix}
			a_{11} & \dots  & a_{1n} \\
			\adots & \ddots & \vdots \\
			0 	   &  		& a_{nn}
		\end{bmatrix}_{n \times n}
	\]
	
	\[
		\begin{pmatrix}
			\begin{matrix} 1&0\\0&1 \end{matrix} & \text{\Large 0} \\
			\text{\Large 0} &  \begin{matrix} 1&0\\0&-1 \end{matrix}
		\end{pmatrix}
	\]
	
	\[
		\begin{pmatrix}
			a_{11} & a_{12} & \cdots & a_{1n} \\
				   & a_{22} & \cdots & a_{2n} \\
				   &	    & \ddots & \vdots \\
			\multicolumn{2}{c}{\raisebox{1.3ex}[0pt]{\Huge 0}}
					        &	     & a_{nn}
		\end{pmatrix}
	\]
	
\end{document}

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

行内小矩阵
	\begin{math}
		\left(
			\begin{smallmatrix}
				x & -y \\
				y & x
			\end{smallmatrix}
		\right)
	\end{math}

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

多行公式

\documentclass{article}

\usepackage{ctex}
\usepackage{amsmath}
\usepackage{amssymb}

\begin{document}
\begin{gather}
		a + b = b + a \\ 
		ab ba
	\end{gather}
	\begin{gather*}
		a + b = b + a \\ 
		ab ba
	\end{gather*}
	\begin{gather}
		a + b = b + a \notag \\ 
		abba
	\end{gather}
\end{document}

在这里插入图片描述

\begin{align}
	x &= t + \cos t + 1 \\
	y &= 2\sin t
\end{align}
\begin{align*}
	x &= t & x &= \cos t & x &= 1 \\
	y &= 2t & y &= \sin(t + 1) & y &= \sin t
\end{align*}
\begin{equation}
	\begin{split}
		\cos 2x &= \cos^2 x - \sin^2 x \\
		&= 2\cos^2 x - 1 \\
		&= ?
	\end{split}
\end{equation}

在这里插入图片描述

\begin{equation}
	D(x) = \begin{cases}
		1, & \text{if } x \in \mathbb{Q}; \\
		0, & \text{if } x \in \mathbb{R} \setminus \mathbb{Q}.
	\end{cases}
\end{equation}

在这里插入图片描述

参考文献

1.获取引用文献数据
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
2.复制粘贴到数据库

在这里插入图片描述

3.引用

\documentclass{article}

\usepackage{ctex}
\usepackage{amsmath}
\usepackage{amssymb}

\bibliographystyle{plain}

\begin{document}
	引用: \cite{mittelbach2004}
	
	haha d d :\cite{patashnik1988designing}
	
	sdfdf  \cite{mittelbach2004}
	
	\bibliography{test}

\end{document}

在这里插入图片描述

\documentclass{article}

\usepackage{ctex}
\usepackage[style=numeric,backend=biber]{biblatex}
\addbibresource{test.bib}

\begin{document}
	无格式化引用: \cite{hufflen_names_2006}
	
	带方括号引用:\parencite{previtali_bibtexml:_2001}
	
	上标引用:  \supercite{widman_bibulusperl_2003}
	
	\printbibliography
	
	

\end{document}

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/cat_xing/article/details/86602334