我目前正在为我的论文建立一个框架。我正在使用 KOMA Script 报告(scrreprt
)文档类:
\documentclass[titlepage,fonsize=10pt,a4paper,parskip=half,index=totoc,glossaries=totoc,bibliography=totoc,numbers=noenddot,dutch]{scrreprt}
对于我使用的所有图形的标题:
\usepackage[labelfont=bf,textformat=period]{caption}
对于参考文献我有:
\usepackage[hidelinks]{hyperref}
\usepackage[noabbrev]{cleveref}
某些事情产生了以下问题。标识符(表 9.x 等)现在只有偶数:表 9.2、表 9.4 等。我尝试移动表格,但这没有帮助。对于我的表格,我使用以下格式:
\begin{table}[H]
\centering
\begin{tabularx}{\textwidth}{Xlr}
\toprule \textbf{Some column} & \textbf{Second column} & \textbf{Last column} \\
\midrule
Some row & with some & beautiful info \\
\bottomrule
\end{tabularx}
\caption{Very useful information in the table}
\label{tbl:usefultable}
\end{table}
这是预期的行为还是我做错了什么?因为我更愿意获取从 1 开始并以 1 为增量的表标识符。
\documentclass[titlepage,fonsize=10pt,a4paper,parskip=half,index=totoc,glossaries=totoc,bibliography=totoc,numbers=noenddot,dutch]{scrreprt}
\usepackage{ltablex,booktabs,float}
\usepackage[labelfont=bf,textformat=period]{caption}
\usepackage[hidelinks]{hyperref}
\usepackage[noabbrev]{cleveref}
\usepackage{blindtext}
\begin{document}
\chapter{Some chapter}
\blindtext
\section{Some section}
\begin{table}[H]
\centering
\begin{tabularx}{\textwidth}{Xlr}
\toprule \textbf{Some column} & \textbf{Second column} & \textbf{Last column} \\
\midrule
Some row & with some & beautiful info \\
\bottomrule
\end{tabularx}
\caption{Very useful information in the table}
\label{tbl:usefultable}
\end{table}
\end{document}
答案1
将命令放在\caption
此处tabularx
。ltablex
包有效使用longtable
并进行tabularx
相应转换,因此\caption
应位于环境内部tabularx
。
它自身也会发生相同的错误longtable
。
\documentclass[titlepage,fonsize=10pt,a4paper,parskip=half,index=totoc,glossaries=totoc,bibliography=totoc,numbers=noenddot,dutch]{scrreprt}
\usepackage{ltablex,longtable,booktabs,float}
\usepackage[labelfont=bf,textformat=period]{caption}
\usepackage[hidelinks]{hyperref}
\usepackage[noabbrev]{cleveref}
\usepackage{blindtext}
\begin{document}
\chapter{Some chapter}
\blindtext
\section{Some section}
\begin{table}[H]
\centering
\begin{tabularx}{\linewidth}{Xlr}
\toprule \textbf{Column one} & \textbf{Column two} & \textbf{Column three} \\
\midrule
Some row & with some & useful content\\
Some row & with some & useful content\\
Some row & with some & useful content\\
Some row & with some & useful content\\
Some row & with some & useful content\\
Some row & with some & useful content\\
\bottomrule
\caption{Some useful table}\label{tbl:deadlines}
\end{tabularx}
\end{table}
\begin{table}[H]
\centering
\begin{tabularx}{\linewidth}{Xlr}
\toprule \textbf{Column one} & \textbf{Column two} & \textbf{Column three} \\
\midrule
Some row & with some & useful content\\
Some row & with some & useful content\\
Some row & with some & useful content\\
Some row & with some & useful content\\
Some row & with some & useful content\\
Some row & with some & useful content\\
\bottomrule
\caption{Some useful table}\label{tbl:deadlines:again}
\end{tabularx}
\end{table}
\end{document}