From ed605f74c9ce6868d5de29f0f212aa76ce5425b4 Mon Sep 17 00:00:00 2001 From: "Br. Elijah Schwab, O.Carm" Date: Mon, 23 Feb 2015 21:23:10 -0600 Subject: [PATCH 1/6] Extend \includescore Behavior Change: \includescore#1 now performs the following checks: -- If #1 is a `gabc` file and there already is an `-auto.gtex` file then gregoriotex will check the api version of the gtex file for compatibility and recompile the `gabc` file if necessary. -- If #1 is a `gtex` file then gregoriotex will: -- check for a `gtex` file and if none exists then compile one from a `gabc` file if that exists. -- check the api version of the `gtex` file for compatibility and recompile the `gabc` file if necessary. -- compare the timestamp of the `gtex` file against the `gabc` file and recompile if the `gtex` is older. Note: #1 should either end with .gabc or .gtex --- tex/gregoriotex.lua | 51 +++++++++++++++++++++++++++++++++++++++++++++ tex/gregoriotex.tex | 2 +- 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/tex/gregoriotex.lua b/tex/gregoriotex.lua index 916af3ace..f30419294 100644 --- a/tex/gregoriotex.lua +++ b/tex/gregoriotex.lua @@ -185,6 +185,20 @@ local function compile_gabc(gabc_file, tex_file) end end +local function test_gregoriotex_apiversion(tex_file) + local f = io.open(tex_file, "r") + local currentline = "" + repeat + currentline = f:read("*line") + until string.find(currentline, "gregoriotexapiversion") + f:close() + if string.find(currentline, internalversion) then + return true + else + return false + end +end + local function include_gabc_score(gabc_file) if not lfs.isfile(gabc_file) then err("the file %s does not exist.", gabc_file) @@ -199,12 +213,48 @@ local function include_gabc_score(gabc_file) else log("using the file %s without recompiling, as %s hasn't changed since last compilation.", tex_file, gabc_file) end + if not test_gregoriotex_apiversion(tex_file) then + log("Recompiling %s because %s does not match the current gregoriotex api version.", gabc_file, tex_file) + compile_gabc(gabc_file, tex_file) + end else compile_gabc(gabc_file, tex_file) end tex.print(string.format("\\input %s", tex_file)) end +local function include_gtex_score(gtex_file) + local file_root = gtex_file:gsub("%.gtex+$","") + local gabc_file = gtex_file:gsub("%.gtex+$", ".gabc") + + if not lfs.isfile(gtex_file) then + log("the file %s does not exist. Searching for a gabc file.", gtex_file) + if lfs.isfile(file_root .. '.gabc') then + compile_gabc(gabc_file, gtex_file) + tex.print(string.format("\\input %s", gtex_file)) + return + else + err("The %s.gabc file does not exist.", file_root) + return + end + end + + local gtex_timestamp = lfs.attributes(gtex_file).modification + local gabc_timestamp = lfs.attributes(gabc_file).modification + if gtex_timestamp < gabc_timestamp then + gregoriotex.compile_gabc(gabc_file, gtex_file) + else + log("using the file %s without recompiling, as %s hasn't changed since last compilation.", gtex_file, gabc_file) + end + if not test_gregoriotex_apiversion(gtex_file) then + log("Recompiling %s because %s does not match the current gregoriotex api version.", gabc_file, gtex_file) + compile_gabc(gabc_file, gtex_file) + end + tex.print(string.format("\\input %s", gtex_file)) +end + +---------------------------------------- + local function check_version(greinternalversion) if greinternalversion ~= internalversion then err("uncoherent file versions: gregoriotex.tex is version %i while gregoriotex.lua is version "..internalversion, greinternalversion) @@ -216,6 +266,7 @@ local function get_greapiversion() end gregoriotex.include_gabc_score = include_gabc_score +gregoriotex.include_gtex_score = include_gtex_score gregoriotex.compile_gabc = compile_gabc gregoriotex.atScoreEnd = atScoreEnd gregoriotex.atScoreBeggining = atScoreBeggining diff --git a/tex/gregoriotex.tex b/tex/gregoriotex.tex index 228d5c3d9..4a0448298 100644 --- a/tex/gregoriotex.tex +++ b/tex/gregoriotex.tex @@ -1366,7 +1366,7 @@ % function that includes a score in TeX format \def\gre@includetexscore#1{% - \input #1% + \directlua{gregoriotex.include_gtex_score([[#1]])}% \relax % } \ifdefined\includetexscore From 0a08835312251c06589ad8ef2f9cdbaa1533435e Mon Sep 17 00:00:00 2001 From: "Br. Elijah Schwab, O.Carm" Date: Tue, 24 Feb 2015 10:00:50 -0600 Subject: [PATCH 2/6] Optimize the lua extension of \include score. --- tex/gregoriotex.lua | 58 +++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/tex/gregoriotex.lua b/tex/gregoriotex.lua index f30419294..4e48ba836 100644 --- a/tex/gregoriotex.lua +++ b/tex/gregoriotex.lua @@ -186,17 +186,18 @@ local function compile_gabc(gabc_file, tex_file) end local function test_gregoriotex_apiversion(tex_file) - local f = io.open(tex_file, "r") - local currentline = "" - repeat - currentline = f:read("*line") - until string.find(currentline, "gregoriotexapiversion") - f:close() - if string.find(currentline, internalversion) then - return true - else - return false - end + local f = io.open(tex_file, "r") + local wholefile = f:read("*all") + f:close() + for line in wholefile:gmatch("[^\n]*") do + if string.find(line, "gregoriotexapiversion") then + if string.find(line, internalversion) then + return wholefile, true + else + return wholefile, false + end + end + end end local function include_gabc_score(gabc_file) @@ -209,24 +210,27 @@ local function include_gabc_score(gabc_file) if lfs.isfile(tex_file) then local tex_timestamp = lfs.attributes(tex_file).modification if tex_timestamp < gabc_timestamp then + log("%s has changed since last compilation. Recompiling.", gabc_file) gregoriotex.compile_gabc(gabc_file, tex_file) - else - log("using the file %s without recompiling, as %s hasn't changed since last compilation.", tex_file, gabc_file) end - if not test_gregoriotex_apiversion(tex_file) then - log("Recompiling %s because %s does not match the current gregoriotex api version.", gabc_file, tex_file) - compile_gabc(gabc_file, tex_file) - end + local wholefile, sameapi = test_gregoriotex_apiversion(tex_file) + if not sameapi then + log("Recompiling %s because %s does not match the current gregoriotex api version.", gabc_file, tex_file) + compile_gabc(gabc_file, tex_file) + tex.print(string.format("\\input %s", tex_file)) + return + else + tex.print(wholefile) + return else + log("No %s file exists. Compiling %s", tex_file, gabc_file) compile_gabc(gabc_file, tex_file) end - tex.print(string.format("\\input %s", tex_file)) end local function include_gtex_score(gtex_file) local file_root = gtex_file:gsub("%.gtex+$","") local gabc_file = gtex_file:gsub("%.gtex+$", ".gabc") - if not lfs.isfile(gtex_file) then log("the file %s does not exist. Searching for a gabc file.", gtex_file) if lfs.isfile(file_root .. '.gabc') then @@ -238,23 +242,21 @@ local function include_gtex_score(gtex_file) return end end - local gtex_timestamp = lfs.attributes(gtex_file).modification local gabc_timestamp = lfs.attributes(gabc_file).modification if gtex_timestamp < gabc_timestamp then gregoriotex.compile_gabc(gabc_file, gtex_file) - else - log("using the file %s without recompiling, as %s hasn't changed since last compilation.", gtex_file, gabc_file) end - if not test_gregoriotex_apiversion(gtex_file) then - log("Recompiling %s because %s does not match the current gregoriotex api version.", gabc_file, gtex_file) - compile_gabc(gabc_file, gtex_file) + local wholefile, sameapi = test_gregoriotex_apiversion(gtex_file) + if not sameapi then + log("Recompiling %s because %s does not match the current gregoriotex api version.", gabc_file, gtex_file) + compile_gabc(gabc_file, gtex_file) + tex.print(string.format("\\input %s", gtex_file)) + return end - tex.print(string.format("\\input %s", gtex_file)) + tex.print(wholefile) end ----------------------------------------- - local function check_version(greinternalversion) if greinternalversion ~= internalversion then err("uncoherent file versions: gregoriotex.tex is version %i while gregoriotex.lua is version "..internalversion, greinternalversion) From fd2966ce3abfb6d1b839d96f19c529886a7fd367 Mon Sep 17 00:00:00 2001 From: "Br. Elijah Schwab, O.Carm" Date: Tue, 24 Feb 2015 17:09:48 -0600 Subject: [PATCH 3/6] Eliminate i/o to compare the gregoriotexapi versions. --- tex/gregoriotex.lua | 42 +++++++++--------------------------------- 1 file changed, 9 insertions(+), 33 deletions(-) diff --git a/tex/gregoriotex.lua b/tex/gregoriotex.lua index 4e48ba836..33364369b 100644 --- a/tex/gregoriotex.lua +++ b/tex/gregoriotex.lua @@ -185,21 +185,6 @@ local function compile_gabc(gabc_file, tex_file) end end -local function test_gregoriotex_apiversion(tex_file) - local f = io.open(tex_file, "r") - local wholefile = f:read("*all") - f:close() - for line in wholefile:gmatch("[^\n]*") do - if string.find(line, "gregoriotexapiversion") then - if string.find(line, internalversion) then - return wholefile, true - else - return wholefile, false - end - end - end -end - local function include_gabc_score(gabc_file) if not lfs.isfile(gabc_file) then err("the file %s does not exist.", gabc_file) @@ -213,19 +198,15 @@ local function include_gabc_score(gabc_file) log("%s has changed since last compilation. Recompiling.", gabc_file) gregoriotex.compile_gabc(gabc_file, tex_file) end - local wholefile, sameapi = test_gregoriotex_apiversion(tex_file) - if not sameapi then + if tonumber(os.date("%Y%m%d", tex_timestamp)) < internalversion then log("Recompiling %s because %s does not match the current gregoriotex api version.", gabc_file, tex_file) compile_gabc(gabc_file, tex_file) - tex.print(string.format("\\input %s", tex_file)) - return - else - tex.print(wholefile) - return + end else log("No %s file exists. Compiling %s", tex_file, gabc_file) compile_gabc(gabc_file, tex_file) end + tex.print(string.format("\\input %s", tex_file)) end local function include_gtex_score(gtex_file) @@ -233,12 +214,10 @@ local function include_gtex_score(gtex_file) local gabc_file = gtex_file:gsub("%.gtex+$", ".gabc") if not lfs.isfile(gtex_file) then log("the file %s does not exist. Searching for a gabc file.", gtex_file) - if lfs.isfile(file_root .. '.gabc') then + if lfs.isfile(gabc_file) then compile_gabc(gabc_file, gtex_file) - tex.print(string.format("\\input %s", gtex_file)) - return else - err("The %s.gabc file does not exist.", file_root) + err("The %s file does not exist.", gabc_file) return end end @@ -247,14 +226,11 @@ local function include_gtex_score(gtex_file) if gtex_timestamp < gabc_timestamp then gregoriotex.compile_gabc(gabc_file, gtex_file) end - local wholefile, sameapi = test_gregoriotex_apiversion(gtex_file) - if not sameapi then - log("Recompiling %s because %s does not match the current gregoriotex api version.", gabc_file, gtex_file) - compile_gabc(gabc_file, gtex_file) - tex.print(string.format("\\input %s", gtex_file)) - return + if tonumber(os.date("%Y%m%d", gtex_timestamp)) < internalversion then + log("Recompiling %s because %s does not match the current gregoriotex api version.", gabc_file, gtex_file) + compile_gabc(gabc_file, gtex_file) end - tex.print(wholefile) + tex.print(string.format("\\input %s", gtex_file)) end local function check_version(greinternalversion) From 7f79fa7f112288364b577e4c4a9c3aa585556ea4 Mon Sep 17 00:00:00 2001 From: "Br. Elijah Schwab, O.Carm" Date: Wed, 25 Feb 2015 20:19:35 -0600 Subject: [PATCH 4/6] Refactor \includescore. NEW BEHAVIOR: The behavior of `\includescore` has changed. It now has an optional argument. When called without the optional argument i.e. `\includescore{antiphon}`: -- Gregoriotex will now check for the existence of antiphon-APIVERSION.gtex. If that file does not exist it will be compiled from antiphon.gabc. -- If antiphon-APIVERSION.gtex exists, the APIVERSION will be checked against the current gregoriotexapiversion. If there is a mismatch, antiphon.gabc will be recompiled. -- antiphon-APIVERSION.gtex will be checked against the modification time of antiphon.gabc. The gabc will be recompiled if newer than the gtex. -- APIVERSION is a number automatically added by gregoriotex. When called *with* the optional argument i.e. `\includescore[f]{antiphon.gtex}`: -- The file will be immediately passed to TeX. No checks will be made until the one in `\gregoriotexapiversion`. -- The value of the optional argument can be anything. `[f]` is recommended, signifying `Forced`. --- tex/gregoriotex.lua | 55 ++++++++++++++++----------------------------- tex/gregoriotex.tex | 43 ++++++++++++++++++++--------------- 2 files changed, 44 insertions(+), 54 deletions(-) diff --git a/tex/gregoriotex.lua b/tex/gregoriotex.lua index 33364369b..892e19e61 100644 --- a/tex/gregoriotex.lua +++ b/tex/gregoriotex.lua @@ -174,47 +174,33 @@ local function atScoreEnd () end end -local function compile_gabc(gabc_file, tex_file) +local function compile_gabc(gabc_file, gtex_file) info("compiling the score %s...", gabc_file) - res = os.execute(string.format("gregorio -o %s %s", tex_file, gabc_file)) + res = os.execute(string.format("gregorio -o %s %s", gtex_file, gabc_file)) if res == nil then err("\nSomething went wrong when executing\n 'gregorio -o %s %s'.\n" - .."shell-escape mode may not be activated. Try\n '%s --shell-escape %s.tex'\nSee the documentation of gregorio or your TeX\ndistribution to automatize it.", tex_file, gabc_file, tex.formatname, tex.jobname) + .."shell-escape mode may not be activated. Try\n '%s --shell-escape %s.tex'\nSee the documentation of gregorio or your TeX\ndistribution to automatize it.", gtex_file, gabc_file, tex.formatname, tex.jobname) elseif res ~= 0 then err("\nAn error occured when compiling the score file\n'%s' with gregorio.\nPlease check your score file.", gabc_file) end end -local function include_gabc_score(gabc_file) - if not lfs.isfile(gabc_file) then - err("the file %s does not exist.", gabc_file) - return - end - local gabc_timestamp = lfs.attributes(gabc_file).modification - local tex_file = gabc_file:gsub("%.gabc+$","-auto.gtex") - if lfs.isfile(tex_file) then - local tex_timestamp = lfs.attributes(tex_file).modification - if tex_timestamp < gabc_timestamp then - log("%s has changed since last compilation. Recompiling.", gabc_file) - gregoriotex.compile_gabc(gabc_file, tex_file) - end - if tonumber(os.date("%Y%m%d", tex_timestamp)) < internalversion then - log("Recompiling %s because %s does not match the current gregoriotex api version.", gabc_file, tex_file) - compile_gabc(gabc_file, tex_file) - end +local function include_score(input_file) + local file_root = "" + if input_file:gmatch("%.gtex+$") then + file_root = input_file:gsub("%.gtex+$", "") + elseif input_file:gmatch("%.tex+$") then + file_root = input_file:gsub("%.tex+$", "") + elseif input_file:gmatch("%.gabc+$") then + file_root = input_file:gsub("%.gabc+$", "") else - log("No %s file exists. Compiling %s", tex_file, gabc_file) - compile_gabc(gabc_file, tex_file) + file_root = input_file end - tex.print(string.format("\\input %s", tex_file)) -end - -local function include_gtex_score(gtex_file) - local file_root = gtex_file:gsub("%.gtex+$","") - local gabc_file = gtex_file:gsub("%.gtex+$", ".gabc") + local gtex_file = file_root.."-"..internalversion..".gtex" + local gabc_file = file_root..".gabc" if not lfs.isfile(gtex_file) then - log("the file %s does not exist. Searching for a gabc file.", gtex_file) - if lfs.isfile(gabc_file) then + log("The file %s does not exist. Searching for a gabc file", gtex_file) + if lfs.isfile(gabc_file) then compile_gabc(gabc_file, gtex_file) else err("The %s file does not exist.", gabc_file) @@ -224,13 +210,11 @@ local function include_gtex_score(gtex_file) local gtex_timestamp = lfs.attributes(gtex_file).modification local gabc_timestamp = lfs.attributes(gabc_file).modification if gtex_timestamp < gabc_timestamp then - gregoriotex.compile_gabc(gabc_file, gtex_file) - end - if tonumber(os.date("%Y%m%d", gtex_timestamp)) < internalversion then - log("Recompiling %s because %s does not match the current gregoriotex api version.", gabc_file, gtex_file) + log("%s has been modified and %s needs to be updates. Recompiling the gabc file.", gabc_file, gtex_file) compile_gabc(gabc_file, gtex_file) end tex.print(string.format("\\input %s", gtex_file)) + return end local function check_version(greinternalversion) @@ -243,8 +227,7 @@ local function get_greapiversion() return internalversion end -gregoriotex.include_gabc_score = include_gabc_score -gregoriotex.include_gtex_score = include_gtex_score +gregoriotex.include_score = include_score gregoriotex.compile_gabc = compile_gabc gregoriotex.atScoreEnd = atScoreEnd gregoriotex.atScoreBeggining = atScoreBeggining diff --git a/tex/gregoriotex.tex b/tex/gregoriotex.tex index 4a0448298..3a484377c 100644 --- a/tex/gregoriotex.tex +++ b/tex/gregoriotex.tex @@ -1364,45 +1364,52 @@ %% score including %%%%%%%%%%%%%%%%%% -% function that includes a score in TeX format -\def\gre@includetexscore#1{% - \directlua{gregoriotex.include_gtex_score([[#1]])}% - \relax % +% The primary macro that includes a score in gTeX or gabc format. +\def\gre@includescore#1{% + \directlua{gregoriotex.include_score([[#1]])}% + \relax% } + \ifdefined\includetexscore - \greerror{\protect\includetexscore\space is already defined. Check for package conflicts.} + \gre@warning{\protect\includetexscore\space is deprecated. \MessageBreak Use \protect\includescore\space instead.} \else \def\includetexscore#1{% - \gre@includetexscore{#1} + \gre@includescore{#1} } \fi \def\greincludetexscore#1{% \gre@warning{\protect\greincludedtexscore\space is deprecated.\MessageBreak Use \protect\includescore\space instead.} - \gre@includetexscore{#1} + \gre@includescore{#1} } -% function that includes scores in gabc format -\def\gre@includegabcscore#1{% - \directlua{gregoriotex.include_gabc_score([[#1]])}% - \relax % -} \ifdefined\includegabcscore - \greerror{\protect\includegabcscore\space is already defined. Check for package conflicts.} + \gre@warning{\protect\includegabcscore\space is deprecated.\MessageBreak Use \protect\includescore\space instead.} \else \def\includegabcscore#1{% - \gre@includegabcscore{#1} + \gre@includescore{#1} } \fi \def\greincludegabcscore#1{% \gre@warning{\protect\greincludedgabcscore\space is deprecated.\MessageBreak Use \protect\includescore\space instead.} - \gre@includegabcscore{#1} + \gre@includescore{#1} } -% Wrapper function that can handle both file types. This is done by checking the filename (using the string tests from the xstring package) to see if it ends with .gabc. If it does, we assume the file is in gabc format and pass it to \ger@includegabcscore. All other files are assumed to be in gtex format and are processed using \gre@includetexscore. -\def\includescore#1{% - \IfEndWith{#1}{.gabc}{\gre@includegabcscore{#1}}{\gre@includetexscore{#1}} +% A macro that passes the score directly to TeX without performing the API version check or if the gabc was modified since the creation of the gtex file. +\def\gre@includescorewithoption[#1]#2{% + \input #2% + \relax% } +% The main macro used by the user to input scores into the document. + +\def\includescore{\@ifnextchar[{\gre@includescorewithoption}% + {\gre@includescore}% +} + +% If called without the optional argument '\includescore{Antiphon}' the filename will be passed to the lua function 'include_score' which will check: whether the gtex file exists, if the API version of the gtex file, or if the gabc file is newer than the gtex file. If one of these tests fails, the gabc file will be (re)compiled. + +% If called with the optional argument '\includescore[f]{Antiphon.gtex}' the gtex file will be forced into the document and will not be checked by the lua function 'include_score'. This does not bypass the API version test done by '\gregoriotexapiversion'. + %%%%%%%%%%%%%%%%%%%%%%%%%% %% some hyphen definitions %%%%%%%%%%%%%%%%%%%%%%%%%% From 959f09f09beec60836d4fa6206cc0ef7480aee26 Mon Sep 17 00:00:00 2001 From: "Br. Elijah Schwab, O.Carm" Date: Wed, 25 Feb 2015 20:35:13 -0600 Subject: [PATCH 5/6] Version change: Gregorio 2.4.1 -> 2.4.2 Changed due to the refactoring of `\includescore`. --- VERSION | 2 +- configure.ac | 2 +- windows/gregorio.iss | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 27df921e8..ad7e0dd67 100644 --- a/VERSION +++ b/VERSION @@ -1,5 +1,5 @@ gregoriotex_api_version = 20150220 -gregorio_version = 2.4.1 +gregorio_version = 2.4.2 *** Do not add any lines above here. *** diff --git a/configure.ac b/configure.ac index ef09fcb9c..c19f33305 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -AC_INIT([gregorio],[2.4.1],[gregorio-devel@gna.org]) +AC_INIT([gregorio],[2.4.2],[gregorio-devel@gna.org]) AC_PREREQ(2.53) AC_CONFIG_SRCDIR([src/gregorio-utils.c]) AC_CONFIG_AUX_DIR([build-aux]) diff --git a/windows/gregorio.iss b/windows/gregorio.iss index ce864505b..74d081f48 100644 --- a/windows/gregorio.iss +++ b/windows/gregorio.iss @@ -1,6 +1,6 @@ [Setup] AppName=gregorio -AppVersion=2.4.1 +AppVersion=2.4.2 DefaultDirName={pf}\gregorio DefaultGroupName=gregorio SetupIconFile=gregorio.ico From a6ad7bf5349e7bde625fb8a30d57925bbe4acf92 Mon Sep 17 00:00:00 2001 From: "Br. Elijah Schwab, O.Carm" Date: Thu, 26 Feb 2015 09:21:18 -0600 Subject: [PATCH 6/6] Improve documentation notes for the new \includescore. --- tex/gregoriotex.lua | 4 ++-- tex/gregoriotex.tex | 24 ++++++++++++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/tex/gregoriotex.lua b/tex/gregoriotex.lua index 892e19e61..536125ecb 100644 --- a/tex/gregoriotex.lua +++ b/tex/gregoriotex.lua @@ -203,14 +203,14 @@ local function include_score(input_file) if lfs.isfile(gabc_file) then compile_gabc(gabc_file, gtex_file) else - err("The %s file does not exist.", gabc_file) + err("The file %s does not exist.", gabc_file) return end end local gtex_timestamp = lfs.attributes(gtex_file).modification local gabc_timestamp = lfs.attributes(gabc_file).modification if gtex_timestamp < gabc_timestamp then - log("%s has been modified and %s needs to be updates. Recompiling the gabc file.", gabc_file, gtex_file) + log("%s has been modified and %s needs to be updated. Recompiling the gabc file.", gabc_file, gtex_file) compile_gabc(gabc_file, gtex_file) end tex.print(string.format("\\input %s", gtex_file)) diff --git a/tex/gregoriotex.tex b/tex/gregoriotex.tex index 3a484377c..3506269ff 100644 --- a/tex/gregoriotex.tex +++ b/tex/gregoriotex.tex @@ -1364,7 +1364,12 @@ %% score including %%%%%%%%%%%%%%%%%% -% The primary macro that includes a score in gTeX or gabc format. +% The primary macro that includes a score. The lua function check that: +% -- The gtex file exists. +% -- The gtex file is of the correct gregoriotexapi_version. +% -- The gtex file is 'newer' than it's corresponding gabc file. +% If either test fails, the gabc file is (re)compiled. + \def\gre@includescore#1{% \directlua{gregoriotex.include_score([[#1]])}% \relax% @@ -1406,9 +1411,20 @@ {\gre@includescore}% } -% If called without the optional argument '\includescore{Antiphon}' the filename will be passed to the lua function 'include_score' which will check: whether the gtex file exists, if the API version of the gtex file, or if the gabc file is newer than the gtex file. If one of these tests fails, the gabc file will be (re)compiled. - -% If called with the optional argument '\includescore[f]{Antiphon.gtex}' the gtex file will be forced into the document and will not be checked by the lua function 'include_score'. This does not bypass the API version test done by '\gregoriotexapiversion'. +% If called without the optional argument: '\includescore{Antiphon}' +% the filename will be passed to the lua function 'include_score' +% which will check: whether the gtex file exists, if the API version +% of the gtex file, or if the gabc file is newer than the gtex +% file. If one of these tests fails, the gabc file will be +% (re)compiled. +% The argument may or may not include a file extension. These are all valid: +% '\includescore{Antiphon}' or '\includescore{Antiphon.gabc}' or +% '\includescore{Antiphon.gtex}' + +% If called with the optional argument: '\includescore[f]{Antiphon.gtex}' +% the gtex file will be forced into the document and will not be +% checked by the lua function 'include_score'. This does not bypass +% the API version test done by '\gregoriotexapiversion'. %%%%%%%%%%%%%%%%%%%%%%%%%% %% some hyphen definitions