✾ ΛacTeX
In short: ΛacTeX is a small collection of code (in Lua) to make typesetting in LaTeX easier, by simplifying the commands used as well as the document structure.
Before I go on explaining more in depth, I must make some disclaimers:
- This is more of a personal project that I decided to make public and less of a tool for wide use. You may find that, while I consider it simpler and faster than standard LaTeX syntax, you don't. It's a matter of personal preference. Therefore, see this as more as a "proof of concept" or as something you can edit yourself.
- One of the main features of ΛacTeX is that math environment delimeters like $, $$, \[ ... \], math, displaymath have been replaced by 2-spaces for simple math mode and by 3-spaces for display mode. This might confuse you at first or you may not want to use this kind of syntax. You can alter these in controls.lua to use your prefered choice of delimeters.
- Spaces are important in general in ΛacTeX. Not only because of math mode, this is just one thing; but since commands do not initiate with backslashes \, there must be some differentiating factor, in order not to confuse them with plain, regular words. This means, in practice, that (for example) you cannot do alpha_{i} or α_{i} but you can do alpha _{i} or α _{i}. Similarly, you cannot do INT_{a}^{b} but you can do INT _{a}^{b}. By the way, there exist other ways to make sub/sup-scripts; see the List of commands section bellow.
-
Another important thing concerning spaces: Tabs must be registered as a sequence of 4 spaces for ΛacTeX to work "out of the box" (in order not to be confused with math mode). Usually, this is the case (such as in Visual Studio Code or in Kate editors, but not in Vim, where it is a humongus 8). If you are experiencing issues, you can:
- Either change how many spaces your tabs are, in your editor of choice,
- Or, in controls.lua, change how many spaces you want your tabs or math modes to be (or change the command altogether).
- I have tried to make the code readable and use a simple programming language, so feel free to modify anything to fit your needs. Find it in the Where is it? section.
- This is a preliminary version. Expect to find nasty stuff (bugs, explosions, etc).
- Sets its version to lualatex (this is used if you choose to compile to a pdf using lac.lua),
- Sets its document class to book, with attributes [a4,12pt],
- Inputs a file test_file.tex,
- Uses some packages, say amsmath, amsfonts, amsthm, OldStandard as well as babel and fontenc, with attributes [greek,english] and [T1] respectively,
- Defines theorem-like environments, such as theorem, lemma, proposition et cetera,
- Writes some text, some regular math, some display math and a theorem.
Later on, we will see how to construct it and export it to LaTeX, in the How do I use it? section.
CopyCLASS BOOK [a4,12pt]
INPUT
test_file.tex
END
PAC
babel [greek,english]
fontenc [T1]
amsmath
amsfonts
amsthm
OldStandard
END
INNIT
THMS
END
START
This is some text and some math SUM _{ k IN |N } 1 / k .
THM [Some theorem of Fourier Analysis]
For every f in RMN L ^2 it holds:
f(x) = SUM _{ k IN |Z } HAT f (k) e ^{ikx}
where the Fourier coefficients HAT f (k) are defined as:
HAT f (k) = F// {1}{2 π } INT _{- π }^{ π } f(x) e^{-ikx} dx
END
See, this is an equation:
EQU
f(x) = SUM _{ k IN |Z } HAT f (k) e ^{ikx}
END
END
All of the code is available on GitHub:
Feel free to download it and modify it.
Practical things first: Currently there is no .exe or .AppImage executable available. If a non-negligible amount of people request it, I will make it.
So, to run it, you will need to have Lua installed (it's very small in size). I have tried 5.1 upwards, but you shouldn't have problems with earlier versions too. If you have Linux, you can download it from your packet manager, or check here. If you have Windows, check here. If you have MacOS, you are on your own.
After you have downloaded Lua and the code, you can write your ΛacTeX in input.txt and compile in terminal lua lac.lua. You will get your LaTeX code in file.tex. You can change your input-output files in controls.lua. By default, file.tex is not executed; if you want to compile your code and get a pdf, in controls.lua change execute_tex = true. Of course, you need to have some version of tex installed (ex. texlive).
How is a ΛacTeX document structured? Its about time we construct, step by step, an example. To start, use VERS followed by the version of TeX you want to use to compile your document. As mentioned before,
- To start, use VERS followed by the version of TeX you want to use to compile your document. As mentioned before, the output is not compiled by default, but you can change that on controls.lua. If you don't include this step, the default is pdflatex. Of course, you can change what the default is.
- Then, use CLASS followed by the class name, to specify \documentclass{}. After the class' name you can include any attributes, inside brackets, with no spaces in between. For example, CLASS BOOK [a4,12pt] gives \documentclass [a4,12pt]{book}. Right now you must include a class, but it will be optional in the next update.
- Using the following, you can input files \input{test_file.tex}. You can also do it in-line, if you prefer.
test_file.tex
END
- You can include packages by the following. Notice that attributes follow the package name, inside brackets, leaving no spaces in between them. You can also do it in-line, if you prefer.
some_package [attribute1,attribute2]
some_other_package
END
- If you want to use theorem-like environments, such as theorem, proposition, lemma etc, you can include the following code. (That's nifty, innit? Now you understand why I wrote innit this way). This step provides with all the code needed to use these environments inside the document, afterwards. Currently this is its only use, but I plan to enrich it so you can include other premade code.
THMS
END
- To start the document (\begin{document} ... \end{document}), use:
...
END
Inside the START environment you can use the respective commands provided in the next section. Important notice: You can insert as many tabs as you want to keep your document neatly organised. Just have in mind that, after your tabs, you need to add extra spaces for math mode.
Constantly updating. I have tried to include much of LaTeX's utility, while also keeping the collection of commands relatively small and compact. After all, this is supposed to make things simpler, not overwhelm us.
You can mail me at:
- @
Or find me in person, in Zografou (Off. 120, dept. of Math.). Always mention what the problem is (roughly), don't just send .txt files.
- 20260501-23:15: Included more commands, such as embellishments in math mode, arrows, basic symbols. Now you can change the input and output files in controls.lua.
- 20260430-23:00: Prototype.
- [High] Remove the necessity to include a class.
- [Medium] Include TikZ.
- [Medium] Prepare a PDF with the complete collection of commands. Complete the List of commands in the site.
- [Medium] Add START*, which initiates the document without \begin{document} ... \end{document}, so that ΛacTeX documents can be imported to input.txt
- [Low] Include code blocks and directlua.
- [Low] Keep ΛacTeX indentation when converting to LaTeX.
- [Low] Forgot to include \part. Oops! Fix tabular, center, updownarrow on the backup.
Hosting service: Github

