我有这段代码。我的图形列表中出现了“subcaption1”和“subcaption2”。我只希望“hej”出现在图形列表中,我该怎么做?
\begin{figure}[htbp]
\begin{minipage}[b]{0.5\linewidth}
\centering
\includegraphics[width=\linewidth]{Chapters/xxxx.jpg}
\caption{subcaption1}
\label{fig:chapter001_dist_001}
\end{minipage}
\hspace{0.5cm}
\begin{minipage}[b]{0.5\linewidth}
\centering
\includegraphics[width=\linewidth]{Chapters/xxxx.png}
\caption{subcaption2}
\label{fig:chapter001_reward_001}
\end{minipage}
\caption{hej}
\end{figure}
答案1
您可以使用该subfig
包。
\documentclass{article}
\usepackage{graphicx}
\usepackage{subfig}
\begin{document}
\listoffigures
%%
\begin{figure}[htbp]
\subfloat[][\label{fig:chapter001_dist_001}subcaption1]{%
\includegraphics[width=0.47\linewidth]{example-image-a}}
\hspace{0.06\linewidth}
\subfloat[][\label{fig:chapter001_reward_001}subcaption2]{%
\includegraphics[width=0.47\linewidth]{example-image-b}}
\caption{hej}
\label{fig:chapter001__001}
\end{figure}
In Figure~\ref{fig:chapter001__001} there are two figures, Figure~\ref{fig:chapter001_dist_001} and Figure~\ref{fig:chapter001_reward_001}.
\end{document}
编辑
根据评论中的要求,这里也有一个使用该subcaption
包的解决方案。默认情况下,子标题未列在图表列表中。
\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}% [list=true] to get caption in listoffigures
\begin{document}
\listoffigures
%%
\begin{figure}[htbp]
\begin{subfigure}[b]{0.47\linewidth}
\includegraphics[width=\linewidth]{example-image-a}
\caption{subcaption1}
\label{fig:chapter001_dist_001}
\end{subfigure}%
\hspace{0.06\linewidth}%
\begin{subfigure}[b]{0.47\linewidth}
\includegraphics[width=\linewidth]{example-image-b}
\caption{subcaption2}
\label{fig:chapter001_reward_001}
\end{subfigure}%
\caption{hej}
\label{fig:chapter001__001}
\end{figure}
In Figure~\ref{fig:chapter001__001} there are two figures, Figure~\ref{fig:chapter001_dist_001} and Figure~\ref{fig:chapter001_reward_001}.
\end{document}