I ran into this with the package lilyglyphs
but I'm not sure whose fault this error is.
When I compile the following with lualatex
:
\documentclass{article}
\usepackage{csquotes}
\MakeOuterQuote{"}
\EnableQuotes
\begin{document}
\directlua{print("hello")}
\end{document}
I get an error saying
\directlua]:1: unexpected symbol near '\'. l.6 \directlua{print("hello")}
Now suppose that I do not directly write \directlua
in my document, but I include a package that does it internally. Such as
\documentclass{article}
\usepackage{fontspec, csquotes, lilyglyphs}
\MakeOuterQuote{"}
\EnableQuotes
\begin{document}
\wholeNote
\end{document}
I have no knowledge why compilation fails, because the error now becomes
! Missing number, treated as zero. <to be read again> \begingroup l.7 \end {document}
From my user point of view I did nothing wrong, because I'm using the public API provided by the packages. The csquotes
documentation specifically says:
Note that all characters are automatically checked for validity as they are allocated. This package will reject characters which are unsuitable as active quotes... In sum, the following characters will be considered as reserved by this package:
A–Z a–z 0–9 . , ; : ! ? ' - # $ % & ^ _ ` ~ \ @ * { } [ ]
So my question is whose fault is this error?
- My fault, the user's fault, because I should have known (but how?) that even though the quote is not listed as unsuitable in the csquotes manual, it actually is?
- The fault of the implementation or documentation of
csquotes
for failing to mention"
as unsuitable? - The fault of the implementation of the
\directlua
command because it doesn't prevent LaTeX catcode changes/active characters from impacting its argument? - A shortcoming of TeX itself because of its global state based architecture?