Latex美赛建模中一些常见的使用

Latex美赛建模中一些常见的使用

刚刚采用Latex完成了这次美赛(基于美赛latex模板),总结了一直都在使用的万能三线表、插图、插公式的笔记。希望对三月的美赛朋友们有帮助!里面的部分来自模板部分来自b站大佬视频部分来自优秀博客啦~

目录

在标题页\maketitle 与正文页中间

\newpage
\thispagestyle{empty} %不要页眉那种格式
\tableofcontents
\newpage
\setcounter{page}{1} %正文第一页为page1
标题
\section{一级标题}
\subsection{二级标题}
\subsubsection{三级标题}
%点状无序列表
\begin{itemize}
\item This is the first list
\item This is the second list
\item This is the third list
\end{itemize}
%顺序标号列表
\begin{enumerate}
\item This is the first list with label 1
\item This is the second list with label 2
\item This is the third list with label 3
\end{enumerate}

其中,我们可以参考itemize,enumerate的参数,更改序号样式、行间距等。

\begin{itemize}[labelsep = .5em,leftmargin = 0pt, itemindent = 1.5em]
制作表格

推荐自动制作表格的网站:[Create LaTeX tables online – TablesGenerator.com]

符号说明
%推荐
\begin{table}[h]
	\begin{center}
	\caption{Smybol Description}
	\begin{tabular}{cc}
		\toprule[1.5pt]
		\makebox[0.3\textwidth][c]{\textbf{Smybol}}	&  \makebox[0.4\textwidth][c]{\textbf{Definition}} \\
		\midrule[1pt]
		$w_i$  & The weight corresponding to the k-th evaluation indicator\\
		$\xi_i(k)$ & Grey correlation coefficient \\
		$ r_i$ & Grey weighted correlation \\
		$\rho$ & Resolution coefficient \\
		$r_{jk}$ & R-type correlation coefficient \\
		$D(G_m,G_n)$ & variable distance \\
		$G_i$ & i-th genre \\
		$X_i$ & Feature vector of the i-th artist \\
		$\mathcal{S}$ & Cosine similarity, similarity measure \\
		$\lambda_i$ & Specific i-th eigenvalue \\
		$r_s$ & Spearman correlation coefficient \\
		
		$\mathscr{M}$ & a matrix with eigenvectors as elements \\
				
		$\lambda_i $ &  an eigenvector \\
		
		$\mathscr{F}$ & is a functional mapping from $\lambda$ to time \emph{t}. \\
		
		$ \nabla \mathscr{F}$ & gradient \\	
		\bottomrule[1.5pt]
	\end{tabular}
\end{center}
\end{table}
三线表
\begin{table}[h]
	\begin{center}
	\caption{The table}
	\begin{tabular}{ccc}
		\toprule[1.5pt]
		\makebox[0.2\textwidth][c]{\textbf{id}}	&  \makebox[0.2\textwidth][c]{\textbf{name}} 
		&\makebox[0.2\textwidth][c]{\textbf{score}}\\
		\midrule[1pt]
		01 & Y    & 98    \\
		02 & B    & 100  \\
		\bottomrule[1.5pt]
	\end{tabular}
	\label{t1}
	\end{center}
\end{table}
伪代码
% 首先导入宏包
\usepackage{algorithm}
\usepackage{algorithmicx}
%伪代码写法
\begin{algorithm}
	\caption{HHS}
	\label{hhsa}
	\begin{algorithmic}[1]  %1表示每隔一行编号	
		\Require The original signal $x$.
		\Ensure  The energy-time-frequency distribution of $x$. 
		\Function{EMD}{$x, seg\_len$}
		\State $ N \gets length(x) / seg\_len$;
		\For {$i=1 \to i=N$}
		\State $seg(i) \gets x(1+(i-1)*seg\_len : i*seg\_len)$;
		\EndFor
		\EndFunction
	\end{algorithmic}
