![如何删除 \ref{} 中的节的点?](https://linux22.com/image/422493/%E5%A6%82%E4%BD%95%E5%88%A0%E9%99%A4%20%5Cref%7B%7D%20%E4%B8%AD%E7%9A%84%E8%8A%82%E7%9A%84%E7%82%B9%EF%BC%9F.png)
答案1
这是一个不需要任何外部 LaTeX 包的解决方案。
\documentclass[11pt]{article}
%% Do _not_ do this:
%\renewcommand\thesection{\normalsize{\arabic{section}.}}
%% Instead, do this:
% Method proposed in "The LaTeX Companion", 2nd ed.
\makeatletter
\def\@seccntformat#1{\@ifundefined{#1@cntformat}%
{\csname the#1\endcsname\space}% default
{\csname #1@cntformat\endcsname}}% enable individual control
\newcommand\section@cntformat{\thesection.\space} % section-level
\makeatother
\begin{document}
\section{Introduction} \label{s-1}
I can cross-reference the number of Section \ref{s-1} without a trailing dot.
\end{document}
答案2
我不会改变 的含义\thesection
,而是保持原样,不去掉点,并改变章节标题的输出方式,\thesection
例如通过指定要附加到 的后缀。
\documentclass[11pt]{article}
%\renewcommand\thesection{\normalsize{\arabic{section}.}}
\makeatletter
%% SECTIONING \hskip'S BEFORE SECTIONING TITLES
\def\sectionkern {1em}
\def\subsectionkern {1em}
\def\subsubsectionkern{1em}
\def\paragraphkern {1em}
%% SUFFIX ADDED TO \the SECTIONING MACROS
\def\sectionsuffix {.}
\def\subsectionsuffix {}
\def\subsubsectionsuffix{}
\def\paragraphsuffix {}
%% SECTIONING LABEL: \the[section]\[section]suffix\hskip\[section]kern
\renewcommand\@seccntformat[1]{\normalsize\csname the#1\endcsname%
\csname#1suffix\endcsname\hskip\csname#1kern\endcsname\relax}
\makeatother
\begin{document}
\section{Introduction} \label{s-1}
I want to print just a number of Section \ref{s-1} without dot.
\end{document}