ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

数模LaTex学习笔记

2021-07-25 12:03:38  阅读:518  来源: 互联网

标签:LaTex begin end 公式 笔记 数模 minipage quad png


数模LaTex学习笔记


一、必备软件

1. Mathpix Snip:用于公式截图转换为LaTex格式的公式代码

2. Tables Generator:用于表格代码的生成(推荐使用三线表)

在线网址:http://www.tablesgenerator.com/latex_tables

3.  Zotero / JabRef:两个配套软件,用于参考文献的导入

4. Adobe Acrobat DC:PDF编辑器,用于后期PDF格式论文的小改动

5. Photoshop:用于给图片润色

6. Powerpoint:用于制作一些流程图

二、导言区

%导言区
\documentclass[withoutpreface,bwprint]{cumumthsis}   %去掉封面与编号页
\usepackage{subfigure}	%用于排版多张图片
\usepackage{float}	%用于排版图片位置
\bibliographystyle{plain}	%引用样式,参考文献
\usepackage{url}
\title{数模练习}
%\usepackage{ctex}  %使文章可以使用中文

数模国赛论文模板默认可以使用中文,所以不需要这一行

三、正文区

%正文区
\begin{document}
\maketitle

\section{问题重述}    %用于分小节
\subsection{问题背景}
\subsubsection{背景1}
.
.
\section{问题分析}
.
.
\end{document}

1.摘要与关键字

\begin{abstract}
.

.\\
.
\keywords{排队论\quad 调度模型\quad}
\end{abstract}

LaTex中空行表示分段换行,多个空行和一个空行相同;

如果想要没有缩进的换行,则可以在文末用\\\setminus \setminus来换行

\quad  相当于一个空格

2.目录

%目录
%\tableofcontents

%新的一页
%\newpage

数模国赛不需要目录,所以可以注释掉目录这一行

\newpage 可以让下文从新的一页开始,但数模模板在摘要后另起一页,所以可以注释掉这一行

3.字体设置(类型,大小,粗细)

%字体族设置(罗马字体、无衬线字体、打字机字体)

%第一种方法是使用字体命令,花括号里是具体内容
\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}
%中文字体

{\songti 宋体}
{\heiti 黑体}
{\kaishu 楷书}
%字体大小

{\tiny hello}
{\scriptsize hello}
{\foodnotesize hello}
{\normalsize hello}
{\large hello}
{\Large hello}
{\LARGE hello}
{\huge hello}
{\Huge hello}

国赛论文模板已经默认好格式,如无特殊需求无需改动

4.特殊符号与运算符号表示

%两个美元符号之间输出数学公式
$ w>w_0 $     %行内公式
$$ w>w_0 $$   %行间公式
\begin{itemize}
\item 假设该线路上运行的是同一钟类型的公交车;
\item 假设每个人都为理性人
\end{itemize}

用无序列表的形式列出内容,效果如下:

  • 假设该路线上运行的是同一类型的公交车
  • 假设每个人都为理性人

LaTex中的特殊字符:

肯定记不住,需要的话直接CSDN就行

\# \$   %特殊符号前加\才能直接输出特殊符号
$ > $        %大于
$ < $        %小于
$ \ge $      %大于等于(斜等号)
$ \le $      %小于等于
$ \geq $     %大于等于(≥)
$ \leq $     %小于等于(≤)
$ \cdot $    %点乘
$ \times $   %叉乘
$ \div $     %除号

5.普通表格暨三线表

普通表格:

\begin{center}
\begin{tabular}{c|c p{1.5cm}}
 
 $ W $	    	& 某一小时内该路段运行总收益-总成本   \\ 
\hline
 $ W_0 $	    & 区分高峰和低峰的一个临界值  \\ 
\hline
 $ P $	    	& 线路在一小时内所有站的总上车人数 \\ 
\hline
 $ x $	    	& 线路在一小时内的车辆数 \\  
\hline
 $ T_t $	    & 长期趋势项 \\ 
\hline
 $ M_t $	    & 简单移动平均项 \\ 
\hline

\end{tabular}
\end{center}

