我有方程式,我想引用其中一些。另外,我只想对我引用的方程式进行编号。出于某种原因,当我使用\mathtoolsset{showonlyrefs=true}
- 时,它不起作用,当我使用\eqref
它时,它只引用部分而不是方程式。如果我删除\mathtoolsset{showonlyrefs=true}
,那么所有方程式都会被编号,无论我是否引用它们。
例如,使用以下行\mathtoolsset{showonlyrefs=true}
:
\documentclass[peerreview]{IEEEtran}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{url}
\usepackage{ifthen}
\usepackage{cite}
\usepackage[cmex10]{amsmath} % Use the [cmex10] option to ensure complicance
% with IEEE Xplore (see bare_conf.tex)
\usepackage{subcaption}
%% Please note that the amsthm package must not be loaded with
%% IEEEtran.cls because IEEEtran provides its own versions of
%% theorems. Also note that IEEEXplore does not accepts submissions
%% with hyperlinks, i.e., hyperref cannot be used.
\usepackage{cleveref}
\usepackage{graphicx}
\usepackage{amsmath }
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{dsfont}
\mathtoolsset{showonlyrefs=true}
\interdisplaylinepenalty=2500 % As explained in bare_conf.tex
%%%%%%
% correct bad hyphenation here
\hyphenation{op-tical net-works semi-conduc-tor}
\renewcommand{\baselinestretch}{1.48} % use only for one column version
% ------------------------------------------------------------
\begin{document}
\title{test}
\author{%
\IEEEauthorblockN{test}\\
\IEEEauthorblockA{test}
}
\maketitle
\begin{abstract}
pass
\end{abstract}
\section{Introduction} \label{sec:intro}
test equation,
\begin{equation} \label{eq:eq1}
2 = 1 + 1
\end{equation}
\begin{equation} \label{eq:eq2}
3 = 1 + 2
\end{equation}
equation num \eqref{eq:eq1}
\end{document}
结果:
没有:
\documentclass[peerreview]{IEEEtran}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{url}
\usepackage{ifthen}
\usepackage{cite}
\usepackage[cmex10]{amsmath} % Use the [cmex10] option to ensure complicance
% with IEEE Xplore (see bare_conf.tex)
\usepackage{subcaption}
%% Please note that the amsthm package must not be loaded with
%% IEEEtran.cls because IEEEtran provides its own versions of
%% theorems. Also note that IEEEXplore does not accepts submissions
%% with hyperlinks, i.e., hyperref cannot be used.
\usepackage{cleveref}
\usepackage{graphicx}
\usepackage{amsmath }
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{dsfont}
\interdisplaylinepenalty=2500 % As explained in bare_conf.tex
%%%%%%
% correct bad hyphenation here
\hyphenation{op-tical net-works semi-conduc-tor}
\renewcommand{\baselinestretch}{1.48} % use only for one column version
% ------------------------------------------------------------
\begin{document}
\title{test}
\author{%
\IEEEauthorblockN{test}\\
\IEEEauthorblockA{test}
}
\maketitle
\begin{abstract}
pass
\end{abstract}
\section{Introduction} \label{sec:intro}
test equation,
\begin{equation} \label{eq:eq1}
2 = 1 + 1
\end{equation}
\begin{equation} \label{eq:eq2}
3 = 1 + 2
\end{equation}
equation num \eqref{eq:eq1}
\end{document}
结果: