0

When I don't reference a question, a blank space appeared after the equation.

MWE:

\documentclass[12pt,reqno]{amsart}

\usepackage{graphicx}

\usepackage{amssymb , amsthm}
\theoremstyle{plain}

%This allows for theorems which are not automatically numbered
\newtheorem*{theorem*}{Theorem} 

% The bellow lines are for formatting.  In general, you will not want to change these.
\newtheorem{definition}{Definition}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}
\newtheorem{example}{Example}
\usepackage{lineno}

% Added packages
\usepackage[utf8]{inputenc}
\usepackage{amsmath , amsfonts}
\usepackage{mathtools}
\mathtoolsset{showonlyrefs=true , showmanualtags=true}
\usepackage{physics}
\usepackage{hyperref , url}

% Title
\title{Vector spaces}
\author{DS}
\date{\today}

\begin{document}

\maketitle

Notice that for sets $A$ and $B$, if $A \not\subset B$, then there exists an element $x$ such that $x \in A$ and $x \notin B$. That is,
%
\begin{equation}\label{1}
    \qty(A \not\subset B) \iff \exists x \qty( x \in A \wedge x \notin B).
\end{equation}
%
We now prove theorem $2.1$. By way of contradiction, suppose that the theorem fails. Let $A$ be a set such that $\emptyset \not\subset A$.

Notice that for sets $A$ and $B$, if $A \not\subset B$, then there exists an element $x$ such that $x \in A$ and $x \notin B$. That is,
%
\begin{equation}\label{2}
    \qty(A \not\subset B) \iff \exists x \qty( x \in A \wedge x \notin B).
\end{equation}
%
We now prove theorem $2.1$. By way of contradiction \eqref{2}, suppose that the theorem fails. Let $A$ be a set such that $\emptyset \not\subset A$.

\end{document}
daleif
  • 54,450

1 Answers1

2

Until the next mathtools version is released (version 1.23) here is a patch that seems to work

\usepackage{xpatch}

\MHInternalSyntaxOn

\xpatchcmd{\MT_extended_tagform:n}{
  \@ifundefined{MT_r_\df@label}{}
}{%
 \@ifundefined{MT_r_\df@label}{\kern1sp}
}{}{\typeout{patch failed}}

\xpatchcmd{\MT_extended_tagform:n}{
\@ifundefined{MT_r_\df@label}{\global\MH_set_boolean_F:n {manual_tag}}
}{%
\@ifundefined{MT_r_\df@label}{\global\MH_set_boolean_F:n {manual_tag}\kern1sp}
}{}{\typeout{patch failed}}

\MHInternalSyntaxOff

MWE with the patch (I've removed irrelevant packages from the preamble)

\documentclass[12pt,reqno]{amsart}
\usepackage[utf8]{inputenc}
\usepackage{amsmath , amsfonts}
\usepackage{mathtools}
\mathtoolsset{showonlyrefs=true , showmanualtags=true}

\usepackage{xpatch}

\MHInternalSyntaxOn

\xpatchcmd{\MT_extended_tagform:n}{
  \@ifundefined{MT_r_\df@label}{}
}{%
 \@ifundefined{MT_r_\df@label}{\kern1sp}
}{}{\typeout{patch failed}}

\xpatchcmd{\MT_extended_tagform:n}{
\@ifundefined{MT_r_\df@label}{\global\MH_set_boolean_F:n {manual_tag}}
}{%
\@ifundefined{MT_r_\df@label}{\global\MH_set_boolean_F:n {manual_tag}\kern1sp}
}{}{\typeout{patch failed}}

\MHInternalSyntaxOff



\begin{document}


Notice that for sets $A$ and $B$, if $A \not\subset B$, then there
exists an element $x$ such that $x \in A$ and $x \notin B$. That is,
%
\begin{equation}\label{1}
    (A \not\subset B) \iff \exists x ( x \in A \wedge x \notin B).
\end{equation}
%
We now prove theorem $2.1$. By way of contradiction, suppose that the
theorem fails. Let $A$ be a set such that $\emptyset \not\subset A$.

Notice that for sets $A$ and $B$, if $A \not\subset B$, then there
exists an element $x$ such that $x \in A$ and $x \notin B$. That is,
%
\begin{equation}\label{2}
    (A \not\subset B) \iff \exists x ( x \in A \wedge x \notin B).
\end{equation}
%
We now prove theorem $2.1$. By way of contradiction \eqref{2}, suppose
that the theorem fails. Let $A$ be a set such that
$\emptyset \not\subset A$.

\end{document}
daleif
  • 54,450