0

The following file, a very much shortened version of my 2000 page free physics textbook, does not compile properly:

\documentclass{book}

\usepackage[fullfamily,textlf, opticals, swash, onlytext]{MinionPro}
\usepackage[extraops,textcomp,withamsmath,amssymb]{minionmath}

\makeatletter
\let\arc\@undefined % else conflict with ``curves.sty''
\DeclareMathAccent{\arcacc}           {\mathord}  {letters}  {5}
\makeatother

\usepackage{amsmath}            % allows {align} 
\usepackage{minionamsmath}
\usepackage{curves,calc}           
\usepackage{bm}                 % makes bold math possible using \bm{...}

\begin{document}
\begin{equation}
    m{\bm{\ddot x}}= q {\bm E} + q {\bm {\dot x}} \times {\bm B} 
\end{equation}
\end{document}

On my TexLive 2020 system, (latex with the dvi - ps - pdf route, thus I use: latex test; dvips test; and then Distiller) ((I do not use pdflatex; my mistake)) the commands \ddot and \dot behave wrongly (they behaved correctly with TexLive 2017); they do not produce dots, but strange signs across the bold x. The culprit is amsmath; if I take it out (ignoring the error), the equation is typeset correctly. But with it, something goes wrong. (And I do need amsmath ...)

Does this happen on all systems? What can be done?

P.S. xelatex makes the same mistake. So does pdflatex. This is some package incompatibility.

P.P.S. I used tracingmacros=1 with and without amsmath and compared the 2 files. The latex code was just this, even simpler equation:

\begin{equation}
    m{\boldsymbol{\ddot x}}
\end{equation}

The main difference (of the two 400kByte log files) is probably this part:

9113c9178
< \ddot ->\protect \mathaccentV {ddot}104
---
> \ddot ->\protect \ddot  
9116a9182,9183
> \ddot  ->\mathaccentV {ddot}07F
> 
9216c9283
< \bm@command ->\mathaccent 30724 
---
> \bm@command ->\mathaccent 30591 
9252c9319
< \bm@command ->\mathaccent 30724 \mathchar 31096 
---
> \bm@command ->\mathaccent 30591 \mathchar 31096 

It seems that \ddot is mapped to different mathaccents in the two cases...

P.P.P.S. I have several hundred eps figures, use psfrag and use raw postscript code. I also use the wonderful MinionMath fonts, the microtype package with many details, and a 5000 line long cls file. It seems that the latex command is getting outdated. Should I switch to XeLateX? Or to Luatex? I would be interested in hearing the thoughts and advice of the Pros...

11
  • This might be a bigger change than you want, but you can consider replacing all those font packages with unicode-math and the Minion Math commercial OpenType font. You might also need to redefine \bm as \boldsymbol.
    – Davislor
    Commented May 22, 2020 at 20:28
  • The book needs to stay in Minion. Changing \bm to \boldsymbol has no effect.
    – user64520
    Commented May 22, 2020 at 20:33
  • unicode-math does not work with pdflatex. I am already using the commercial Minion Math font by typoma / Johannes Küster.
    – user64520
    Commented May 22, 2020 at 20:34
  • are you using latex or pdflatex you say pdflatex but then say you are using dvi-ps-pdf ? Commented May 22, 2020 at 20:36
  • 2
    I have neither your font nor all your packages so testing is impossible. Add \tracingmacros=1 before a (small!) equation with the problem and then compare the log with and without amsmath - perhaps you can then see what changes. Commented May 22, 2020 at 20:50

2 Answers 2

2

The problem affects all "standard math accents":

\hat \check \tilde \acute \grave \dot \ddot \breve \bar \vec

The problem is due to a changed macro in amsmath.sty.

amsmath.sty 2017/09/02 v2.17a had in line 725:

\def\@tempa#1{\@xp\@tempb\meaning#1\@nil#1}

amsmath.sty 2020/01/20 v2.17e now has in lines 747 to 753:

