![子图标题中缺失的数字被视为零](https://linux22.com/image/425534/%E5%AD%90%E5%9B%BE%E6%A0%87%E9%A2%98%E4%B8%AD%E7%BC%BA%E5%A4%B1%E7%9A%84%E6%95%B0%E5%AD%97%E8%A2%AB%E8%A7%86%E4%B8%BA%E9%9B%B6.png)
我缺少什么数字?当我想为我的子图添加子标题时,系统会告诉我由于某种原因缺少一个数字。如果我删除罗马计数器选项,错误也会消失。
\documentclass[a4paper,UKenglish]{article}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\renewcommand{\thesubfigure}{\roman{counter}}
\begin{document}
asdfasdf
\begin{figure}
\centering
\begin{subfigure}[b]{0.45\textwidth}
\includegraphics[scale=0.5]{example-grid-100x100pt}
\caption{asdfsfad}
\end{subfigure}
\begin{subfigure}[b]{0.45\textwidth}
\includegraphics[scale=0.5]{example-grid-100x100pt}
\end{subfigure}
\caption{Caption}
\end{figure}
\end{document}
\end{document}
答案1
您使用了错误的subfigure
标题编号名称。 而必须counter
是subfigure
(参见@Dr. Manuel Kuehner回答)我猜你想获得以下结果:
完整的 MWE 是:
\documentclass[a4paper,UKenglish]{article}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\renewcommand\thesubfigure{\roman{subfigure}}
\usepackage{lipsum} % added for generation of dummy text
\begin{document}
\lipsum[11]
\begin{figure}[ht]
\centering
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[scale=0.5]{example-grid-100x100pt}
\caption{first subfigure}
\end{subfigure}
\hfil
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[scale=0.5]{example-grid-100x100pt}
\caption{second subfigure}
\end{subfigure}
\caption{Caption}
\end{figure}
\end{document}