如何让 Latex 中的 \counterwithout 工作?
How to get \counterwithout in Latex to work?
我正在尝试用 1、2、3 等对数字进行编号。但是 LaTeX 只是用节号(例如 1.1 、 1.2 等等)对它们进行编号,即使我使用了 \counterwithout{figure}{section}
。没有错误信息。可能是什么问题?
\usepackage{chngcntr}
\counterwithout{figure}{section}
\usepackage[pdfborder={0 0 0}]{hyperref}
\begin{document}
\input{chapter/01_introduction}
%the figure is in a subsection as part of the introduction
\end{document}
这是 01_introduction
文件的样子:
% !TEX root = ../root.tex
\section{Introduction}
\subsectiction{Title of the subsection}
\begin{figure}[htbp]
\begin{center}
\includegraphics[width=\textwidth]{chapter/figures/fig_bsp.png}
\captionof{figure}{caption of the figure}
\label{fig:1}
\end{center}
\end{figure}
在制作最小的工作示例时,我发现了我的错误:我使用了一个模板,其中包含:'\renewcommand{\thefigure}{\thesection.\arabic{figure}}' 这阻止了我的计数为 1, 2, 3. 谢谢你的帮助!
我正在尝试用 1、2、3 等对数字进行编号。但是 LaTeX 只是用节号(例如 1.1 、 1.2 等等)对它们进行编号,即使我使用了 \counterwithout{figure}{section}
。没有错误信息。可能是什么问题?
\usepackage{chngcntr}
\counterwithout{figure}{section}
\usepackage[pdfborder={0 0 0}]{hyperref}
\begin{document}
\input{chapter/01_introduction}
%the figure is in a subsection as part of the introduction
\end{document}
这是 01_introduction
文件的样子:
% !TEX root = ../root.tex
\section{Introduction}
\subsectiction{Title of the subsection}
\begin{figure}[htbp]
\begin{center}
\includegraphics[width=\textwidth]{chapter/figures/fig_bsp.png}
\captionof{figure}{caption of the figure}
\label{fig:1}
\end{center}
\end{figure}
在制作最小的工作示例时,我发现了我的错误:我使用了一个模板,其中包含:'\renewcommand{\thefigure}{\thesection.\arabic{figure}}' 这阻止了我的计数为 1, 2, 3. 谢谢你的帮助!