有没有办法让表格列表中的点(在我的情况下)一直延伸到页码?我的情况是,附录中的一些表格从第 35 页开始使用罗马数字(由于目录长、图表列表、参考书目等)。为了让页码正确对齐,我添加了
\makeatletter
\renewcommand{\@pnumwidth}{45pt}
\makeatother
但是,点和拉丁数字之间存在很大间隙。
\documentclass{article}
\makeatletter
\renewcommand{\@pnumwidth}{45pt}% 40pt is just an example
\makeatother
\begin{document}
\listoftables
\section{Main text}
\begin{table}[h]
\centering
\caption{Table in main text}
\begin{tabular}{|c|c|}
\hline
12 & 2 \\
\hline
3 & 42 \\
\hline
\end{tabular}
\end{table}
\clearpage
\pagenumbering{Roman}
\setcounter{page}{37}
\section{Appendix}
\begin{table}[h]
\centering
\caption{Table in appendix}
\begin{tabular}{|c|c|}
\hline
12 & 2 \\
\hline
3 & 42 \\
\hline
\end{tabular}
\end{table}
\end{document}
答案1
这可能是作弊,但你可以滥用语法,这样数字就不在固定宽度的框中了
\documentclass{article}
\makeatletter
\renewcommand{\@pnumwidth}{0pt{}}% 40pt is just an example
\makeatother
\begin{document}
\listoftables
\section{Main text}
\begin{table}[h]
\centering
\caption{Table in main text}
\begin{tabular}{|c|c|}
\hline
12 & 2 \\
\hline
3 & 42 \\
\hline
\end{tabular}
\end{table}
\clearpage
\pagenumbering{Roman}
\setcounter{page}{37}
\section{Appendix}
\begin{table}[h]
\centering
\caption{Table in appendix}
\begin{tabular}{|c|c|}
\hline
12 & 2 \\
\hline
3 & 42 \\
\hline
\end{tabular}
\end{table}
\end{document}
答案2
您只能更改附录的值:
\documentclass{article}
\makeatletter
\newcommand\changedots{}
\DeclareRobustCommand\changedots{%
\renewcommand{\@pnumwidth}{45pt}}% 40pt is just an example
\makeatother
\begin{document}
\listoftables
\section{Main text}
\begin{table}[h]
\centering
\caption{Table in main text}
\begin{tabular}{|c|c|}
\hline
12 & 2 \\
\hline
3 & 42 \\
\hline
\end{tabular}
\end{table}
\clearpage
\pagenumbering{Roman}
\setcounter{page}{37}
\section{Appendix}
\addtocontents{lot}{\changedots}
\begin{table}[h]
\centering
\caption{Table in appendix}
\begin{tabular}{|c|c|}
\hline
12 & 2 \\
\hline
3 & 42 \\
\hline
\end{tabular}
\end{table}
\end{document}