zh-hongda

Latex

记录常用的Latex操作。

1 Table

%三线表
\usepackage{booktabs} %制作表格时使用“booktabs”包。
\usepackage{color} %调整文字颜色时使用“color”包
%
\begin{table}[htbp] %指定表格位置,“h” here,“t” top,“b” bottom,“p”
    \vspace{-1cm} %调整与上文的垂直距离,不仅适用于表格。
    \centering    %使表格居中
    \caption{Accuracy and speed comparisons on the test dataset. The best two results are shown in red and blue fonts, respectively.} %指定标题
    \begin{tabular}{cccccc} %指定一共多少列,一个“c”表示一列。也可用“l”或“r”替换,分布控制表格内容左对齐和右对齐。
        \toprule  %第一条线的规则
        & KCF & SAMF & C-COT & ECO-HC & PSCT\\
        \midrule  %第二条线的规则
        Success & 0.458 & 0.568 & 0.695 & \textcolor{blue}{0.704} & \textcolor{red}{0.792}\\ %控制表格中文字颜色
        Precision & 0.816 & 0.834 & 0.870 & \textcolor{blue}{0.900} & \textcolor{red}{0.977}\\
        \midrule %第二条线的规则
        FPS & \textcolor{red}{203.9} & 18.4 & 5.3 & 54.2 & \textcolor{blue}{54.9}\\
        \bottomrule %第三条线的规则
    \end{tabular}
\end{table}

2 Figure

%插入图
\begin{figure}[h] %指定图片位置,“h” here,“t” top,“b” bottom,“p”
    \vspace{-0.5cm} %调整图片与上文的垂直距离,不仅适用于figure。
    \setlength{\abovecaptionskip}{-0.2cm}   %调整图片标题与图片距离
    \setlength{\belowcaptionskip}{-1cm}   %调整图片标题与下文距离
    \begin{center} %使图片居中
    \includegraphics[width=80mm]{./img/a3} %指定图片路径和大小。
    \end{center}
    \caption{Success and precision plots for the 20 fast motion video sequences selected from OTB2015 and KITTI datasets. Success plots use mean AUC for ranking and precision plots use threshold = 20 for ranking.} %图片注释
\end{figure}

3 Algorithm

%生成算法
\usepackage{algorithm}
\usepackage{algorithmic}
%
\begin{algorithm}[htb] %指定算法位置,“h” here,“t” top,“b” bottom,“p”
    \caption{Our tracker’s algorithm} %标题
    \label{alg:Framwork} %标签,好像可有可无。
    \begin{algorithmic}[1] %这个1 表示算法每一行都显示行号。
        \REQUIRE ~~\\ %算法的输入参数:Input
            x: training image patch\\
            $ P_{old} $: previous frame position\\
            $ S_{old} $: previous target scale
        \ENSURE ~~\\ %算法的输出:Output
            $ P_{new} $: new position\\
            $ S_{new} $: new target scale
        \STATE\textbf{translation estimation}\\
        $ \bullet $ The response score is calculated according to Equation 2.\\
        $ \bullet $ Set $ P_{new}$ to the target position that maximizes the response.\\
        \STATE\textbf{Scale estimation}\\
        $ \bullet $ Calculate the prediction scale $ S_{new^{'}} $ according to $ S_{old} $ using Equation 7.\\
        $ \bullet $ Extract scale sample with scale $ S_{new^{'}} $ at $ P_{new}$ and calculate the response score.\\
        $ \bullet $ Set $ S_{new} $ to the target scale that maximizes the response.
        \STATE\textbf{Model update}\\
        $ \bullet $ Calculate the update interval using Equation 8.\\
        $ \bullet $ Update the model when the update interval is reached.
    \end{algorithmic}
\end{algorithm}

4 使用 BibTeX 生成参考文献列表

使用 BibTeX 生成参考文献列表