Hi, according to the documentation find_{output,write}_file should return the name of the to be written file. Currently this is mostly ignored and the original name is always used. Here is a patch to fix this. Best regards, Marcel Krüger --- source/texk/web2c/luatexdir/tex/texfileio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/texk/web2c/luatexdir/tex/texfileio.c b/source/texk/web2c/luatexdir/tex/texfileio.c index 143e694e1..158757080 100644 --- a/source/texk/web2c/luatexdir/tex/texfileio.c +++ b/source/texk/web2c/luatexdir/tex/texfileio.c @@ -347,7 +347,7 @@ boolean lua_a_open_out(alpha_file * f, char *fn, int n) messaging is left to \LUA\ then. */ - ret = open_outfile(f, fn, FOPEN_W_MODE); + ret = open_outfile(f, str_string(fnam), FOPEN_W_MODE); } } else { if (openoutnameok(fn)) { @@ -379,7 +379,7 @@ boolean lua_b_open_out(alpha_file * f, char *fn) fnam = 0; test = run_callback(callback_id, "S->s", fn, &fnam); if ((test) && (fnam != 0) && (str_length(fnam) > 0)) { - ret = open_outfile(f, fn, FOPEN_WBIN_MODE); + ret = open_outfile(f, str_string(fnam), FOPEN_WBIN_MODE); } } else { if (openoutnameok(fn)) { -- 2.21.0