我正在使用我所在机构的模板撰写论文。但是,当我使用\ref{label}
命令时,标签和标点/逗号后面有一个空格。我的工作如下:
\makeatletter
\let\my@xfloat\@xfloat
\makeatother
\documentclass[oneside,12pt,a4paper]{book}
%\documentclass[12pt,a4paper]{book}
\usepackage{UTMThesis, enumerate, amsfonts, longtable, qtree, etoolbox, array, rotating, pgf, tikz, tikz-cd, algorithm, csquotes}
\makeatletter
\def\@xfloat#1[#2]{
\my@xfloat#1[#2]%
\def\baselinestretch{1}%
\@normalsize \normalsize
}
\makeatother
\allowdisplaybreaks
\usetikzlibrary{arrows, matrix, positioning, shapes, shapes.geometric, calc, intersections, decorations.pathreplacing}
\newcommand{\tikznode}[2]{\relax
\ifmmode%
\tikz[remember picture,baseline=(#1.base),inner sep=0pt] \node (#1) {$#2$};
\else
\tikz[remember picture,baseline=(#1.base),inner sep=0pt] \node (#1) {#2};%
\fi}
\let\openbox\relax
\let\iint\relax
\let\iiint\relax
\let\iiiint\relax
\let\idotsint\relax
\newcommand*{\qed}{\hfill\ensuremath{\square}}
%-------------------------------------------------------------
\usepackage{cite} % change cite from [1,2,3] to [1-3] etc for number system
\makeatletter % change from
\renewcommand{\@biblabel}[1]{#1.} % [1] to 1. etc
\makeatother % in list of references
%-----------------------------------------------------------
\setlength{\voffset}{-2.1cm}
\setlength{\hoffset}{-.4cm}
%--------------------------------------------------------
\font\fiverm=cmr5
%\input{Pictex.tex} % using pictex
%---------------------------------------------------------
%\pagestyle{plain}
%-------------------------------------------------------
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{}
\chead{}
\rhead{}
\lfoot{}
\cfoot{\vspace{-.35cm}\thepage} %
\rfoot{}
\renewcommand{\headrulewidth}{0pt}
%-------------------------------------------------------
\begin{document}
\frontmatter
\chapter{INTRODUCTION}
\section{Background and motivation}
\label{section:background}
In Section \ref{section:background}, we talked about...
\backmatter
\end{document}
产生:
我怎样才能解决这个问题?
答案1
UTMThesis.sty
我使用时能够复制该问题如何用指向箭头写出方程中每个术语的定义?该样式文件具有
\renewcommand{\thesection} % space between sect. etc.
{\thechapter.\arabic{section}\hspace{.12in}}
\renewcommand{\thesubsection}
{\thesection\hspace{-.3cm}.\arabic{subsection} \hspace{-.135cm}}
在表示中包含空格\thesection
会使它贯穿到任何\label
,并最终\ref
贯穿到。因此,您需要重新定义\thesection
为以下内容:
\renewcommand{\thesection}{\thechapter.\arabic{section}}
\renewcommand{\thesubsection}{\thesection.\arabic{subsection}}
您可以增加部门单元编号和标题之间的差距,通过以下方式调整\@seccntformat
:
\makeatletter
\renewcommand{\@seccntformat}[1]{\csname the#1\endcsname\qquad}
\makeatother
默认空间为\quad
(相当于\hspace{1em}
)。