\begin{center}  \end{center} 表示在这中间的文字为居中格式

c与c中间的 | 表示的是竖直的表格线

c代表居中对齐,l代表左对齐,r代表右对齐

\hline 表示水平的表格线

& 表示换入下一列

p{1.5cm} 表示列宽度为1.5cm

\\ 表示换行

三线表(可以用于符号说明):

\begin{center}
\begin{tabular}{cc}
 \toprule[1.5pt]
 \makebox[0.3\textwidth][c]{符号}	&  \makebox[0.4\textwidth][c]{意义} \\
 \midrule[1pt]
 $ W $	    	& 某一小时内该路段运行总收益-总成本   \\ 
 $ W_0 $	    & 区分高峰和低峰的一个临界值  \\ 
 $ P $	    	& 线路在一小时内所有站的总上车人数 \\ 
 $ x $	    	& 线路在一小时内的车辆数 \\  
 $ T_t $	    & 长期趋势项 \\ 
 $ M_t $	    & 简单移动平均项 \\ 
\bottomrule[1.5pt]
\end{tabular}
\end{center}

\toprule   上横线

\midrule   中间横线

\bottomrule    底横线

\makebox[0.3\textwidth][c]{符号}     用来设置宽度和位置

建议符号用公式输入,这样会使排版好看

想要画其他的表格可以在Tables Generator中先画好表,然后可以自动生成LaTex代码,直接复制粘贴到论文中就行

6.图片及浮动体设置

\begin{figure}[H]
	\caption{问题一模型示意图}
	\label{paiduimx}
	\centering
	\includegraphics[width=.6\textwidth]{排队论模型.png}
\end{figure}

\includegraphics{排队论模型.png}      引用figures文件夹中的图片,格式可以为.png .jpg .eps .pdf

\includegraphics[width=.6\textwidth]{排队论模型.png}  :可以在[]中设置格式:

scale=0.3      范围

width=3cm    宽度

height=2cm   高度

\begin{figure}[H]    H为浮动体类型(导言区必须引用float)

\caption{模型示意图}      标题,如果想要标题在下方显示则把这行代码放在/includegraphics下方

\centering   图片居中显示

\label{paiduimx}    标签(必须在\caption下一行使用),在接下来的论文中可以通过:

如图\ref{paiduimx}所示,...............

的方式来引用该图面的标签,效果为:

如图1所示,............

该引用标签可以随着图片的增添删除修改而自动变化

7.多张图面排版

\begin{figure}[H]
	\caption{低峰区到高峰区的示意图}
	\label{diaoduhou2}
	\subfigure
	{
		\begin{minipage}[b]{.3\linewidth}
			\centering
			\includegraphics[scale=0.25]{调度5.png}
		\end{minipage}
	} \quad \quad \quad \quad \quad \quad \quad 
	\subfigure
	{
		\begin{minipage}[b]{.3\linewidth}
			\includegraphics[scale=0.25]{调度6.png}
		\end{minipage}
	}
	
	\subfigure
	{
		\begin{minipage}[b]{.3\linewidth}
			
			\includegraphics[scale=0.25]{调度7.png}
		\end{minipage}
	} \quad \quad \quad \quad \quad \quad \quad
	\subfigure
	{
		\begin{minipage}[b]{.3\linewidth}
			\includegraphics[scale=0.25]{调度8.png}
		\end{minipage}
	}

	\subfigure
	{
		\begin{minipage}[b]{.3\linewidth}
			\includegraphics[scale=0.25]{调度9.png}
		\end{minipage}
	}
\end{figure}

\subfigure{}  在大的图片环境下设置小的图面环境

\begin{minipage}[b]{.3\linewidth}
            \centering
            \includegraphics[scale=0.25]{调度5.png}
\end{minipage}                                                          可以用该指令实现小的图片的排版

同一行图片之间一定不要有空行,否则会排到下一行当中去

为了使同一行图片能够完美的全部展示出来,可以在每张图片后面加多个\quad(空格)来排版

8.数学公式

1.公式(数学公式)

