TeX-Live / yhmath

Development of the yhmath package
Other
4 stars 0 forks source link

Command \widering already defined #4

Closed ivankokan closed 4 years ago

ivankokan commented 5 years ago

Hi, Here is another issue in which I get

! LaTeX Error: Command \widering already defined.
               Or name \end... illegal, see p.192 of the manual.

irrelevant to whether the new option nowidering is being used or not.

MWE:

\documentclass{article}

\usepackage{newtxtext}
\usepackage{newtxmath}

\usepackage{amsmath}
\usepackage{amssymb}

\usepackage[nowidering]{yhmath}

\begin{document}
  \[ \widearc{AB} \wideparen{AB} \]
\end{document}
RuixiZhang42 commented 5 years ago

newtxmath and amssymb are incompatible, which means newtxmath and yhmath are incompatible as well. You use the former if you want Times-like font for math, and the latter if you want the good old Computer Modern Roman. These two families of fonts don’t go together.

ivankokan commented 5 years ago

I agree with you, but still... The option nowidering should do its work, i.e. undefine previously defined \widering to avoid the conflict with some others that define the same command (either before or after yhmath, even using hooks).

In given MWE the problem comes from some \widering defined earlier (newtxmath) than with yhmath: so actually https://github.com/TeX-Live/yhmath/blob/master/yhmath.dtx#L361 does its work (PDF is eventually produced), but the error occured a bit earlier: https://github.com/TeX-Live/yhmath/blob/master/yhmath.dtx#L341. The following order resolves the particular issue:

\usepackage{newtxtext}
\usepackage[nowidering]{yhmath}
\usepackage{newtxmath}
\usepackage{amsmath}
\usepackage{amssymb}

Let me propose a bit different approach: introducing widering instead of having nowidering option, i.e. defining \widering in yhmath only if explicitly requested in option list. This way the relative position of yhmath would not be important. What do you think?

norbusan commented 5 years ago

Hi If you load yhmath first, then it will work. Anyway, I will change the loading mechanism that this shouldn't happen. Thanks

Norbert

samestep commented 4 years ago

I still get this issue when trying to use the yhmath package to get the \wideparen command in the acmart document class. Here is the solution that worked for me:

\usepackage{savesym}
\savesymbol{widering}
\usepackage{yhmath}
ivankokan commented 4 years ago

Hi @samestep. Fix was implemented (check commit above), but not released.

ivankokan commented 4 years ago

Anyway, any plans for releasing this?

norbusan commented 4 years ago

I uploaded 1.6 with the widering fix just now to CTAN.