Skip to content

子图子表

mohuangrui edited this page Dec 10, 2019 · 4 revisions

子图

子图的实现为使用 subcaption 所提供的 subfigure 环境:

\begin{figure}[!htbp]
    \centering
    \begin{subfigure}[b]{0.35\textwidth}
      \includegraphics[width=\textwidth]{oaspl_a}
      \caption{}
      \label{fig:oaspl_a}
    \end{subfigure}%
    ~% add desired spacing
    \begin{subfigure}[b]{0.35\textwidth}
      \includegraphics[width=\textwidth]{oaspl_b}
      \caption{}
      \label{fig:oaspl_b}
    \end{subfigure}
    \\% line break
    \begin{subfigure}[b]{0.35\textwidth}
      \includegraphics[width=\textwidth]{oaspl_c}
      \caption{}
      \label{fig:oaspl_c}
    \end{subfigure}%
    ~% add desired spacing
    \begin{subfigure}[b]{0.35\textwidth}
      \includegraphics[width=\textwidth]{oaspl_d}
      \caption{}
      \label{fig:oaspl_d}
    \end{subfigure}
    \bicaption{总声压级。(a) 这是子图说明信息,(b) 这是子图说明信息,(c) 这是子图说明信息,(d) 这是子图说明信息。}{OASPL.(a) This is the explanation of subfig, (b) This is the explanation of subfig, (c) This is the explanation of subfig, (d) This is the explanation of subfig.}
    \label{fig:oaspl}
\end{figure}

其效果如下:

screen shot 2019-02-20 at 21 05 05

子表

子表的实现为使用 subcaption 所提供的 subtable 环境:

\begin{table}[!htbp]
    \bicaption{这是一个样表。}{This is a sample table.}
    \label{tab:sample_multitables}
    \centering
    \footnotesize% fontsize
    \setlength{\tabcolsep}{4pt}% column separation
    \renewcommand{\arraystretch}{1.2}%row space 
    \begin{subtable}[t]{0.45\textwidth}
        \centering
        \bicaption{子表1。}{Subtable 1.}
        \label{tab:sample_1}
        \begin{tabular}{lcccccccc}
            \hline
            Row number & \multicolumn{8}{c}{This is a multicolumn} \\
            %\cline{2-9}% partial hline from column i to column j
            \hline
            Row 1 & $1$ & $2$ & $3$ & $4$ & $5$ & $6$ & $7$ & $8$\\
            Row 2 & $1$ & $2$ & $3$ & $4$ & $5$ & $6$ & $7$ & $8$\\
            Row 3 & $1$ & $2$ & $3$ & $4$ & $5$ & $6$ & $7$ & $8$\\
            Row 4 & $1$ & $2$ & $3$ & $4$ & $5$ & $6$ & $7$ & $8$\\
            \hline
        \end{tabular}
    \end{subtable}
    ~% add desired spacing
    \begin{subtable}[t]{0.45\textwidth}
        \centering
        \bicaption{子表2。}{Subtable 2.}
        \label{tab:sample_2}
        \begin{tabular}{lcccccccc}
            \hline
            Row number & \multicolumn{8}{c}{This is a multicolumn} \\
            %\cline{2-9}% partial hline from column i to column j
            \hline
            Row 1 & $1$ & $2$ & $3$ & $4$ & $5$ & $6$ & $7$ & $8$\\
            Row 2 & $1$ & $2$ & $3$ & $4$ & $5$ & $6$ & $7$ & $8$\\
            Row 3 & $1$ & $2$ & $3$ & $4$ & $5$ & $6$ & $7$ & $8$\\
            Row 4 & $1$ & $2$ & $3$ & $4$ & $5$ & $6$ & $7$ & $8$\\
            \hline
        \end{tabular}
    \end{subtable}
    \\% line break
    \begin{subtable}[t]{0.45\textwidth}
        \centering
        \bicaption{子表3。}{Subtable 3.}
        \label{tab:sample_3}
        \begin{tabular}{lcccccccc}
            \hline
            Row number & \multicolumn{8}{c}{This is a multicolumn} \\
            %\cline{2-9}% partial hline from column i to column j
            \hline
            Row 1 & $1$ & $2$ & $3$ & $4$ & $5$ & $6$ & $7$ & $8$\\
            Row 2 & $1$ & $2$ & $3$ & $4$ & $5$ & $6$ & $7$ & $8$\\
            Row 3 & $1$ & $2$ & $3$ & $4$ & $5$ & $6$ & $7$ & $8$\\
            Row 4 & $1$ & $2$ & $3$ & $4$ & $5$ & $6$ & $7$ & $8$\\
            \hline
        \end{tabular}
    \end{subtable}
    ~% add desired spacing
    \begin{subtable}[t]{0.45\textwidth}
        \centering
        \bicaption{子表4。}{Subtable 4.}
        \label{tab:sample_4}
        \begin{tabular}{lcccccccc}
            \hline
            Row number & \multicolumn{8}{c}{This is a multicolumn} \\
            %\cline{2-9}% partial hline from column i to column j
            \hline
            Row 1 & $1$ & $2$ & $3$ & $4$ & $5$ & $6$ & $7$ & $8$\\
            Row 2 & $1$ & $2$ & $3$ & $4$ & $5$ & $6$ & $7$ & $8$\\
            Row 3 & $1$ & $2$ & $3$ & $4$ & $5$ & $6$ & $7$ & $8$\\
            Row 4 & $1$ & $2$ & $3$ & $4$ & $5$ & $6$ & $7$ & $8$\\
            \hline
        \end{tabular}
    \end{subtable}
\end{table}

其效果如下:

screen shot 2019-02-20 at 21 11 52

子图子表引用

如果想将 图2.4a 改为 图2.4(a),可用:

\ref{fig:oaspl}(\subref{fig:oaspl_a})
Clone this wiki locally