表格中的多余点

表格中的多余点

我希望在表格标题中显示表格编号,例如

Table 4.5. This table is a rebel

我通过以下方式实现此目的:

\renewcommand{\thetable}{\arabic{section}.\arabic{table}.}

问题是,当我在文本中使用 \ref{} 链接到表格时,latex 还会返回“表 4.5。”而不仅仅是“表 4.5”。这在句子结尾时尤其难看,因为会出现“表 4.5..”,其中最后一个点是句号。

那么,我怎样才能在表格标题中得到“表 4.5。”,但在使用 \ref{} 时却得不到?谢谢

\documentclass[10.5pt]{report}
\usepackage{librecaslon}
\usepackage[T1]{fontenc}

\usepackage{titlesec}
\newcommand{\presectionskip}{-1\baselineskip}
\newcommand{\postsectionskip}{0.3\baselineskip}
\makeatletter
\renewcommand{\chapter}{\@startsection
    {chapter}{1}{0mm}%% name, level, indent
   {\presectionskip}% % beforeskip
    {\postsectionskip}% % afterskip
    {\fontsize{18}{18}\bfseries}}
\renewcommand{\section}{\@startsection
    {section}{1}{0mm}%% name, level, indent
    {\presectionskip}% % beforeskip
    {\postsectionskip}% % afterskip
    {\fontsize{10.5}{10.5}\bfseries}}% % style
\renewcommand{\subsection}{\@startsection
    {subsection}{2}{0mm}
    {\presectionskip}
    {\postsectionskip}
    {\fontsize{10.5}{10.5}\bfseries}}
\renewcommand{\subsubsection}{\@startsection
    {subsubsection}{3}{0mm}
    {\presectionskip}
    {\postsectionskip}
    {\fontsize{10.5}{10.5}\bfseries}}
\renewcommand{\@seccntformat}[1]{\csname the#1\endcsname.\quad}
\makeatother
\usepackage{amsmath,amsfonts,amssymb}
\newcommand*{\defeq}{\stackrel{\text{def}}{=}}
\usepackage{color,xcolor}
\usepackage{subfig} 
\usepackage[pdftex]{graphicx}
\usepackage{setspace}
\usepackage{booktabs}
\usepackage{lscape,url}
\usepackage[round,longnamesfirst]{natbib}
\usepackage{lipsum}
\usepackage[hidelinks]{hyperref}
\usepackage[labelfont={bf},justification=justified]{caption}
\usepackage{array}
\usepackage{eurosym}
\usepackage{rotating}
\usepackage[round,longnamesfirst]{natbib}
\usepackage{longtable}
\usepackage{placeins}
\usepackage{bookmark}
\usepackage[english]{babel}
\usepackage[autostyle, english = american]{csquotes}
\usepackage{indentfirst}
\usepackage[multiple]{footmisc}
\usepackage{appendix}
\usepackage{geometry}
\geometry{paperwidth=165mm, paperheight=240mm, top=24mm, bottom=24mm, left=18mm, right=18mm,headsep=7mm}
\usepackage[font=footnotesize,labelfont=bf]{caption}
\usepackage{threeparttable}
\setcounter{MaxMatrixCols}{10}
\newtheorem{theorem}{Theorem}
\newtheorem{acknowledgement}[theorem]{Acknowledgement}
\newtheorem{algorithm}[theorem]{Algorithm}
\newtheorem{axiom}[theorem]{Axiom}
\newtheorem{case}[theorem]{Case}
\newtheorem{claim}[theorem]{Claim}
\newtheorem{conclusion}[theorem]{Conclusion}
\newtheorem{condition}[theorem]{Condition}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{criterion}[theorem]{Criterion}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{exercise}[theorem]{Exercise}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{notation}[theorem]{Notation}
\newtheorem{problem}[theorem]{Problem}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{solution}[theorem]{Solution}
\newtheorem{summary}[theorem]{Summary}
\newenvironment{proof}[1][Proof]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\renewcommand{\baselinestretch}{2}
\newcommand\cites[1]{\citeauthor{#1}'s\ (\citeyear{#1})}
\usepackage{setspace}
\onehalfspacing
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\cfoot{Page \thepage}
\usepackage{titling}
\renewcommand\maketitlehookc{\vspace{-0ex}}
\renewcommand\maketitlehooka{\vspace{-0ex}}
\usepackage{comment}
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
\newcolumntype{L}[1]{>{ \arraybackslash}p{#1}}
\newcolumntype{d}[1]{D{.}{.}{#1}}
\usepackage{afterpage}
\newcommand\blankpage{%
    \null
    \thispagestyle{empty}%
    \addtocounter{page}{-1}%
    \newpage}
\usepackage{titling}
\usepackage[nottoc]{tocbibind}
\captionsetup[table]{labelsep=period}
\captionsetup[figure]{labelsep=period}

答案1

最好的方法是加载caption包并使用\captionsetup{labelsep=period}

此外,如果你把标题表格(按照印刷传统应该如此),标题和表格之间会留出适当的垂直间距。

相关内容