latex 图子标题
时间: 2023-09-07 10:16:10 浏览: 171
在LaTeX中添加图的子标题可以使用subfigure或subcaption宏包。下面是三个示例:
示例1:使用subfigure宏包
```latex
\usepackage{subfigure}
\begin{figure}[htbp]
\begin{center}
\subfigure[Positions trajectories and errors]{
\includegraphics[width=0.47\linewidth]{FreeF1.eps}
}
\subfigure[Velocities trajectories and errors]{
\includegraphics[width=0.47\linewidth]{FreeF2.eps}
}
\caption{Tracking control for MAS without any faults.}
\end{center}
\end{figure}
```
示例2:使用subcaption宏包
```latex
\usepackage{subcaption}
\begin{figure}
\begin{subfigure}{.48\textwidth}
\centering
Contents of the sub-figure
%\includegraphics[width=5cm]{cherry_blossom}
\caption{Subfig 1}
\label{sf1}
\end{subfigure}
\begin{subfigure}{.48\textwidth}
\centering
Contents of the sub-figure
%\includegraphics[width=5cm]{cherry_blossom}
\caption{Subfig 2}
\label{sf2}
\end{subfigure}
\caption{A figure}
\label{fig}
\end{figure}
```
示例3:使用subcaption宏包并自定义子标题格式
```latex
\usepackage[labelformat=simple]{subcaption}
\renewcommand\thesubfigure{(\alph{subfigure})}
\begin{figure}
\begin{subfigure}{.48\textwidth}
\centering
Contents of the sub-figure
%\includegraphics[width=5cm]{cherry_blossom}
\caption{Subfig 1}
\label{sf1}
\end{subfigure}
\begin{subfigure}{.48\textwidth}
\centering
Contents of the sub-figure
%\includegraphics[width=5cm]{cherry_blossom}
\caption{Subfig 2}
\label{sf2}
\end{subfigure}
\caption{A figure}
\label{fig}
\end{figure}
```
这些示例中,你可以根据需要修改图像的路径和大小,以及子标题的内容。
阅读全文