%上下标
3x^2-x^{21}=0   %上标
3x_2-x_{21}=0   %下标

效果如下:

3x^2-x^{21}=0

3x_2-x_{21}=0

2.行内公式

%行内公式的表示形式:

交换律可以表示为:$ a+b=b+a $,如$1+2=2+1$。

交换律可以表示为:\( a+b=b+a \),如\(1+2=2+1\)。

交换律可以表示为:
\begin(math) 
a+b=b+a 
\end(math)
,如\begin(math)
1+2=2+1
\end(math)。

注意公式中不要输入汉字,如果需要则可通过\text{汉字}来在公式中插入汉字

3.希腊字母

%希腊字母
$ \alpha $
$ \beta $
$ \gamma $    $ \Gamma $    %希腊字母的大小写形式
$ \epsilon $
$ \pi $
$ \omega $    $ \Omega $  

LaTex有自动纠错的功能,如果输入\alpha没有加美元符号,会自动帮你加上

4.数学函数

%数学函数
$ \log
$ \ln
$ \sin
$ \cos
$ \arccos

$ (sinx)^2+(cosx)^2=1 $
$ sin^2x+cos^2x=1 $

效果如下:

(sinx)^2+(cosx)^2=1

sin^2x+cos^2x=1

5.根式

$ \sqrt{2} $         %平方根
$ \sqrt[4]{x^2+2} $  $四次根式

效果如下:

\sqrt{2}

\sqrt[4]{x^2+2}

6.分式

%直接使用分式
$ 3/4 $

%利用frac命令进行
$ \frac{3}{4} $

7.行间公式

%行间公式的表示形式:
$$ a+b=b+a $$

\[ a+b=b+a \]

\begin{displaymath}
a+b=b+a
\end{displaymath}

直接使用行间公式下一行文字没有缩进,如果想要有缩进可在行间公式后面打空格

8.自动编号与不自动编号

%自动编号
\begin{equation}
a+b=b+a
\label{commutative}
\end{equation}
加法交换律如上式\ref{commutative}所示。           

%不自动编号
\begin{equation*}
a+b=b+a
\end{equation*}      %编号自动跳过该公式

有编号的公式同样可以用\label来进行标签,在下文中用\ref来引用

9.矩阵

1.简单矩阵的表示方法

%简单矩阵 :  无括号  小括号   方括号  大括号   单竖线   双竖线


\begin(matrix]
0 & 1 \\
1 & 0 
\end{matrix}                  %无括号

\begin{pmatrix}
0 & 1 \\
1 & 0 
\end{pmatrix}                 &小括号

\begin{bmatrix}
0 & 1 \\
1 & 0 
\end{bmatrix}                 &方括号

\begin{Bmatrix} 
0 & 1 \\
1 & 0              
\end{Bmatrix}                 &大括号

\begin{vmatrix}
0 & 1 \\
1 & 0 
\end{vmatrix}                 %单竖线

\begin{Vmatrix}
0 & 1 \\
1 & 0 
\end{Vmatrix}                 %双竖线

效果如下:

\begin{matrix} 0 &1 \\ 1 & 0 \end{matrix}     \begin{pmatrix} 0 & 1\\ 1 & 0 \end{pmatrix}     \begin{bmatrix} 0 &1 \\ 1 & 0 \end{bmatrix}    \begin{Bmatrix} 0 & 1 \\ 1 & 0 \end{Bmatrix}    \begin{vmatrix} 0 & 1 \\ 1 & 0 \end{vmatrix}     \begin{Vmatrix} 0 & 1 \\ 1 & 0 \end{Vmatrix}

2.上下标

\begin{bmatrix} 
a_{11} & b_{12} \\
a_{21} & b_{22)              
\end{bmatrix} 

效果如下:

