Latex 插入表格(table )
栗子 1.1、插入2行2列的表格
parameter values era given in Table \ref{tab:tab2}.
\begin{table}[h]
\centering
\caption{table}\label{tab:tab2}
\begin{tabular}{|c|c|}
\hline
a & b \\\hline
c & d\\
\hline
\end{tabular}
\end{table}
編譯效果:

栗子 1.2、插入3行2列的表格
\begin{table}[h]
\centering
\caption{table}\label{tab:tab2}
\begin{tabular}{|c|c|}
\hline
a & b \\\hline
c & d\\\hline
e & f\\
\hline
\end{tabular}
\end{table}
編譯效果:
栗子 1.3、表格中的内容,居中對齊
\begin{table}[h]
\centering
\caption{con}\label{tab:tab2}
\begin{tabular}{|c|c|}
\hline
Controller (\ref{out1}) & $K_1=diag\{10, 10, 10\}, K_2=diag\{8, 8, 8\}, \alpha_1=0.45, \alpha_2=0.6207$ \\\hline
Observer (\ref{ob1}) & $L_1=I_{3\times3}, L_2=diag\{0.5, 0.5, 0.5\}, \beta_1=0.45, \beta_2=0.6207$ \\\hline
Controller (\ref{at1}) (\ref{at2}) & $K_3=diag\{15, 15, 15\}, K_4=diag\{10, 10, 10\}, \alpha_1=0.45, \alpha_2=0.6207$\\\hline
Tracking differentiator (\ref{linear}) & $H=diag\{10, 10, 10\}$\\
\hline
\end{tabular}
\end{table}
注:語句 \begin{tabular}{|c|c|} (使用該語句設定表格内容的對齊方式)
這一行最後一個參數c改成l,還可以改成r。
c:center
r:right
l:left
Latex 插入圖形(figure)
- 講解插入figure 的相關語:(http://www.zhixing123.cn/matlab/draw-and-align-table-in-latex.html)
-
注意事項:(http://www.cnblogs.com/mmer/p/3762173.html)
栗子 2.1、插入2行1列的圖形清單
\begin{figure} %%%旋轉子系統姿态角
\centering
\subfigure{
\label{fig:subfig:a} % label for first subfigure
\includegraphics[width=cm,height=cm]{ftattitude.eps}}
\hspace{in}
\subfigure{
\label{fig:subfig:b} % label for second subfigure
\includegraphics[width=cm,height=cm]{pdattitude.eps}}
\caption{Response curves of Euler angles for the translational subsystem in the presence of external disturbances. (a) Euler angles $\bm{\Theta}$ under the finite - time control scheme. (b) Euler angles $\bm{\Theta}$ under the PD control scheme}
\label{fig:attitude} % label for entire figure
\end{figure}
編譯效果:
栗子 2.2、插入3行3列的圖形清單
\begin{figure} %%%%%%%% 觀測幹擾的結果
\begin{minipage}{0.2\textwidth} %% {.\textwidth}
\centerline{\includegraphics[width=\textwidth]{e_11.eps}}
\centerline{(a)}
\end{minipage}
\hfill
\begin{minipage}{.\textwidth} %% {0.18\textwidth}
\centerline{\includegraphics[width=1\textwidth]{e_12.eps}}
\centerline{(b)}
\end{minipage}
\vfill
\begin{minipage}{0.2\textwidth} %% {.\textwidth}
\centerline{\includegraphics[width=\textwidth]{e_13.eps}}
\centerline{(c)}
\end{minipage}
\hfill
\begin{minipage}{.\textwidth}
\centerline{\includegraphics[width=\textwidth]{e_21.eps}}
\centerline{(d)}
\end{minipage}
\vfill
\begin{minipage}{.\textwidth}
\centerline{\includegraphics[width=\textwidth]{e_22.eps}}
\centerline{(e)}
\end{minipage}
\hfill
\begin{minipage}{.\textwidth}
\centerline{\includegraphics[width=\textwidth]{e_23.eps}}
\centerline{(f)}
\end{minipage}
\caption{Response curves of disturbance estimation error under FTDO, with $\bm{e}_1=[e{}, e{}, e{}]^T$ in (a), (b) and (c). $\bm{e}_2=[e{}, e{}, e{}]^T$ in (d), (e) and (f).}
\label{fig:ob}
\end{figure}
編譯效果:
Latex 中插入的表格,同時調整單行表格的高度
上圖缺陷:标注部分想顯示“\bar{l}”, 但是顯示效果上來看符号“\bar”和表格的橫線重合了。
調整表格的行間距:
\begin{table*}[ht]
\caption{Control Parameters for Finite-Time Tracking Control Scheme}\label{tab:tab2}
\centering % 表居中
\begin{tabular}{|l|l|}
\hline
Observer (\ref{ftdo1}) & $\lambda_0=3, \lambda_1=1.5, \lambda_3=1.1, L_1=diag\left(50, 50, 50\right)$ \\\hline
Controller under FTDRC (\ref{w-drc-1}) & $ p_1=\left. 15\middle/13 \right.,k_1=4.0968, k_2= 1.0375, l= 3$ \\\hline
Controller under ASC (\ref{asc-w1}) & $ k_1=4.0968, k_2= 1.0375, l= 3$ \\\hline
Observer (\ref{ftdo2}) & $\lambda_3=3, \lambda_4=1.5, \lambda_5=1.1, L_2=diag\left(30, 30, 30\right)$\\\hline
Controller under FTDRC (\ref{drc-att1}) &$ p_2= \left. 11\middle/9 \right.$, $k_3= 6.1343,$ $k_4= 422.1910,$ $\bar{l}= 5$ \\\hline
Controller under ASC (\ref{asc-att1}) &$k_3= 6.1343, k_4= 422.1910, \bar{l}= 5$ \\\hline
\end{tabular}
\end{table*}
編譯效果:
代碼變動:
隻需要添加兩行代碼:
- 導言區添加 \usepackage{array} % 表格的高度可設定
- 啟用新的 \renewcommand\arraystretch{1.5} % 表格的高度是預設值的1.5倍, 可自定義設定