uliska / lilyglyphs

Make LilyPond's notational elements available in Lua- and XeLaTeX
30 stars 13 forks source link

Incompatiblity with `babel` (german,ngerman) #92

Closed Josef-Friedrich closed 3 years ago

Josef-Friedrich commented 7 years ago

lilyglyphs is incompatible with the package babel. Only the babel options german and ngerman are affected. Some lilyglphys macros are working fine with babel

%!TEX program = lualatex
\documentclass{article}

\usepackage{fontspec}
\usepackage{lilyglyphs}

%working
%\usepackage[english]{babel}

%working
%\usepackage[french]{babel}

%not working
%\usepackage[german]{babel}

%not working
\usepackage[ngerman]{babel}

\begin{document}

\section{Incompatible with babel (german,ngerman)}

\clefG
\lilyTimeC
\sharp
\wholeNoteRest
\lilyAccent
\accordionBayanBass

\section{Always working}

\threeBeamedQuaversIII
\lilyDynamics{f}
\crescHairpin
\lilyFancyExample

\end{document}
/local/texlive/texmf-var/luatex-cache/generic/fonts/otl/emmentaler-16.luc)
! Missing number, treated as zero.
<to be read again> 
\char 
l.61 

? 
! Argument of \language@active@arg" has an extra }.
<inserted text> 
\par 
l.61 

? 
Runaway argument?
! Paragraph ended before \language@active@arg" was complete.
<to be read again> 
\par 
l.61 

? 
uliska commented 7 years ago

I assume this is not due to lilyglyphs but rather an incompatibility between fontspec and babel (see for example http://tex.stackexchange.com/questions/30684/what-is-the-implication-of-the-warning-in-the-fontspec-manual-with-respect-to-ba).

You should in general not use babel together with Lua/XeLaTeX and fontspec, at least it is not recommended.

If you should find any further evidence pointing to an issue with lilyglyphs itself or if you find a hint how lilyglyphs could provide a built-in workaround feel free to reopen the issue.

Josef-Friedrich commented 7 years ago

Thank you!

welorenz commented 4 years ago

Das Minimalbeispiel vom Beginn der Dokumentation fügt den Zeichen unter Luatex Boxen an. Wenn lilglyphs mit dem Paket polyglossia und deutschen Spracheinstellungen benutzt wird, kommt der obengenannte Fehler:

Argument of \language@active@arg" has an extra }

Ich arbeite mit einer aktuellen Texlive-Installation. Mit Xelatex ist der Ausdruck ok.

lilyglyph.pdf

\documentclass{article} \usepackage{polyglossia} \setdefaultlanguage[spelling=new, babelshorthands=true]{german} \usepackage{fontspec} \usepackage{lilyglyphs} \begin{document} \flatflat{} or \clefGInline. \end{document}

uliska commented 4 years ago

You should in general not use babel together with Lua/XeLaTeX and fontspec, at least it is not recommended.

AFAIK this is not true anymore. By contrast, I have now been advised to do prefer babel over polyglossia. So this may have to be revisited.

uliska commented 4 years ago

Das Minimalbeispiel vom Beginn der Dokumentation fügt den Zeichen unter Luatex Boxen an.

Did you test this with the Github version or are you using a release from CTAN or TeX Live? IIRC 06aa0a6db6b1710f3a276fd36ffe2bd6688087b0 should have fixed that issue.

OTOH lilyglyphs is undergoing major changes right now, so maybe anything discussed here will be obsolete anyway. I'm still reopening this for further inverstigation.

urrameu commented 3 years ago

Hi,

  1. This affects at least Portuguese too;
  2. The cause of the problem is that, in some languages, babel makes the double quote character (") a shorthand, which clashes with something in lilyglyphs;
  3. I downloaded the latest version from github (today is 2020-10-01) and the problem is gone.

For those using an older version of the package, a workaround is:

\bgroup\shorthandoff{"}\crotchetRest\egroup
uliska commented 3 years ago

So it can be assumed the version just uploaded to CTAN fixes this issue.