2

I am trying to use an underbrace option with Garamond Expert with NewTX Math and for some reason the pdf is not generated for the following code as there seem to be some compatibility issues even though no errors are shown.

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage{garamondx}
\usepackage[garamondx,cmbraces]{newtxmath}


\begin{document}

\[
    S_{classical}[q] = \int\displaylimits_{t_{1}}^{t_{2}} ds\ 
    \underbrace{\left( \frac{m}{3} \frac{t}{2}  \right)  }
\]

\end{document}

On the other hand if I remove the \frac{t}{2} or \frac{m}{3} then the code compiles. Basically, if I use multiple terms inside the \left( and \right) environment then the pdf is not generated even though the code compiles with no errors or warnings.

Another point to note is that if I remove the line \usepackage[garamondx,cmbraces]{newtxmath} then everything works fine but the font I want to use is not the same.

Please suggest me what to do. I have looked at the documentation for the NewTX Math package but couldn't find anything.

Edit 1 :

It seems that it is absolutely not possible to use \left[ and \right] with the NewTX Math package anywhere in the document.

Also, I can't use \underbrace{\left( \frac{m}{3} hi \right)} if the \left( and \right) are inside \underbrace but if they are outside then it is fine.

Edit 2 :

It seems that wherever the pdf is not generated there is a file named missfont.log which is generated with the following entry mktexpk --mfmode / --bdpi 600 --mag 1+0/600 --dpi 600 txex-bar. So I ran apt-file search txex-bar which told me to expect this file with two extensions : tfm and pfb, then I ran a kpsewhich on both and sure enough both are present whereas myfilename.log shows that !pdfTeX error: pdflatex (file txex-bar): Font txex-bar at 600 not found ==> Fatal error occurred, no output PDF file produced!

Edit 3 :

Forcing latexmk to compile results in the following :

kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+0/600 --dpi 600 txex-bar
mktexpk: don't know how to create bitmap font for txex-bar.
mktexpk: perhaps txex-bar is missing from the map file.
kpathsea: Appending font creation commands to missfont.log.
 )
!pdfTeX error: pdflatex (file txex-bar): Font txex-bar at 600 not found
 ==> Fatal error occurred, no output PDF file produced!
Failure to make 'a.pdf'
Latexmk: Errors, in force_mode: so I tried finishing targets
Collected error summary (may duplicate other messages):
  pdflatex: Command for 'pdflatex' gave return code 256
Nitin
  • 295
  • 1
  • 11
  • 1
    What TeX Distribution are you using? Is it up to date? I have not problem typesetting your sample with a fully up to date TeX Live 2020. – Herb Schulz May 19 '20 at 00:45
  • @HerbSchulz I am using texlive but I have also tried texmaker and latexilla. Sorry, TeXLive is 2015/Debian. – Nitin May 19 '20 at 00:50
  • If you can use luatex or xetex, you could load unicode-math instead and \setmathfont{Garamond Math}. Using the modern tools cuts a lot of Gordian knots. – Davislor May 19 '20 at 00:57
  • @Davislor I just tried that and it says that the font is not found! – Nitin May 19 '20 at 01:01
  • It should be in the latest distribution, or the package is on CTAN. – Davislor May 19 '20 at 01:10
  • @Davislor I updated my distribution but it only goes upto 2015 version. I have trouble with the package installation from CTAN and actually would rather use pdflatex with the above method if someone can help me make it work. – Nitin May 19 '20 at 01:24
  • Is it related to this? – Davislor May 19 '20 at 01:31
  • @Davislor I used that script initially but it wasn't working. So, I installed texlive-fonts-extra which enabled me to use Garamond but then the underbrace comannd ran into issues. – Nitin May 19 '20 at 01:36

2 Answers2

3

On my TeX Live 2020 system, I was able to compile your MWE by installing the getnonfreefonts script and running the getnonfreefonts.pl script it installed with --sys --refreshmap --all. This correctly installed the map files for the Type 1 version of GaramondX.

If you can use luatex or xetex, I would recommend unicode-math with the Garamond Math font instead.

Here was the output from a very slightly-modified version (I changed the word in the subscript to the operator font.)

GaramondX/newtx sample

Davislor
  • 44,045
  • It compiles without errors but there is no pdf generated. Can you post a screenshot of your pdf? Can you try this as well : \frac{mesopotamia}{3} instead of frac{m}{3}. I now suspect the problem has to do with the length of the underbrace. If it is working for you then I will remove my TeXLive 2015 and do an install for TexLive 2020. I have used the script and it does not make things work for me. Also, as I have clearly demonstrated in the question : the problem is NOT with Garamond font but with the NewTX Math package. – Nitin May 19 '20 at 02:46
  • @Nitin Added image. – Davislor May 19 '20 at 02:49
  • Lastly, Can you try this as well : \frac{mesopotamia}{3} instead of frac{m}{3}. If this works then I have no option but to remove current distribution and do a fresh install of latest one. – Nitin May 19 '20 at 02:55
  • @Nitin Works just fine. You might consider \mathrm{mesopotamia} or \operatorname{mesopotamia}, BTW. – Davislor May 19 '20 at 03:13
  • Then I guess there is no choice but to remove this distribution and get the latest one. Thanks for all the help. – Nitin May 19 '20 at 03:14
  • 1
    @Nitin It is always best to use the updated set.... – MadyYuvi May 19 '20 at 05:48
  • 1
    @MadyYuvi Agreed. There’s no reason to feel reticent about upgrading. The maintainers never knowingly break old documents. (Or TeX/LaTeX would be a lot less complicated today.) – Davislor May 19 '20 at 11:09
0

I managed to make it work and in case anyone stumbles upon the exact same problem I am providing some information here.

The problem is actually with the the TeXLive 2015 distribution where the NewTX Math has a few problems with execution. If one upgrades to TeXLive 2020 things work out.

Nitin
  • 295
  • 1
  • 11