tkz-euclide
News, compatibility and options
54 Working with lua¶
If you want Lua to do the calculations, the recommended way is now the package tkz-elements: it computes the points with Lua and tkz-euclide draws them (see the option mini below). The option lua of tkz-euclide remains available and maintained, but new Lua developments go into tkz-elements.
54.1 Option lua¶
Since version 5, you can use the option lua of tkz-euclide. Just write in your preamble
\usepackage[lua]{tkz-euclide}. You must then compile with LuaLaTeX. The syntax does not change.
Without this option, tkz-euclide uses the code of version 4, with xfp.
The documentation you are reading has been compiled with this option.
A few words about the method and the results. I considered two possibilities. The first one was simply to replace, wherever I could, the calculations made by xfp with calculations made by lua: this is how I went from fp to xfp and now to lua. The second, more ambitious, would have been to associate a complex number with each point and to compute with complex numbers in lua; this is what tkz-elements now does.
The results are good: this documentation (236 pages at the time) compiled in 47 s with LuaLaTeX and xfp, and in only 30 s with lua.
Another document of 61 pages compiles in 16 s with pdfLaTeX and xfp, and in 13 s with LuaLaTeX and xfp.
This documentation compiles with \usepackage{tkz-base} and \usepackage[lua]{tkz-euclide}, but I did not test all the interactions thoroughly.
54.2 Option mini¶
When you use tkz-elements to compute the points of your figures, you do not need all the modules of tkz-euclide. With the option mini, \usepackage[mini]{tkz-euclide}, only the modules needed for the drawings are loaded. Some macros, such as those of the section The Show, still require the complete package.