\end{algorithm}
图片
\begin{figure}[h] %h:放在当前位置(代码所处的位置)
\small %图片小一点,不用也可
\centering %图片居中
\includegraphics[width=12cm]{example-image-a} %{}图片名字,图片放在文件图片下;[]宽度
\caption{The name of figure} \label{f} %\caption:标题 \lable:标签,引用
\end{figure}
!!注意:表格和图片均为浮动体,不要管。写作的时候不要写如上图所示,as shown below:, 通过引用label!\eqref{label 名称} (1)或者\ref{label 名称} 1;\tag 手动修改公式编号;\notag或者\nonumber 为取消公式编号。
公式

推荐一个自动识别公式的软件:Mathpix Snipping Tool

行内公式
The Inline formula is like $y = ax^2 + bx + c$
行间公式
% 1
% 运用 \[ formula \]
%需要手动编号 \eqno(1)
\[
\left\{\begin{array}{l}
	y=\beta_{0}+\beta_{1} x_{1}+\cdots+\beta_{m} x_{m}+\varepsilon \\
	\varepsilon \sim N\left(0, \sigma^{2}\right)
\end{array}\right. \eqno (1)
\]
%2
%运用align
%可自动编号
the equation (\ref{eq1}) is
\begin{align}
	\varepsilon=\left[\begin{array}{lll}
		\varepsilon_{1} & \cdots & \varepsilon_{n}
	\end{array}\right]^{T}, \quad \beta=\left[\begin{array}{lll}
		\beta_{1} & \beta_{2} & \beta_{m}
	\end{array}\right]^{T}
\label{eq1}
\end{align}
%3
%使用equation
%可自动编号
\lipsum[8] \eqref{aa} %lipsum随机生成段落
\begin{equation}
a^2 
\label{aa}
\end{equation}
!!注意:文章选定一种方法书写公式,不要三者随意切换使用,编号是互不连贯兼容的,所以推荐大家采用第二种或者第三种。其对其方式有四种,align,split,还有啥忘了,但是一般通篇我采用align就可以了。
规划问题——目标函数和约束条件
\begin{align*}
	&\max \quad \frac{\sum\limits_{x_i,x_j \in D^{*}} 2\mathcal{S}(X_i,X_j)}{n!} \quad i,j=1,2,\ldots,n\\
	&\min \quad \frac{\sum\limits_{x_i\in D^{*},x_j\in \overline D^{*}} \mathcal{S}(X_i,X_j)}{mn} \quad i=1,2,\ldots,n,j = 1,2,\dots,m\\
	& \begin{array}{r@{\quad}l@{}l@{\quad}l}
		s.t.& 0 \leq \lambda_1 \leq 11 ,& \lambda_1 \in \mathbb{N}^+\\
		&0 \leq \lambda_2 \leq 1 \\
		& \lambda_3 \geq 0 ,& \lambda_3 \in \mathbb{N}^+\\
		&0 \leq \lambda_4 \leq 1 \\
		& \lambda_5 = 0 / 1
	\end{array} .
\end{align*}
参考文献
\addcontentsline{toc}{section}{Reference}
!!!注意:交叉编译和目录都至少要编译2次以上才会显示
\begin{thebibliography}{99} %99代表最多99行,无多大影响
\bibitem{1} article 1
\bibitem{2} article 2
\bibitem{3} \url{website}
\end{thebibliography}
cite{3} % 引用
写书信
\begin{letter}{Dear, Mr. Alpha Chiang}

\lipsum[1-2] %替换即可
\vspace{\parskip}

Sincerely yours,

Your friends

\end{letter}
写备忘录
\newpage %另起一页
\memoto{WHO} %写给谁的
\memofrom{2103824} %谁写的
\memosubject{Theme} %主题
\memodate{2021-02-09}
\memologo{} %logo
\begin{memo}
	\lipsum[1-3] %随机生成文字
\end{memo}
  • 8
    点赞
  • 61
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值