0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

LaTeXで1つの図番号に(a)(b)を付けるsubcaptionの使い方

Last updated at Posted at 2024-11-26

はじめに

LaTeXで複数枚の図を挿入する際、ひとつの図番号の中に(a)や(b)のような小見出しを付けたい場合は、subcaptionパッケージを使用する。これにより、1つの図環境内で複数のサブキャプションを扱えるようになる。
以下をプリアンブル中(\begin{document} より前)に記述しておく。

\usepackage{subcaption}

実装例

\begin{figure}[tbp]
  \centering
  \begin{minipage}{.43\linewidth}
    \centering
    \includegraphics[width=\linewidth]{画像a.pdf}
    \subcaption{画像a}
    \label{fig:画像a}
  \end{minipage}
  \hspace{5mm}
  \begin{minipage}{.43\linewidth}
    \centering
    \includegraphics[width=\linewidth]{画像b.pdf}
    \subcaption{画像b}
    \label{fig:画像b}
  \end{minipage}
  \caption{画像A}
  \label{fig:画像A}
\end{figure}

サブキャプションを付けない場合

ちなみにサブキャプションをつけない場合は以下のようになる。

\begin{figure}[tbp]
  \centering
  \begin{minipage}{.43\linewidth}
    \centering
    \includegraphics[width=\linewidth]{画像A.pdf}
    \caption{画像A}
    \label{fig:画像A}
  \end{minipage}
  \hspace{5mm}
  \begin{minipage}{.43\linewidth}
    \centering
    \includegraphics[width=\linewidth]{画像B.pdf}
    \caption{画像B}
    \label{fig:画像B}
  \end{minipage}
\end{figure}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?