I can't compile the answer given here:

In LuaTex is it possible to change font/language according to the script/glyphs used?

Is it because it's old? My compiler says that \luatexdirectlua is undefined.

PS. With \directlua the error is:

! LuaTeX error luatexinterchartoks.lua:1: unexpected symbol near '%' stack traceback:
        [C]: in function 'dofile'
        [\directlua]:1: in main chunk. l.35 \directlua{dofile('luatexinterchartoks.lua')}

PS II. deleted ll. 1 and 2, now the error is:

! LuaTeX error ...ocal/texlive/2015/texmf-dist/tex/latex/base/ltluatex.lua:109:

Module luatexbase Error: Attempt to use callback.register() directly
(luatexbase)             on input line 35

stack traceback:
        [C]: in function 'error'
        ...ocal/texlive/2015/texmf-dist/tex/latex/base/ltluatex.lua:109: in function 'm
        ...ocal/texlive/2015/texmf-dist/tex/latex/base/ltluatex.lua:116: in function 'l
        ...ocal/texlive/2015/texmf-dist/tex/latex/base/ltluatex.lua:291: in function 'r
        luatexinterchartoks.lua:64: in main chunk
        [C]: in function 'dofile'
        [\directlua]:1: in main chunk.
l.35 \directlua{dofile('luatexinterchartoks.lua')}
  • 1
    as documented in latex news, you should use \directlua (the original name) the latex setup no longer renames luatex commands with the luatex prefix – David Carlisle Feb 10 '16 at 18:41
  • @DavidCarlisle, I did suspect and try that, but it still wouldn't compile. – Toothrot Feb 10 '16 at 18:55
  • if you give no hints about the error that you got, then no hints on how the error may be fixed. – David Carlisle Feb 10 '16 at 18:58
  • delete the line % luatexinterchartoks.lua that is a title for the website but not legal lua – David Carlisle Feb 10 '16 at 19:14
  • that's the issue Ulrike put in a comment replace the callback register line at the end of the lua by luatexbase.add_to_callback ('token_filter', do_intertoks,"xetex chartoks emulation") then it loads without error (but doesn't work, at least in my development build of luatex, looking....) – David Carlisle Feb 10 '16 at 21:52

Note that the code will not work at all in luatex 0.89 as the token_filter callback which was available in some beta releases of luatex has been removed with no replacement http://tug.org/pipermail/luatex/2016-February/005651.html

| improve this answer | |

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.