空行
- 使用空行表示换行,另一行开头会带有缩进
- \par表示换行,另一行开头会带有缩进
- 双斜杠\\,表示换行时下一行不会带有缩进
- \\[5mm],表示空行间距5mm
- \vspace{5cm},插入垂直间隔距离5cm
排版分段函数
\begin{equation*}
\centering
{\bf max}\quad z = 0.1*x_1 + 0.03*x_2 + 0.04*x_3 + 0.01*x_4
\end{equation*}
\begin{equation*}
\centering
total\quad risk = 0.8*x_1 + 0.2*x_2 + 0.3*x_3
\end{equation*}
\begin{equation*}
\centering
{\bf s.t}\quad
\begin{cases}
x_1 & \leq 0.75 \\
x_3 - x_2 & \geq 0 \\
x_4 & \geq 0.1 \\
x_4 & \leq 0.3 \\
x_1 + x_2 + x_3 + x_4 & = 1 \\
0.8*x_1 + 0.2*x_2 + 0.3*x_3 & \leq option \\
x_1, x_2, x_3, x_4 & \geq 0 \\
\end{cases}
\end{equation*}
效果如下图:
公式对齐
\begin{equation*}
\begin{aligned}
(\omega^*,b^*) & = \mathop{argmin}\limits_{(\omega,b)}\sum^m_{i=1}(y_i-f(x_i))^2 \\
& = \mathop{argmin}\limits_{(\omega,b)}\sum^m_{i=1}(y_i-\omega(x_i)-b)^2
\end{aligned}
\end{equation*}
效果如下图:
解决latex明明有足够的留白,但是图片会被挤到下一页的情况
将代码:
\usepackage{graphicx}
\begin{figure}[hbt]
\centering
\includegraphics[scale=0.5]{figures/Yelp2013-classifier}
\caption{Yelp2013-classifier}
\label{Yelp2013-2}
\end{figure}
改为:
\usepackage{float}
\usepackage{graphicx}
\begin{figure}[H]
\centering
\includegraphics[scale=0.5]{figures/Yelp2013-classifier}
\caption{Yelp2013-classifier}
\label{Yelp2013-2}
\end{figure}
- 将figure[htb]中的“htb”改为“H”
- 需要导入“float”包