如何降低 Overleaf 中 table 个数字 + table 的 header 级别?

How to decrease header level in Overleaf for table of figures + tables?

我想弄清楚如何更改我的数字和 table 列表,以便它在部分级别上引用数字和 table。我的文档类型是背面的文章。 我当前的代码如下所示:

\documentclass{article}
\begin{document}

\maketitle
\section{Abstract}
\newpage
\tableofcontents
\newpage
\addcontentsline{toc}{section}{\listfigurename}
\listoffigures
\newpage
\addcontentsline{toc}{section}{\listtablename}
\listoftables
\newpage
\section{Introduction}
\section{3}
\section{4}

\begin{table}[H]
\renewcommand{\arraystretch}{2}
\centering
\begin{tabular}{ p{6cm}p{6cm}}
\toprule
\textbf{Variables}                              & \textbf{Description}                                      \ \midrule
\textit{F\_27608, R\_27730}                     & The amount of cheese and yogurt ordered weekly.           \
\textit{Year}                                   & Year of the observation.                                  \
\textit{Winter, Spring, Summer, Autumn} & Season of the observation.                                \
\textit{Week}                                   & Week of the observation.                                  \
 \textit{Lag1, Lag2, Lag3, Lag4, Lag5}           &  Lagged order amounts for prior periods.                   \
\textit{Price}                                  & Mean price of the product for the specific observation.   \
\textit{Fut1, Fut2, Fut3, Fut4, Fut5}           & Future price of the product.                              \
\textit{PromoScale}                             & Level of expected increase in orders caused by promotion. \
\textit{PromoScale(L1, L2, L3)}                 & Lagged PromoScale values for prior periods                \
\textit{PromoScale(F1, F2, F3)}                 & Future PromosSale values.                                 \ \bottomrule
\end{tabular}
\caption{Feature space cheese and yogurt}
\end{table}

见图: List of tables

如何才能让这些 table 在 table 的列表中显示 4.1 和 4.2? (代码只显示一个table供参考)

您可以使用 \counterwithin{figure}{section} 为一个部分中的计数器编号:

\documentclass{article}

\counterwithin{figure}{section}
\counterwithin{table}{section}

\begin{document}

\section{Abstract}
\newpage
\tableofcontents
\newpage
\addcontentsline{toc}{section}{\listfigurename}
\listoffigures
\newpage
\addcontentsline{toc}{section}{\listtablename}
\listoftables
\newpage

\section{Introduction}
\section{3}
\section{4}

\begin{table}[htbp]
\caption{Feature space cheese and yogurt}
\end{table}

\end{document}