1.插入圖片
1). 單幅圖片插入
%功能包
\usepackage{graphicx}
%多圖並排
\usepackage{subfigure}
\begin{figure}[htbp]
%控制圖片與文字距離,留白區域
\vspace{-1cm}
\setlength{\abovecaptionskip}{0pt}
\setlength{\belowcaptionskip}{0pt}
\centering
\includegraphics[width=0.5\textwidth]{./images/opti.png}
\caption{equivalance of trace of cov }
\label{fig:initialtrajectories}
\end{figure}
參考鏈接:
a. 圖片位置控制: 圖片位置控制
b.圖片排版:Latex排版札記
2).調整正文與算法、圖片、公式之間的空白的技巧
shrink space tricks in latex (algorithm, equation and itemize)
Before and after algorithms:
\setlength{\textfloatsep}{0.1cm}
\setlength{\floatsep}{0.1cm}
http://tex.stackexchange.com/questions/62720/vertical-space-after-algorithm
Before and after equations:
\usepackage{amsmath}
\makeatletter
\g@addto@macro\normalsize{%
\setlength\abovedisplayskip{-6pt}
\setlength\belowdisplayskip{0pt}
\setlength\abovedisplayshortskip{-6pt}
\setlength\belowdisplayshortskip{0pt}
}
\makeatother
Before and after itemize:
\usepackage{enumitem}
\setlist{nolistsep}
2. Latex公式編輯
1). 子公式編號和不編號
舉例:
\begin{subequations}
\begin{align}
\mathop {\min }\limits_{\mathbf{x},\mathbf{u},\bm{\epsilon}} ~~~~~~~&\sum_{k=0}^{N-1}(\mathbf{x}_k - \mathbf{r}_k)^T \mathbf{Q} (\mathbf{x}_k - \mathbf{r}_k) + \\
&(\mathbf{x}_N - \mathbf{r}_N) \mathbf{Q}_N (\mathbf{x}_N - \mathbf{r}_N) + \nonumber\\
&\mathbf{u}_k^T \mathbf{R} \mathbf{u}_k +\sum_{k=1}^{N} \bm{\epsilon}_k^T \mathbf{P} \bm{\epsilon}_k \nonumber \\
\textit{s.t.}~~~~~~~~ &\mathbf{x}_{k+1} = \mathbf{A} \mathbf{x}_k + \mathbf{B} \mathbf{u}_k~~~~~k=0,\cdots N-1\\
&\mathbf{F} \mathbf{x}_k \leqslant \mathbf{f} \qquad \qquad \qquad~ k=0,\cdots N-1\\
&\mathbf{M} \mathbf{u}_k \leqslant \mathbf{m} \qquad \qquad~~~~~k=0,\cdots N-1\\
&\mathbf{S}_k \mathbf{x}_k \leqslant \mathbf{s}_k + \bm{\epsilon}_k\qquad \quad k=0,\cdots N-1\\
&\bm{\epsilon}_k \geqslant \qquad \qquad \qquad \quad ~k=0,\cdots N-1
\end{align}
\end{subequations}
2). 公式大小調整方法 (換行,縮小字體,設置字體大小)
3. latex表格中一格換行
可以先用latex在線表格編輯提供模板:Latex在線表格繪製
鏈接:Latex表格中強制換行
表格過窄過寬調節方法表格過大過小調整方法