![子标题 - 如何使用“图 x”代替字母编号?](https://linux22.com/image/384083/%E5%AD%90%E6%A0%87%E9%A2%98%20-%20%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%E2%80%9C%E5%9B%BE%20x%E2%80%9D%E4%BB%A3%E6%9B%BF%E5%AD%97%E6%AF%8D%E7%BC%96%E5%8F%B7%EF%BC%9F.png)
我当前的图像表如下所示:
但是,我希望标题包含“图”而不是 (a),并继续从之前的图开始编号。我该怎么做?
一位 MWE 表示:
\documentclass{article}
\usepackage{graphicx} % Figures
\usepackage{subcaption}
\begin{document}
\begin{figure}[t!]
\centering
\begin{subfigure}[b]{0.3\linewidth}
\includegraphics[width=\linewidth]{Media/Speaker.png}
\caption{JBL Flip 4 Speaker\\ }
\end{subfigure}
\begin{subfigure}[b]{0.3\linewidth}
\includegraphics[width=\linewidth]{Media/Meter.png}
\caption{Dostmann SL328 Sound Level Meter}
\end{subfigure}
\begin{subfigure}[b]{0.3\linewidth}
\includegraphics[width=\linewidth]{Media/test.png}
\caption{Computer with Bluetooth, Python 3.7.0, and pyaudio module.}
\end{subfigure}
\begin{subfigure}[b]{0.3\linewidth}
\includegraphics[width=\linewidth]{Media/test.png}
\caption{6}
\end{subfigure}
\begin{subfigure}[b]{0.3\linewidth}
\includegraphics[width=\linewidth]{Media/test.png}
\caption{4}
\end{subfigure}
\begin{subfigure}[b]{0.3\linewidth}
\includegraphics[width=\linewidth]{Media/test.png}
\caption{5}
\end{subfigure}
\label{fig:test}
\end{figure}
\end{document}
答案1
不要使用subfigure
,而要使用minipage
:
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}[t!]
\begin{minipage}[b]{0.3\linewidth}
\includegraphics[width = \linewidth]{example-image-a}
\caption[JBL Flip 4 Speaker]
{JBL Flip 4 Speaker \\ \\}
\end{minipage}\hfill
\begin{minipage}[b]{0.3\linewidth}
\includegraphics[width = \linewidth]{example-image-b}
\caption[Dostmann SL328 Sound Level Meter]
{Dostmann SL328 Sound Level Meter \\}
\end{minipage}\hfill
\begin{minipage}[b]{0.3\linewidth}
\includegraphics[width = \linewidth]{example-image-c}
\caption{Computer with Bluetooth, Python 3.7.0, and pyaudio module.}
\end{minipage}
\bigskip
\begin{minipage}[b]{0.3\linewidth}
\includegraphics[width = \linewidth]{example-image-c}
\caption{6}
\end{minipage}\hfill
\begin{minipage}[b]{0.3\linewidth}
\includegraphics[width = \linewidth]{example-image-b}
\caption{4}
\end{minipage}\hfill
\begin{minipage}[b]{0.3\linewidth}
\includegraphics[width = \linewidth]{example-image-a}
\caption{5}
\end{minipage}
\end{figure}
\end{document}
这样编号就会连续。
答案2
您应该更改命令\thesubfigure
并使用 添加一些格式细节\captionsetup
。
也可以看看http://www.peteryu.ca/tutorials/publishing/latex_captions以获得更多选项。
\documentclass{article}
\usepackage{graphicx} % Figures
\usepackage{subcaption}
\renewcommand{\thesubfigure}{Figure \arabic{subfigure}}
\captionsetup[subfigure]{labelformat=simple, labelsep=period}
\begin{document}
\begin{figure}[t!]
\centering
\begin{subfigure}[b]{0.3\linewidth}
\includegraphics[width=\linewidth]{example-image-a}
\caption{A1}
\end{subfigure}
\begin{subfigure}[b]{0.3\linewidth}
\includegraphics[width=\linewidth]{example-image-duck}
\caption{It's a duck}
\end{subfigure}
\begin{subfigure}[b]{0.3\linewidth}
\includegraphics[width=\linewidth]{example-image-c}
\caption{C1}
\end{subfigure}
\begin{subfigure}[b]{0.3\linewidth}
\includegraphics[width=\linewidth]{example-image-duck}
\caption{Here is a duck}
\end{subfigure}
\begin{subfigure}[b]{0.3\linewidth}
\includegraphics[width=\linewidth]{example-image-b}
\caption{B2}
\end{subfigure}
\begin{subfigure}[b]{0.3\linewidth}
\includegraphics[width=\linewidth]{example-image-duck}
\caption{The last duck}
\end{subfigure}
\label{fig:test}
\end{figure}
\end{document}