diff options
Diffstat (limited to 'Master/texmf-dist/tex/lualatex/lua-check-hyphen/lua-check-hyphen.lua')
-rw-r--r-- | Master/texmf-dist/tex/lualatex/lua-check-hyphen/lua-check-hyphen.lua | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/lualatex/lua-check-hyphen/lua-check-hyphen.lua b/Master/texmf-dist/tex/lualatex/lua-check-hyphen/lua-check-hyphen.lua index e3ba21a906a..b21a39bcde0 100644 --- a/Master/texmf-dist/tex/lualatex/lua-check-hyphen/lua-check-hyphen.lua +++ b/Master/texmf-dist/tex/lualatex/lua-check-hyphen/lua-check-hyphen.lua @@ -2,7 +2,7 @@ -- Public repository: https://github.com/pgundlach/lua-check-hyphen -- Licensed under the MIT license. See the file 'mit-license.txt' for exact terms. --- Version: 0.6 +-- Version: 0.7a -- for debugging purpuse: @@ -167,13 +167,37 @@ local function pairsByKeys (t) return iter end +local function getUhyFilename (tex_jobname) + local unknown_hyphenation_filename = tex_jobname .. ".uhy" + local i = 1 + local FLAG = '-output-directory' + while (arg[i] ~= nil) do + local argument = arg[i] + if (string.sub(argument, 2, 2) == '-' ) then + argument = string.sub(argument, 2) + end + if (string.sub(argument, 1, string.len(FLAG)) == FLAG) then + local prefix = nil + if (string.sub(argument, string.len(FLAG)+1, string.len(FLAG)+1) == '=') then + prefix = string.sub(argument, string.len(FLAG)+2) + else + prefix = arg[i+1] + end + unknown_hyphenation_filename = prefix .. "/" .. unknown_hyphenation_filename + break + end + i = i + 1 + end + return unknown_hyphenation_filename +end + luacheckhyphen.listhyphenatedwords = function() if luacheckhyphen.final == "true" then return end -- don't write if the use has turned that off! if not luacheckhyphen.nofile then - local unknown_hyphenation_filename = tex.jobname .. ".uhy" + local unknown_hyphenation_filename = getUhyFilename(tex.jobname) local unknown_hyphenation_file = io.open(unknown_hyphenation_filename,"w") for k,v in pairsByKeys(luacheckhyphen.all_hyphenatedwords) do if luachekchyphen.compact == "true" or luachekchyphen.compact == nil then |