4

I tried using LaTeX after a long period of rest, and I found out that newtxtext and ntheorem collide with each other with the message 'Theoremstyle plain already defined'. On the other hand, newtxmath doesn't seem to interfere here.

\documentclass[openany,english]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{newtxtext}

\usepackage{amsmath, amssymb, graphicx}
\usepackage[amsmath, thmmarks, thref]{ntheorem}

\begin{document}

hello

\end{document} 

I looked up the pdf documentations but couldn't find the reason; ntheorem documentation mentions about the possible interference with amsmath, with which I dealt correctly(hopefully), but nothing was mentioned about newtxtext. Same for the documentation for newtxtext; nothing was mentioned about ntheorem.

My question: what should I do in order to solve this collision? If I have to give up newtxtext(and possibly newtxmath), what fonts do you recommend in place of it that doesn't possibly collide with ntheorem?(I think it's too useful to give up...)

Thanks in advance.

  • 2
    newtxtext loads amsthm. I don't think, that loading a theorem package inside a font package is a good idea, but it does. – Schweinebacke Jan 30 '17 at 6:45
  • @Taxxi - I am unable to replicate the issue you report, using either MacTeX2016 or MikTeX2.9. Please tell us which TeX distribution -- including its vintage -- you use. – Mico Jan 30 '17 at 7:53
  • @Mico I reinstalled MikTeX today so it's the latest version. I actually reproduced it right now one more time... I also have to mention I didn't have this problem before; it just happened today after a long break. – Taxxi Jan 30 '17 at 8:33
  • @Taxxi - I stand corrected! Somewhere between versions 1.5 and 1.515 (release date of the latter version: 2017/01/22) of newtxtext the instruction \RequirePackage{amsmath,amsthm} % in case of theoremfont made it into the package's code. (I just ran an update on my TeX distribution -- I had last done so about 10 days ago...) A bit unfortunate, to put it mildly. – Mico Jan 30 '17 at 8:50
6

Package newtxtext loads amsthm. amsthm and ntheorem cannot be used together. The ntheorem manuals recommends to use option amsthm instead. So you have to prevent newtxtext from loading amsthm. Following seems to work:

\documentclass[openany,english]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{amsmath,amssymb,graphicx}
\usepackage[amsmath,amsthm,thmmarks,thref]{ntheorem}
\PreventPackageFromLoading{amsthm}
\usepackage{newtxtext}

\begin{document}

hello

\end{document} 

It even seems to work without option amsthm.

If you do not use a KOMA-Script class, you have to load package scrlfile to get \PreventPackageFromLoading.

  • @Mico There is an unconditional \RequirePackage{amsmath,amsthm} in newtxtext.sty "just in case the user wants to specify theoremfont" – Andrew Swann Jan 30 '17 at 8:45
  • @AndrewSwann - Indeed, I just noticed this myself, after running an update on my system. (I had last done so 10 days ago.) I've posted a comment to this effect below the original posting. – Mico Jan 30 '17 at 8:51
  • You should mention the issue to the author of newtx; he's usually prompt to fix weaknesses in his package. – egreg Jan 30 '17 at 10:31
  • @egreg - Addendum 2017/01/31: As of version 1.516, dated 2017-01-30, of the newtxtext package, the OP's sample code no longer throws an error. The package now features an option called theoremfont. From the package's user guide: "The theoremfont option changes the default font used for the plain theoremstyle of amsthm, keeping italic text but substituting upright figures and punctuation, and, provided you have loaded theorem or amsthm before newtxtext, it will redefine the plain theoremstyle." – Mico Jan 31 '17 at 6:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.