Installation

Install mLaTeX from a package, or build it from source.

From a package

Until a version is released in full, its releases are numbered as alphas and betas, such as 0.2.0-beta.2, and GitHub marks them as pre-releases. The newest full release is the one GitHub shows as Latest.

Packages for each system

Prebuilt packages are attached to each release on GitHub. Each one is named for its system and architecture, such as mlatex-0.1.0-windows-x64.msi or mlatex_0.1.0_arm64.deb.

SystemPackagesInstalls to
Windows.msi installer, .zipC:\Program Files\mLaTeX
macOS.pkg installer/Applications/mLaTeX
macOS.dmg, .tar.gz, .zipwherever the folder is put
Linux.deb, .rpm/opt/mlatex
Linux.tar.gz, .zipwherever it is unpacked
Web-wasm.zip: mlatex.js, mlatex.wasm, mlatex.databeside the page or script that loads it

Installing

msiexec /i mlatex-0.1.0-windows-x64.msi
sudo installer -pkg mlatex-0.1.0-macos-arm64.pkg -target /
sudo apt install ./mlatex_0.1.0_amd64.deb
sudo dnf install ./mlatex-0.1.0-1.x86_64.rpm

What is installed

The program is bin/mlatex inside the installed folder, with the fonts and hyphenation patterns in assets/ beside it. Add that bin folder to your PATH to run mlatex from anywhere.

The command's name

The command is named mlatex so that it never collides with the latex a TeX distribution installs, and the Linux packages stay out of /usr/bin for the same reason.


From a package manager

These packages are not published yet. The commands below are the ones to use once they are.

Python

The Python package is mlatex, published on PyPI. It carries the C library, latex_ffi, and the fonts it reads, for programs that make documents; see Python.

uv add mlatex
pip install mlatex
poetry add mlatex

JavaScript

The JavaScript package is mlatex, published on npm. It carries the WebAssembly module, mlatex.js, mlatex.wasm and mlatex.data, for web pages, workers and Node; see JavaScript.

npm install mlatex

A pre-release, such as 0.2.0-beta.2, is published under the next tag instead:

npm install mlatex@next

From source

Install the tools

  • CMake 3.25 or later, and Ninja.
  • A C++26 compiler with #embed: Clang 19 or later, or GCC 15 or later. On Windows, use the clang-cl that Visual Studio installs under VC/Tools/Llvm.
  • vcpkg, for the libraries: HarfBuzz, libpng, libjpeg-turbo, libwebp, zlib and asmjit. The WebAssembly build doesn't need asmjit.
  • gperf.

Optional: libcurl on Linux and macOS, for pictures fetched from https:// addresses (Windows uses WinHTTP), and Doxygen, for the API reference.

Install the libraries

vcpkg install harfbuzz libpng libjpeg-turbo libwebp zlib asmjit

Configure

cmake -B cmake-build-release -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=<vcpkg>/scripts/buildsystems/vcpkg.cmake

On Windows, the debug, release and wasm presets set all of this up:

cmake --preset release

If the toolchain file is left out, the build looks for vcpkg in VCPKG_ROOT, then in C:/vcpkg. On Windows it also picks Visual Studio's clang-cl by itself when your IDE profile names MSVC's cl or MinGW, neither of which can compile mLaTeX.

Build and test

cmake --build cmake-build-release
ctest --test-dir cmake-build-release --output-on-failure

The program is cmake-build-release/mlatex. The build also leaves latex_ffi, the C library, beside it.

Check it

mlatex --version
mlatex 0.1.0
Typesets LaTeX into PDF: one program, no TeX installation behind it.

Where mLaTeX finds its fonts

Walking up from the program

The fonts and hyphenation patterns live in an assets folder. mLaTeX looks for it by walking up from the program's own location to the first folder that holds assets/fonts, so a build tree, an installed copy or an unpacked archive all work wherever they are.

--assets

If you move the program away from its assets, name them yourself:

mlatex --assets=/path/to/assets paper.tex

Making packages

cpack

From a Release build tree, cpack makes the packages for the system and architecture of that build:

cpack --config cmake-build-release/CPackConfig.cmake

The packages go into the release/ folder at the top of the project.

Windows installers

An .msi needs WiX: version 3, or the wix .NET tool, version 4 or later. WiX 7 asks for its EULA to be accepted once per machine with wix eula accept wix7, and needs the WixToolset.UI.wixext and WixToolset.Util.wixext extensions, added with wix extension add --global.

Other architectures

Another architecture is another build, for example clang-cl targeting ARM64 with the arm64-windows triplet. On macOS, -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" with universal libraries makes one disk image for both.