{"id":283,"date":"2011-01-09T18:04:18","date_gmt":"2011-01-09T18:04:18","guid":{"rendered":"http:\/\/www.readytext.co.uk\/?p=283"},"modified":"2014-07-23T12:46:02","modified_gmt":"2014-07-23T12:46:02","slug":"a-mimimal-luatex-setup-on-windows-part-1","status":"publish","type":"post","link":"https:\/\/www.readytext.co.uk\/?p=283","title":{"rendered":"A minimal LuaTeX setup on Windows (Part 1)"},"content":{"rendered":"<p>The LuaTeX executable (luatex.exe) can be installed as part of mainstream TeX distributions such as <a href=\"http:\/\/www.tug.org\/texlive\/\">TeX Live<\/a> or, for Windows users, <a href=\"http:\/\/miktex.org\/\">MiKTeX<\/a>. However, with just a little bit of work you can create your own minimal LuaTeX setup under Windows, which is the route I chose to follow. TeX Live and MiKTeX are truly amazing pieces of work and provide extremely comprehensive TeX installations, but they are rather large. In addition, through the process of &#8220;rolling your own setup&#8221; you learn a lot of very useful things about the way that TeX looks for files and resources on your computer. I do have to admit that, initially, it was quite frustrating to &#8220;get the picture&#8221; but it soon made sense. I hope to share some of the lessons I learned, save you some time but also to provide the basic groundwork through which you can further explore the amazing LuaTeX engine.<\/p>\n<p>To obtain the raw luatex.exe you can either compile the source code or download the latest beta via <a href=\"http:\/\/www.luatex.org\/download.html\">the LuaTeX web site<\/a>. My personal preference is to compile LuaTeX from the latest source code but that requires you to install some additional software, namely  <a href=\"http:\/\/www.mingw.org\/\">MinGW and MSYS<\/a>. I&#8217;m not going to cover MinGW and MSYS here because that deserves a separate post.<\/p>\n<blockquote><p>\n<strong>Getting the LuaTeX source code: a primer<\/strong><br \/>\nAgain, I&#8217;m restricting my discussions to Windows because that&#8217;s what I know. The LuaTeX source code is made publicy available from the <a href=\"http:\/\/foundry.supelec.fr\/gf\/project\/luatex\">GForge server at Supelec<\/a> and can be obtained using an <a href=\"http:\/\/en.wikipedia.org\/wiki\/Apache_Subversion\">SVN<\/a> client such as <a href=\"http:\/\/tortoisesvn.net\/\">TortoiseSVN<\/a>. The beauty of this process is that you can keep your local copy of the LuaTeX code fully synchronised with the master repository which is maintained by the LuaTeX developers. Every time the master codebase is modified you simply use TortoiseSVN to download the updates. Marvellous stuff!<\/p>\n<p><img decoding=\"async\" src=\"..\/files\/tortoise.png\" width=\"100%\">\n<\/p><\/blockquote>\n<h3>The mysterious and magical <code>texmf.cnf<\/code> file<\/h3>\n<p>So, you downloaded luatex.exe, start a DOS prompt and type <code>luatex<\/code> to be presented with&#8230;<\/p>\n<p><img decoding=\"async\" src=\"..\/files\/luatex.png\" width=\"100%\"><\/p>\n<p>Um, OK. I&#8217;ll press enter to see what happens&#8230;<\/p>\n<p><img decoding=\"async\" src=\"..\/files\/luatex2.png\" width=\"100%\"><\/p>\n<p>OK, I have a LaTeX file <code>c:\\test.tex<\/code><\/p>\n<p><code>\\documentclass[11pt,twoside]{article}<br \/>\n\\begin{document}<br \/>\n\\pagestyle{empty}<br \/>\nHello Lua\\TeX<br \/>\n\\end{document}<\/code><\/p>\n<p>I&#8217;ll run that, typing <code>test.tex<\/code> and I see&#8230; nothing, luatex.exe exits back to the DOS prompt. Clearly, something is not working!<\/p>\n<p><img decoding=\"async\" src=\"..\/files\/luatex3.png\" width=\"100%\"><\/p>\n<blockquote><p><strong>What went wrong?: a primer<\/strong><br \/>\nOK, we&#8217;re jumping forward and it is way, way too early to explain in detail here but the error is caused by the fact that we&#8217;ve not told luatex.exe anything about the world in which it is running. In ultra-simplistic terms, luatex.exe is completely unaware of its environment and needs to have some additional information, which is a combination of the mysterious and magical <code>texmf.cnf<\/code> file, together with something called <code>\".fmt\"<\/code> files.<\/p>\n<p><code><br \/>\nkpathsea: Running mktexfmt luatex.fmt<br \/>\nluatex.exe: fatal: kpathsea: CreateProcess() failed for `mktexfmt luatex.fmt' (Error 2)<\/code>\n<\/p><\/blockquote>\n<p>Over the course of a number of tutorials I will do my best to explain the truly wacky world of <code>texmf.cnf<\/code> and the magic of <code>.fmt<\/code> files, which are compiled versions of macro packages such as <code>plain TeX<\/code>, <code>LaTeX<\/code> and so forth. Stay tuned&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The LuaTeX executable (luatex.exe) can be installed as part of mainstream TeX distributions such as TeX Live or, for Windows users, MiKTeX. However, with just a little bit of work you can create your own minimal LuaTeX setup under Windows, which is the route I chose to follow. TeX Live and MiKTeX are truly amazing [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,30],"tags":[],"class_list":["post-283","post","type-post","status-publish","format-standard","hentry","category-luatex-installing-on-windows","category-minimal-tex-system"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/283","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=283"}],"version-history":[{"count":25,"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/283\/revisions"}],"predecessor-version":[{"id":3397,"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/283\/revisions\/3397"}],"wp:attachment":[{"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}