# New TX math font symbol: skew underbrace with package newtxmath

I found that the New TX math font newtxmath could not displace underbrace, see: latest Texlive 2012

The correct underbrace with default CM font:

It's weird that it works well when I test it with a simple tex file.

  \documentclass[12pt]{book}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage[T1]{fontenc}
\usepackage{newtxtext, newtxmath}  % new TX times

\begin{document}

\begin{eqnarray}
\frac{\sin^{2}\vartheta}{\Theta_{lm}(\vartheta)}\left(\frac{\partial^{2}}{\partial\vartheta^{2}}+\frac{\cos\vartheta}{\sin\vartheta}\frac{\partial}{\partial\vartheta}\right)\Theta_{lm}(\vartheta)+\sin^{2}(\vartheta)(l(l+1)) =\underbrace{-\frac{1}{\Phi_{m}(\varphi)}\frac{\partial^{2}}{\partial\varphi^{2}}\Phi_{m}(\varphi)}_{blabla} \\
P_l (x)\equiv\frac {1}{2^l}\sum_{k=0}^{\lfloor l/2\rfloor} (-1)^k \frac{(2l-2k)!}{k!(l-k)!(l-2k)!} x^{l-2k}\\
\iint_\Omega \frac{x^2+1}{2y}dxdy = 0
\end{eqnarray}

\end{document}


But it won't work with these packages used for my report:

 \usepackage{amssymb}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[table]{xcolor}
\usepackage{enumerate}     % numbered items
\usepackage{color}
\usepackage{booktabs}
\usepackage{threeparttable}
\usepackage{multirow}
\usepackage[UKenglish]{babel}  % ngerman: "a "s "o "u
\usepackage{subfigure}
\usepackage{natbib}                % bibtex
\usepackage{cases}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{wallpaper}

% | * * * * * * * * * * * * * * * * * * * * |
% |        fonts with math support          |
% | * * * * * * * * * * * * * * * * * * * * |

\usepackage[T1]{fontenc}
\usepackage{newtxtext, newtxmath}  % new TX times

\usepackage{esint}     % Alternate integrals signs
\usepackage{ngerman}  % after package mathdesign !


The rest packages and setting are for page layout, margin, etc.

I am sure newtxmath conflicts with some certain packages, How to figure this out?

Partial solution: Putting esint before newtxmath will eliminate this issue, but it produces the unchanged \iint symbol:

-
Works for me. Which version of newtx do you use? –  mafp Jan 9 '13 at 19:02
i'd start by getting a font chart of the "extension font" (the one comparable to cmex). i would then unpack the .tfm file for that font with tftopl. the documentation for that program (texdoc tftopl) is going to be useful. what you want to look for is the "math extension scheme" which will have a recipe for starting, extension, middle, extension, ending pieces. the character cell location in the font is wrong for the extension piece. replace that location value by the correct one (it is probably the same as the one for \overbrace) and repackage with pltotf. –  barbara beeton Jan 9 '13 at 19:06
@barbara beeton, the method you provided seems very complicated! –  KOF Jan 9 '13 at 20:34
yes, it is complicated, but it permits one to patch a .tfm file if it contains an error. it's the "original" method, in use for 30+ years. there may be other methods now to patch .tfm files, but this is the one i've used successfully in the past. and it does seem that you found it was not a problem with the font itself, but with incompatibilities when using another package. –  barbara beeton Jan 9 '13 at 20:45

Load the redefinition from package esint after newtxmath with another name for the Symbol font because both packages load it with the same name largesymbolsA:

 \documentclass[12pt]{book}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage[T1]{fontenc}
\usepackage{esint,newtxtext, newtxmath}  % new TX times
\makeatletter
\DeclareSymbolFont{largesymbolsB}{U}{esint}{m}{n}% esint uses largesymbolsA
\re@DeclareMathSymbol{\intop}{\mathop}{largesymbolsB}{'001}
\def\int{\intop\nolimits}
\re@DeclareMathSymbol{\iintop}{\mathop}{largesymbolsB}{'003}
\def\iint{\iintop\nolimits}
\re@DeclareMathSymbol{\iiintop}{\mathop}{largesymbolsB}{'005}
\def\iiint{\iiintop\nolimits}
\re@DeclareMathSymbol{\iiiintop}{\mathop}{largesymbolsB}{'007}
\def\iiiint{\iiiintop\nolimits}
\makeatother
\begin{document}
\begin{eqnarray}
\int \iint \iiint
\frac{\sin^{2}\vartheta}{\Theta_{lm}(\vartheta)}\left(\frac{\partial^{2}}{\partial\vartheta^{2}}+\frac{\cos\vartheta}{\sin\vartheta}\frac{\partial}{\partial\vartheta}\right)\Theta_{lm}(\vartheta)+\sin^{2}(\vartheta)(l(l+1)) =\underbrace{-\frac{1}{\Phi_{m}(\varphi)}\frac{\partial^{2}}{\partial\varphi^{2}}\Phi_{m}(\varphi)}_{blabla} \\
P_l (x)\equiv\frac {1}{2^l}\sum_{k=0}^{\lfloor l/2\rfloor} (-1)^k \frac{(2l-2k)!}{k!(l-k)!(l-2k)!} x^{l-2k}
\end{eqnarray}
\end{document}

-
If you put {esint} before newtxmath, the \iint symbol is the same as the one without {esint} package. –  KOF Jan 9 '13 at 20:54
see my edited answer –  Herbert Jan 9 '13 at 20:55
hmmm, it seems not working. –  KOF Jan 9 '13 at 21:02
@KOF: see my complete example which works. –  Herbert Jan 9 '13 at 21:09
Great, it works perfectly now. Seems I need to learn some basic TEX commands to re-define the original packages. –  KOF Jan 9 '13 at 21:16

I just figured out this issue: {newtxmath} is not compatible with the package {esint}!

When using {esint} to display neat \iint integral symbol, it must be put after the package of math font, but in this case, it produced wrong underbrace symbol.

-