Fails to compile with XeLaTeX in TL2015 when including newtxmath

All my LaTeX documents stopped compiling with XeLaTeX from TeX Live 2015 sometime in the last two months. It was working before. Here is a minimum working example:

\documentclass[11pt]{scrartcl}

\usepackage{libertine}
\usepackage[libertine]{newtxmath}

% \DeclareSymbolFont{operators}{\encodingdefault}{\familydefault}{m}{n}

\begin{document}
\end{document}


Trying to compile like this: xelatex -interaction nonstopmode bug, gives me the following error:

(/opt/texlive/2015/texmf-dist/tex/generic/kastrup/binhex.tex)
\tx@Isdigit=\count137
)
! Incomplete \iftrue; all text was ignored after line 128.
<inserted text>
\fi
l.5

The file ended while I was skipping conditional text.
This kind of error happens when you say \if...' and forget
the matching \fi'. I've inserted a \fi'; this might work.

)
! Incomplete \iftrue; all text was ignored after line 128.
<inserted text>
\fi
<*> bug

The file ended while I was skipping conditional text.
This kind of error happens when you say \if...' and forget
the matching \fi'. I've inserted a \fi'; this might work.

! Emergency stop.
<*> bug

*** (job aborted, no legal \end found)


What is going wrong? I have tried the suggestion in this answer with no luck.

This is a bug in newtxmath. If contains in line 130 (and line 135) in an \else-branch

\ifx\iflibertine@otf\undefined


and this leads to an incomplete if if the branch is not executed.

A similar problem can be demonstrated with this example:

\documentclass[11pt]{article}

\begin{document}
\newif\ifblab
\iftrue
abc
\else
\ifx
\ifblab\undefined
abc
\fi
\fi

\end{document}


TeX is trying to find the end of the \else part to throw it away and due to the \ifblab one \fi is missing.

• Thanks for digging through the source. I'm guessing there is no workaround? How can I report this bug? texdoc newtx didn't tell me much. – suvayu Dec 11 '15 at 21:05
• @suvayu The mail address is in the sty. – Ulrike Fischer Dec 11 '15 at 21:11