1

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
odule_error'
        ...ocal/texlive/2015/texmf-dist/tex/latex/base/ltluatex.lua:116: in function 'l
uatexbase_error'
        ...ocal/texlive/2015/texmf-dist/tex/latex/base/ltluatex.lua:291: in function 'r
egister'
        luatexinterchartoks.lua:64: in main chunk
        [C]: in function 'dofile'
        [\directlua]:1: in main chunk.
l.35 \directlua{dofile('luatexinterchartoks.lua')}
Toothrot
  • 3,346
  • 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
  • @DavidCarlisle, it works with 0.80.0, thanks for the help! – Toothrot Feb 10 '16 at 22:07
  • as warned elsewhere luatex 0.8x breaks most things including this: the token_filter callback used there is gone with no documented replacement, I'm about to ask on the luatex list if that was intended..... – David Carlisle Feb 10 '16 at 22:40
  • Note that the code will not work at all in luatex 0.89 as the token_filter callback has been removed with no replacement http://tug.org/pipermail/luatex/2016-February/005651.html – David Carlisle Feb 11 '16 at 12:04
  • @DavidCarlisle Do you want to write up an answer? – TeXnician Sep 20 '18 at 19:09

1 Answers1

2

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

David Carlisle
  • 757,742