HomeResearchNotes & BooksNews & SeminarsMisc

✾ ΛacTeX

What is Λ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:

ΛacTeX is a amalgam of the words Laconic (Λακωνικός, meaning simple, with few words) and TeX. Its purpose is to read some .txt document with ΛacTeX commands and export another .tex document, in LaTeX. Below, as an example, there is a simple ΛacTeX document, which:

Later on, we will see how to construct it and export it to LaTeX, in the How do I use it? section.

Copy
VERS LUALATEX

CLASS 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

Where is it?

All of the code is available on GitHub:

Feel free to download it and modify it.

How do I use 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 and 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.

Copy
INPUT
    test_file.tex
END
Copy
PAC
    some_package [attribute1,attribute2]
    some_other_package
END
Copy
INNIT
    THMS
END
Copy
NEWCOMMAND BBT IS BB T END
NEWCOMMAND FW IS SCR W _{0} END
NEWCOMMAND ADDSQ [2] IS ( #1 + #2 )^2 END
DECLMATH ARCSEC IS RMN arcsec END
DECLMATH* SUPINF IS RMN supinf END
Copy
START
    ...
END
Copy
START*
    ...
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.

List of commands

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.

How do I provide suggestions and report bugs?

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.

Changelog
  • 20260616-00:00: Added some new commands, such as SCAPS (small caps, \textsc). Added REFP, which is REF with parentheses put automatically. Added THMSGR in INNIT, which is the Greek version of THMS. Fixed the generic_end environments' spacing.
  • 20260615-02:15: Added some new commands, such as COLOR and FOOTNOTE. LABEL and REF no longer need braces. builder.lua now handles BB, BF, CAL etc better.
  • 20260513-23:15: Added BIBLIOGRAPHY (\begin{thebibliography}), ADDCONTENTSLINE, THISPAGESTYLE and magnifying commands, such us LARGE. PART, CHAPTER, SECTION, etc do not need braces anymore. Just write CHAPTER the_name and change line. Fixed the bug where the tail of title and date wouldn't display properly.
  • 20260505-21:30: Added some new symbols (operators, order). Added PROOF, FOOTNOTE, REDIR (\hyperref), HREF, DECLMATH, DECLMATH*. Added title pages, TITLE, AUTHOR, etc. Added TABLEOFCONTENTS. Added TIKZ, but the internal tikz-commands are unchanged for the time being (ie, same as in LaTeX). Removed obscure functions. If you want something of the form arcsec, do DECLMATH ARCSEC IS RMN arcsec END. Default class removed, since it is not really needed. EXER environment now works properly. INPUT now works inside the document too.
  • 20260502-18:12: Added missing commands, such as PART. Added NEWCOMMAND functionality. Added START* so you can initiate a document without \begin{document} (needed for imports). Fixed the bug where INNIT THMS would work only in CLASS BOOK. Fixed the bug where CLASS would be saved incorrectly.
  • 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.

Things to add in the future
  • [High] Add BibTeX support.
  • [Medium] Should we make the internal TikZ commands easier?
  • [Medium] Prepare a PDF with the complete collection of commands. Complete the List of commands in the site.
  • [Low] Include code blocks and directlua.
  • [Low] Keep ΛacTeX indentation when converting to LaTeX.

Hosting service: Github