Difference between revisions of "LuaTeX callbacks"
Jump to navigation
Jump to search
File reading callbacks /
m |
m |
||
Line 47: | Line 47: | ||
[[Category:Programming and Databases]] | [[Category:Programming and Databases]] | ||
+ | [[Category:Tools]] |
Latest revision as of 17:01, 8 June 2020
The callback system from LuaTeX has been disabled. Instead, Context defines actions that must be registered through an offical mechanism. Then they can be toggled on and off at will, as long as it makes sense.
Actions
This page is dedicated to collecting all available information on how to achieve in Context when you would resort to callbacks to do the same in plain LuaTeX.
File reading callbacks / open_read_file
The functionality provided by the open_read_file
callback
can be accessed through a string filter that is hooked into the
textfileactions
processor (data-tex.lua, cf. luat-fio.lua)
Hans demonstrated the canonical way on the mailing list [1]:
\startluacode function document.MyCharacterMess(str,filename) if file.nameonly(filename) == "ward" then str = table.concat(string.totable(str,"."), " + ") end return str end local textfileactions = resolvers.openers.helpers.textfileactions utilities.sequencers.appendaction(textfileactions,"system","document.MyCharacterMess") \stopluacode \starttext \input ward \input knuth \stoptext
Further Information
- An informative Thread, initiated by Patrick
- Some related user reports on the mailing list
- Miscellaneous Lua Topics