\newpage
\section{Working with lua} \label{calc_with_lua}

If you want Lua to do the calculations, the recommended way is now the package \tkzNamePack{tkz-elements}: it computes the points with Lua and \tkzname{\tkznameofpack} draws them (see the option \code{mini} below). The option \code{lua} of \tkzname{\tkznameofpack} remains available and maintained, but new Lua developments go into \tkzNamePack{tkz-elements}.

\subsection{Option \code{lua}} % (fold)
\label{ssub:option_code_lua}

% subsubsection option_code_lua (end)
Since version 5, you can use the option \ItkzPopt{tkz-euclide}{lua} of \tkzname{\tkznameofpack}. Just write in your preamble

 |\usepackage[lua]{tkz-euclide}|.
 You must then compile with LuaLaTeX. The syntax does not change.

Without this option, \tkzname{\tkznameofpack} uses the code of version 4, with \tkzNamePack{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 \code{xfp} with calculations made by \code{lua}: this is how I went from \code{fp} to \code{xfp} and now to \code{lua}. The second, more ambitious, would have been to associate a complex number with each point and to compute with complex numbers in \code{lua}; this is what \tkzNamePack{tkz-elements} now does.

The results are good: this documentation (236 pages at the time) compiled in 47\,s with \code{LuaLaTeX} and \code{xfp}, and in only 30\,s with \code{lua}.

Another document of 61 pages compiles in 16\,s with \code{pdfLaTeX} and \code{xfp}, and in 13\,s with \code{LuaLaTeX} and \code{xfp}.

This documentation compiles with |\usepackage{tkz-base}| and |\usepackage[lua]{tkz-euclide}|, but I did not test all the interactions thoroughly.

\subsection{Option \code{mini}} % (fold)
\label{ssub:option_code_mini}

When you use \tkzNamePack{tkz-elements} to compute the points of your figures, you do not need all the modules of \tkzname{\tkznameofpack}. With the option \ItkzPopt{tkz-euclide}{mini}, |\usepackage[mini]{tkz-euclide}|, only the modules needed for the drawings are loaded. Some macros, such as those of the section \emph{The Show}, still require the complete package.

% subsubsection option_code_mini (end)
\endinput