Latex笔记

Posted by Shen Chaoran on February 20, 2019

table

tabular

tabularx

tabu

\begin{table}
    \centering
    \caption{针对全球植被生产力评估的对比话题、对比方案和对比任务}
    \label{tab:topic-solution-task-example}
    \begin{threeparttable}
        \begin{tabu} to .9\hsize{X[1] | X[1]| X[1.5]| X[3]| X[3]| X[4]| X[1] }
            \toprule[1.5pt]
            \midrule[1.5pt]
            \bottomrule[1.5pt]
        \end{tabu}
    \end{threeparttable}
\end{table}

\begin{table}[!htbp]
    \caption{对比要素及其单位量纲}
    \label{tab:std-metrics}
    \begin{subtable}{.6\linewidth}
        \centering
        \caption{陆地生态系统碳水循环要素表}
        \begin{tabular}{llrrr}
            \Xhline{1.5pt}
            \textbf{名称} & \textbf{单位} & \textbf{最小值} & \textbf{最大值}  \\
            \Xhline{1.5pt}
            $GPP$ & $gC m^2 d^{-1}$ & 0 & 100 \\
            \Xhline{1.5pt}
        \end{tabular}
    \end{subtable}
    \begin{subtable}{.35\linewidth}
        \centering
        \caption{单位量纲表}
        \label{tab:std-metrics}
        \begin{tabular}{ll}
            \Xhline{1.5pt}
            \textbf{单位} & \textbf{量纲}  \\
            \Xhline{1.5pt}
            \multirow{3}{*}{$gC m^2 d^{-1}$} & 质量($M$\\
            & 长度($L$\\
            & 时间($T$\\
            \hline
            \multirow{2}{*}{$mm d^{-1}$} & 长度($L$\\
            & 时间($T$\\
            \Xhline{1.5pt}
        \end{tabular}
    \end{subtable}
\end{table}

图片

% 单个图片
\begin{figure}[!htbp]
    \centering
    \includegraphics[width=1\textwidth]{resource-server-microservice}
    \caption{资源服务器微服务}
    \label{fig:resource-server-microservice}
\end{figure}

% 多个图片
% \usepackage{subfigure}
\begin{figure}[!htbp]
    \centering
    \subfigure[模型微服务的发布和调用]{
    \label{fig:ms-server-microservice-}
    \includegraphics[width=0.9\textwidth]{ms-server-microservice}}

    \subfigure[模型微服务多节点分布]{
    \label{fig:ms-server-microservice}
    \includegraphics[width=0.9\textwidth]{ms-server-microservice}}
    
    \caption{计算服务器微服务}
    \label{fig:ms-server-microservice}
\end{figure}

% \usepackage{subcaption}
\begin{figure}[H]
    \caption{经纬线提取样例}
    \label{fig:example}
    \begin{subfigure}{.5\textwidth}
        \centering
        \includegraphics[width=\textwidth]{before.png}
        \caption{提取经纬线前}
    \end{subfigure}
    \begin{subfigure}{.5\textwidth}
        \centering
        \includegraphics[width=\textwidth]{after.png}
        \caption{提取经纬线后}
    \end{subfigure}
\end{figure}

\begin{figure}[!htbp]
    \centering

    \subcaptionbox{模型微服务的发布和调用}{\includegraphics[width=0.65\textwidth]{ms-server-microservice-a}}
    \hfill
    \subcaptionbox{模型微服务多节点分布}{\includegraphics[width=0.25\textwidth]{ms-server-microservice-multi-nodes}}

    \caption{计算服务器微服务}
    \label{fig:ms-server-microservice}
\end{figure}

列表

% 通用形式
\begin{list_type}  
    \item The first item 
    \item The second item 
    \item The third etc \ldots 
\end{list_type}

\documentclass{article}
\usepackage{blindtext}
\begin{document}
\begin{itemize} % 无序
    \item \blindtext
    \item \blindtext
\end{itemize}
\begin{enumerate}   % 有序
    \item \blindtext
    \item \blindtext
\end{enumerate}
\begin{description} % 以文字作为序号
    \item [Ant] \blindtext
    \item [Elephant] \blindtext
\end{description}
\end{document}

% 嵌套
\begin{enumerate}
    \item The first item
        \begin{enumerate}
            \item Nested item 1
            \item Nested item 2
        \end{enumerate}
    \item The second item
    \item The third etc \ldots
\end{enumerate}