I am not an expert with Latex at all and I am just happy to be able to use it — to some extent. After quite some time, I decided to continue working with it and I saw that all my Gregorian chants do not compile anymore. The following error message is shown:

(./gregoriotex.tex[\directlua]:1: attempt to call a nil value (field 'check_version')
stack traceback:
    [\directlua]:1: in main chunk.
l.63 ...x.check_version(\number\greinternalversion)}

I am using MiKTeX Console V. 2.9.7206 and made all updates on Dec/18 2019. The Gregorio package I am using is V.5.2.1.

this is my Code around the Gregorio TeX file:

% !TEX TS-program = lualatex
% !TEX encoding = UTF-8
\geometry{left=1cm, right=1cm, top=1cm, bottom=1cm}
\setspaceafterinitial{2.2mm plus 0em minus 0em}
\setspacebeforeinitial{2.2mm plus 0em minus 0em}
\def\greinitialformat#1{{\fontsize{43}{43}\selectfont #1}}
\gresetfirstlineaboveinitial{\small \textsc{\textbf{III.}}}{\small \textsc\textbf{III.}}
\commentary{{\small \emph{XVII. s.}}}

I'm not sure if it really makes sense to paste the whole GABC file here. Instead I uploaded the file to pastebin: https://pastebin.com/UBKfuhT3 If i should still paste it here, I can do, of course...

I already looked for this issue here and elsewhere and I found some references to microtype (e.g. microtype error with lualatex: "attempt to call field warning a nil value"), but I cannot figure out if or how this relates to my issue or how I could use it to solve my issue…

Can anyone help?

  • Show a minimal example that can be used for tests. Dec 16, 2019 at 22:46
  • It would be important to know which version you’re trying to work with now. I have a .gabc file from 2012 that still works (and can insert it as an example for your question if you like), but I had to make some changes to the .tex file where I include the score.
    – Thérèse
    Dec 16, 2019 at 22:51
  • github.com/gregorio-project/gregorio/blob/master/CHANGELOG.md should be useful.
    – Thérèse
    Dec 17, 2019 at 0:29
  • I added the surrounding TeX. If you also need the Gregorio part, please let me know.
    – TomS
    Dec 18, 2019 at 7:35

1 Answer 1


This should work:

  \huge\scshape Credo
\gresetlinecolor{gregoriocolor}% red lines
\gresetheadercapture{commentary}{grecommentary}{string}% string is taken from .gabc file
\gregorioscore{CredoIII.gtex}% include file produced by running gregorio on .gabc file

The commentary line needs to be moved to the .gabc file.

Here is the output with \setmainfont{EB Garamond}, and with commentary: XVII. s.; added to your .gabc file:


N.B.: The above works with the version of gregorio now in TeX Live. If you have an old version in your present working directory, you may well see numerous and opaque error messages.

  • Nope, does not work... unfortunately. This is the message: (C:/Users/xxxxx/AppData/Roaming/MiKTeX/2.9/tex/luatex/ctablestack/ctable stack.sty))[\directlua]:1: attempt to call a nil value (field 'check_version') stack traceback: [\directlua]:1: in main chunk. l.63 ...x.check_version(\number\greinternalversion)}
    – TomS
    Dec 18, 2019 at 16:36
  • 1
    Then, unless there’s something wrong in your .gabc file, I’m afraid I can’t help, because it works for me with my .gabc files. I’m using TeX Live, not MikTeX; that may also account for our different results.
    – Thérèse
    Dec 18, 2019 at 16:40
  • 1
    If you post your .gabc file, I’ll test it later today; that may tell us whether this is a TeX Live vs. MikTeX problem.
    – Thérèse
    Dec 18, 2019 at 16:48
  • 1
    Your .gabc file produces perfect output for me, so this looks like a problem peculiar to MikTeX. Very sorry, I can be of no use there, since I haven’t touched Microsoft in some twenty years. Does it work for you if you comment out \usepackage{microtype}?
    – Thérèse
    Dec 18, 2019 at 21:59
  • 1
    Do you perhaps have more than one version of gregorio on your system?
    – Thérèse
    Dec 19, 2019 at 0:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.