gregorio-project / gregorio

The Gregorio Project
http://gregorio-project.github.io
Other
163 stars 43 forks source link

Loading `unicode-math` package conflicts with `\Vbar` #1392

Open jperon opened 6 years ago

jperon commented 6 years ago

Here is an mwe :

\documentclass{scrartcl}
\usepackage{unicode-math}
\usepackage[autocompile]{gregoriotex}

\begin{document}
\Vbar
\gabcsnippet{(c4) <sp>V/</sp>.(f)}
\end{document}

If you comment out \usepackage{unicode-math}, the ℣ is shown normally ; otherwise, it disappears.

henryso commented 6 years ago

unicode-math defines \Vbar. I guess we need to put a gre prefix on these as well. @rpspringuel What do you think? I don't think I'll have time to make this change and see it through before I leave for December.

henryso commented 6 years ago

I guess the alternative is to document this and that redefining the Vbar after loading packages (using gregorio macros) can override the unicode-math definition.

jperon commented 6 years ago

What I don't understand is that, gregoriotex being loaded after unicode-math, it should overwrite \Vbar. As is, it doesn't work ; but if I put \let\Vbar\undefined just before loading gregoriotex, it works.

jperon commented 6 years ago

Please forget my last comment : I had commented out \usepackage{unicode-math}. So even undefining \Vbar doesn't solve the problem.

jperon commented 6 years ago

While investigating a little more, I saw that :

So, I don't know how, but I think that unicode-math's definitions are made only at \begin{document}.

rpspringuel commented 6 years ago

Sorry, bogged down with papers at the moment. Prefixing sounds good. Perhaps conditioned on the loading of unicode-math?

✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝ Br. Samuel, OSB (R. Padraic Springuel) PAX ☧ ΧΡΙΣΤΟΣ

On Dec 3, 2017, at 3:38 PM, jperon notifications@github.com wrote:

While investigating a little more, I saw that :

if I put \gresimpledefbarredsymbol{V}{0.1em} before \begin{document}, the problem appears ; if I put it after \begin{document}, the problem disappears. So, I don't know how, but I think that unicode-math's definitions are made only at \begin{document}.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

rpspringuel commented 3 years ago

@jperon do you know where I can find the documentation for unicode-math?

rpspringuel commented 3 years ago

@jperon Found it. CTAN's own search didn't want to show it to me, but Google did.

rpspringuel commented 3 years ago

So, I don't know how, but I think that unicode-math's definitions are made only at \begin{document}.

Reading through the documentation, this is correct. They define all macros within \AtBeginDocument. This means that our \Vbar definition (which is not so protected) will be overwritten at that point and you can cause it to revert by redefining the command using our tools after \begin{document}.

I'm inclined to close this a won't fix. We can't guarantee that there will be no macro name clashes with all other packages.