\def\@tempa#1{%   
  \@ifundefined{\@xp\@gobble\string#1\space}%
     {\@xp\@tempb\meaning#1\@nil#1}%
     {\@xp\@xp\@xp\@tempb\@xp\meaning
       \csname\@xp\@gobble\string#1\space\endcsname\@nil#1}% }

With this changed definition, the accents from Minion Math do not work any more.

A simple way to get rid of this problem would be to take the lines with \DeclareMathAccent from the file fontmath.minion (supplied with the LaTeX support of Minion Math) and to put these in the preamble after amsmath.sty, e.g.

\DeclareMathAccent{\hat}              {\mathalpha}{letters}  {2}
\DeclareMathAccent{\ddot}             {\mathalpha}{letters}  {4}
\DeclareMathAccent{\dot}              {\mathalpha}{letters} {10}
\DeclareMathAccent{\dddot}            {\mathord}  {letters} {11}
\DeclareMathAccent{\ddddot}           {\mathord}  {letters} {12}

This could be included in the LaTeX support, in files minion.sty and minionamsmath.sty, and I will do so when I update the support files.

Some additional remarks:

I also do strongly recommend to use unicode-math and LuaLaTeX or XeLaTeX whenever possible. All issues with fonts and encodings are much easier to handle, it does not need all the support files, and all glyphs in the fonts could be accessed in an easy way. I do supply the LaTeX support for Minion Math mainly for legacy documents.

The LaTeX support for Minion Math used "newmath" encodings as default, with 256 slots per encoding. This conflicts with amsmath at some points (e.g. amsmath "synthesizes" some glyphs from components – multiple integral signs, dddot and ddddot accents, etc. – while these are "real glyphs" in Minion Math).

Therefore minionmath.sty, the main package of the LaTeX support, has an option "withamsmath", which simply undefines conflicting commands. And there's a second small package minionamsmath.sty, with the sole task of redefining these commands, after amsmath is loaded.

With current amsmath, it seems accents should be added to "undefined commands" in minionmath.sty and to "redefined commands" in minionamsmath.sty.

So the load order of packages (as in the original question) is correct and intentional:

  • minionmath (with option "withamsmath")

  • amsmath

  • minionamsmath

"newmath" was a TeX project with the aim to define new encoding standard for TeX math fonts, similar to "ec" for text fonts, but it was abandoned in favour of Unicode math and never became a standard. Still I used it as a starting point for Minion Math.

Besides, in my view, the accents in the original question should not be bold:

\begin{equation}
    m\ddot{\bm{x}}= q {\bm E} + q \dot{\bm{x}} \times {\bm B} 
\end{equation}
2
  • Johannes, does XeLaTeX work with the dvi-ps-pdf route? In my cls, it stumbles already at the command \pdfoutput=0 .
    – user64520
    Commented May 23, 2020 at 11:04
  • @Motion Mountain: Your example works here for me, with some adjustments; and "xelatex -no-pdf …" produces a *.xdv file. Of course you have to adjust your files: the \pdfoutput command doesn't work with xelatex. The iftex package is very useful here to switch between pdf / lua / xe specific commands. – I can't tell if xelatex will work with your complete setup with all the style files and commands. Commented May 23, 2020 at 16:20
0

Davislor put me on the right track. Here is a partial solution.

The following file compiles correctly with latex-dvip-Distiller, with pdflatex and with xelatex. I moved the loading of amsmath upwards, and I added two definitions for \iint and \iiint.


\documentclass{book}    
\usepackage{amsmath}           
\usepackage[fullfamily,textlf, opticals, swash, onlytext]{MinionPro}
\usepackage[extraops,textcomp,withamsmath,amssymb]{minionmath}

\makeatletter
\let\arc\@undefined % else conflict with ``curves.sty''
\DeclareMathAccent{\arcacc}           {\mathord}  {letters}  {5}
\makeatother

\def\iint{\relax}
\def\iiint{\relax}

\usepackage{minionamsmath}
\usepackage{curves,calc}           
\usepackage{bm}                 % makes bold math possible using \bm{...}

\begin{document}
\tracingmacros=1
\begin{equation}
    m{\boldsymbol{\ddot x}}
\end{equation}
\end{document}

Note the strange definitions for \iint and \iint that are necessary, because incompatibilities are still present. Also the full 2000 page book appears to typeset correctly again.

Here is a general comment about Latex. My 5000 line cls file has surely more than 1000 lines of code like

\makeatletter
\let\arc\@undefined % else conflict with ``curves.sty''
\DeclareMathAccent{\arcacc}           {\mathord}  {letters}  {5}
\makeatother

\def\iint{\relax}
\def\iiint{\relax}

Lines such as these are only needed to avoid clashes/incompatibilities between packages. (Around 60 packages are used in the free physics book.) In an ideal world, such code lines would not be necessary...

3
  • I would, if possible, replace those packages with unicode-math. The font you use is commercially available in OpenType, and you can produce DVI output, which you say you need, with dvilualatex, or perhaps use XDV.
    – Davislor
    Commented May 22, 2020 at 22:48
  • on your "general comment" your ideal world doesn't exist. It is not just latex, in any programming language if you incorporate thousands of lines of code written by hundreds of people over a 30 year period into a single program you may have to do some compatibility adjustments to make them compile in a single run. That said, your first four lines can be replaced by \let\arc\relax\DeclareMathAccent{\arcacc} {\mathord} {letters} {5} and the last two don't do anything useful, you could delete them, whatever incompatibility they are there for must be solvable in a better way. Commented May 23, 2020 at 7:30
  • David, yes you are right. And I want repeat that latex has always been fun. And I am very happy to have you and everybody else here helping in this project. Thank you. To show what I mean, I have put the class file for the book here: motionmountain.net/motionmountain.cls After 30 years of improvements, it now has 5500 lines and 210 kB. It has become quite horrible in places...
    – user64520
    Commented May 23, 2020 at 8:41

You must log in to answer this question.