\begin{bmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{bmatrix}

3.不同方向省略号

\begin{pmatrix} 
a_{11} & a_{12} & \dots & a_{1n}\\
a_{21} & a_{22) & \dots & a_{2n}\\
\vdots & \vdots & \ddots & \vdots\\
1 & 1  & 1 & 1             
\end{pmatrix}_{n \times n}

\dots     横向省略号

\vdots   纵向省略号

\ddots   斜省略号

\iddots  从左下到右上的斜省略号(需要导入 mathdots 包)

\hdotsfor{4}   跨列省略号

效果如下:

\begin{pmatrix} a_{11}& a_{12} & \dots & a_{1n}\\ a_{21} &a_{22} &\dots & a_{2n}\\ \vdots &\vdots & \ddots &\vdots \\ 1&1 & 1 & 1 \end{pmatrix}_{n\times n}

4.分块矩阵

\begin{pmatrix} 
\begin{matrix}
1 & 0\\
0 & 1
\end{matrix} & \Large 0\\
\text{\large} 0 & \begin{matrix}
1 & 0\\
0 & 1
\end{matrix}       
\end{pmatrix}

直接输入0为数学公式中的0,用\text输入0为文本形式的0

效果如下:

\begin{pmatrix} \begin{matrix} 1 &0 \\ 0 &1 \end{matrix} & \Large 0\\ \text{\large 0} &\begin{matrix} 1 &0 \\ 0 & 1 \end{matrix} \end{pmatrix}

6.三角矩阵

\begin{pmatrix} 
a_{11} & a_{12} & \dots & a_{1n}\\
& a_{22} & \dots & a_{2n}\\
&  & \ddots & \vdots\\
\multicolumn{2}{c}{\raisebox{1.3ex}[0pt]}{\Huge 0} &  & a_{nn}            
\end{pmatrix}_{n \times n}

\nulticolumn {所占列数}{内容偏移(左对齐,居中,右对齐)}{内容}

\raisebox   用来控制盒子的升降(很奇怪,可以把 0放大并向移动位置但里面的参数似乎并不起控制作用)

效果如下:

\left(\begin{array}{cccc} a_{11} & a_{12} & \cdots & a_{1 n} \\ & a_{22} & \cdots & a_{2 n} \\ \text{\Large 0} & & \ddots & \vdots \\ & & & a_{n n} \end{array}\right)

7.行内小矩阵

$\left(
\begin{smallmatrix}
x & -y \\ y & -x
\end{smallmatrix}
\right)$

通过 \left(     \right) 指令来实现输入行内矩阵

10.多行公式的排版

1.gather环境 多个公式居中排版

%gather环境
\begin{gather}
a+b=b+a\\
abc=bac \notag
\end{gather}

每个公式都会有编号,如果不想有编号就在gather后加*,或者在不想有编号的那一行后面加 \notag 

2.align环境 多个公式对齐排版

%align环境  特点:可以实现对应部分的对齐
\begin{align}
x &= 1+4 \\
y &= 2+8
\end{align} 

% 多列公式的对齐(注意每列公式中间要加&)
\begin{align}
x &= 1+4 $ a &=4+9 \\
y &= 2+8 $ b &=3+1
\end{align} 

想要等号在同一个位置对齐,可以在等号前面加&

3.split环境 连等号 居中编号

%split  equation下,实现居中编号,连等公式

\begin{equation}
\begin{split}

\cos 2x =\cos^2 x - \sin^2 x \\
&= 2\cos^2 x - 1

\end{split}
\end{equation}

在需要连等的等号前面加&

4.cases环境 分段函数

%case环境 用于分段函数
%每一行公式用&连接每一个部分
%euqation大环境下,想要输入文本用\text{}

\begin{equation}

F(x)= \begin{cases}
1, & \text{如果} x=10; \\
2, & \text{如果} x=20; \\
\end{cases}

\end{equation}

11.用 Mathpix 截图读取公式

快捷键:Ctrl + Alt + M

12.用 Zotero 实现参考文献自动导入

\bibliography{book}

从外部导入文献

13.输入代码

\appendix                                 %附录
\section{排队论源代码}
\begin{lstlisting}[language=matlab]
.
.
.
\end{lstlisting}   	

标签:LaTex,begin,end,公式,笔记,数模,minipage,quad,png
来源: https://blog.csdn.net/shenmideshuaige/article/details/119062134

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有