[OS X TeX] Lua?
Alain Matthes
alain.matthes at mac.com
Wed Feb 16 10:46:48 CET 2011
Le 16 févr. 2011 à 10:37, Michael Welsh a écrit :
> On 16/02/2011, at 8:22 PM, David Arnold wrote:
>> All,
>>
>> Is Lua installed as part of Texlive Mactex?
> Yes.
>> If so, how to access it?
> luatex (or lualatex) on the commandline. Not sure how to get the engine into TeXShop though.
>>
Hello,
A minimal version is used by luatex and lualatex
If you work with lua outside TeX you can install Lua inside /usr/local/bin.
It's not a problem and it's easy
One sample with TexShop ( the main problem is to use a font; I would like to
use utopia and fourier but I don't know how to do this !
%!TEX TS-program = lualatex
\documentclass[12pt]{article}
\usepackage[utf8]{luainputenc}
\parindent = 0pt
\begin{document}
\newcommand{\euclide}[2]{%
\begin{center}
\begin{tabular}{|c|c|c|}
\hline
\directlua{a,b = #1,#2
if a < b then a,b = b,a end
r = a-math.floor(a/b)*b
tex.sprint(a .. "&" .. b .. "&" .. r .. [[\noexpand\\]])
while r > 0 do
a,b = b,r
r = a-math.floor(a/b)*b
tex.sprint(a .. "&" .. b .. "&" .. r .. [[\noexpand\\]])
end}
\hline
\end{tabular}
\end{center}}
\euclide{587}{389}
\end{document}
Best regards
Alain Matthes
More information about the macostex-archives
mailing list