0

I like the showonlyrefs option provided by mathtools. I also would like to use ntheorem. But they seem difficult to use together. Applying the various recommendations in the related manuals (including the suggestion from ntheorem to use empheq), I came up with the following preamble. Which fails: the texts comes out as See . (with the reference missing).

Any solution or recommendation for using the functionalities provided by showonlyrefs and ntheorem? (Recommendations of other packages which do similar jobs are welcome as well.)

\documentclass{article}
\usepackage[overload, ntheorem]{empheq}
\mathtoolsset{showonlyrefs}  
\usepackage[amsmath]{ntheorem}
\usetagform{default}
\begin{document}
\begin{equation}
    \tag{atag}
    a.
\end{equation}
\begin{equation}
    \label{eq}
    b.
\end{equation}
See \refeq{eq}.
\end{document}
  • When you use \tag I assume you want those printed always, remember showmanualtags for the mathtools options. – daleif Nov 14 '18 at 12:21
  • @daleif Adding showmanualtags does not solve the problem, the text is still See . with a missing reference to the second equation. (Indeed I usually use showmanualtags but here I removed it to simplify the example as much as possible.) – Olivier Cailloux Nov 14 '18 at 16:38
  • Works fine for me, please list versions of the packages, and did you remember to compile several times (I normally use latexmk to do that) – daleif Nov 14 '18 at 17:12

1 Answers1

1

Here is what I get with showmanualtags

\listfiles
\documentclass{article}
\usepackage[overload, ntheorem]{empheq}
\mathtoolsset{showonlyrefs,showmanualtags}  
\usepackage[amsmath]{ntheorem}
\usetagform{default}
\begin{document}
\begin{equation}
    \tag{atag}
    a.
\end{equation}
\begin{equation}
    \label{eq}
    b.
\end{equation}
See \refeq{eq}.
\end{document}

enter image description here

Using the following file versions:

 *File List*
 article.cls    2014/09/29 v1.4h Standard LaTeX document class
  size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
  empheq.sty    2017/03/31 v2.15 Emphasizing equations
 mhsetup.sty    2017/03/31 v1.3 programming setup (MH)
mathtools.sty    2018/01/08 v1.21 mathematical typesetting tools
  keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
    calc.sty    2017/05/25 v4.3 Infix arithmetic (KKT,FJ)
 amsmath.sty    2017/09/02 v2.17a AMS math features
 amstext.sty    2000/06/29 v2.01 AMS text
  amsgen.sty    1999/11/30 v2.0 generic functions
  amsbsy.sty    1999/11/29 v1.2d Bold Symbols
  amsopn.sty    2016/03/08 v2.02 operator names
ntheorem.sty    2011/08/15 1.33
  ifthen.sty    2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
graphicx.sty    2017/06/01 v1.1a Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty    2017/06/25 v1.2c Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    2016/01/03 v1.10 sin cos tan (DPC)
graphics.cfg    2016/06/04 v1.11 sample graphics configuration
  pdftex.def    2018/01/08 v1.0l Graphics/color driver for pdftex
supp-pdf.mkii
epstopdf-base.sty    2016/05/15 v2.6 Base part for package epstopdf
infwarerr.sty    2016/05/16 v1.4 Providing info/warning/error messages (HO)
  grfext.sty    2016/05/16 v1.2 Manage graphics extensions (HO)
kvdefinekeys.sty    2016/05/16 v1.4 Define keys (HO)
 ltxcmds.sty    2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
kvoptions.sty    2016/05/16 v3.12 Key value format for package options (HO)
kvsetkeys.sty    2016/05/16 v1.17 Key value parser (HO)
etexcmds.sty    2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)
ifluatex.sty    2016/05/16 v1.4 Provides the ifluatex switch (HO)
pdftexcmds.sty    2018/09/10 v0.29 Utility functions of pdfTeX for LuaTeX (HO)
   ifpdf.sty    2018/09/07 v3.3 Provides the ifpdf switch
epstopdf-sys.cfg    2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
 ***********
daleif
  • 54,450
  • You are right, with showmanualtags the bug appears only for a slightly more complex MWE: it also requires \usepackage{cleveref} just before the \begin{document}. But that’s another story, it seems. Let’s focus on my original question (without showmanualtags) and solve one problem at a time… – Olivier Cailloux Nov 15 '18 at 10:14