# MathTime Pro 2 with luatex

I'm using Tex Live on Linux (Ubuntu). I have the MathTime Pro 2 (lite version) fonts installed, using the script I found here. I always used them with tex, pdftex or xetex and they worked correctly. But now, after switching to luatex (because I need some luatex specific features), I'm encountering some problems. Consider the following TeX file:

\input amstex
\input mtp2

$$\left(\matrix1&0&0&0&0\\0&1&0&0&0\\0&0&1&0&0\\0&0&0&1&0\\0&0&0&0&1\endmatrix\right)$$
$$\PARENS{\matrix1&0&0&0&0\\0&1&0&0&0\\0&0&1&0&0\\0&0&0&1&0\\0&0&0&0&1\endmatrix}$$

\bye


Typesetting with tex, pdftex or xetex I obtain

If I use luatex, instead I get

The same problem happens with the square root sign. What's going wrong? How can I properly use mtp2 with luatex?

• probably related tex.stackexchange.com/questions/232109/… – Ulrike Fischer Nov 1 '15 at 20:13
• @UlrikeFischer Yes, it is the same problem! (Except the fact that here I'm using the plain format and there they use the latex format.) – User Nov 1 '15 at 20:22
• wow you are using amstex still? :-) – David Carlisle Nov 1 '15 at 21:23
• @David Carlisle. What's wrong with amstex? :) Is there a better macro set for mathematical typesetting compatible with plain tex? – User Nov 2 '15 at 16:51
• @User Yes sure, of course they use amsmath. It is only loosely a port: the basic ideas came from amstex last century and it has been separately maintained since then, there is hardly any recognisable code in common now as amsmath is written to fit with latex font handling. As for using plain for real documents as opposed to small excercises, you are of course free to an opinion:-) – David Carlisle Nov 3 '15 at 15:47

The same patch I proposed for the LuaLaTeX problem (LuaLatex and large braces with MathTime Professional 2) seems to give good results:

\input amstex
\input mtp2

\catcode@=11
\def\PEX@#1{\setbox\Pbox@\vbox{$$\left.\vcenter{\copy\prePbox@}\right)$$}%
\setbox\Pbox@\vbox{\unvbox\Pbox@\unskip\unpenalty
\setbox\Pbox@\lastbox
\setbox\Pbox@\hbox{\unhbox\Pbox@\setbox\Pbox@\lastbox
\setbox\Pbox@\hbox{\unhbox\Pbox@\setbox\Pbox@\lastbox
\setbox\z@\hbox{#1}%
\ifdim\ht\Pbox@>\dp\z@\global\PEX@true\else
\global\PEX@false\fi}}}}
\catcode@=12

$$\left(\matrix1&0&0&0&0\\0&1&0&0&0\\0&0&1&0&0\\0&0&0&1&0\\0&0&0&0&1\endmatrix\right)$$
$$\PARENS{\matrix1&0&0&0&0\\0&1&0&0&0\\0&0&1&0&0\\0&0&0&1&0\\0&0&0&0&1\endmatrix}$$

\bye