Tectonic

Mix tasks for installing and invoking tectonic, a modernized, complete, self-contained TeX/LaTeX engine, powered by XeTeX and TeXLive.

This is an adaptation of the Elixir Tailwind installer made by Wojtek Mach and José Valim.

Installation

However, if your assets are precompiled during development, then it only needs to be a dev dependency:

def deps do
[
{:tectonic, "~> 0.1"}
]
end

Once installed, change your config/config.exs to pick your tectonic version of choice:

config :tectonic, version: "0.15.0"

Now you can install tectonic by running:

$ mix tectonic.install

or if your platform isn't officially supported by Tectonic, you can supply a third party path to the binary the installer wants (beware that we cannot guarantee the compatibility of any third party executable):

$ mix tectonic.install [url]

And invoke tectonic with:

$ mix tectonic default -X compile --untrusted myfile.tex

You can also use it within your Elixir code:

Tectonic.run(:default, ~w[-X compile --untrusted myfile.tex])

The executable is kept at _build/tectonic-TARGET. Where TARGET is your system target architecture.

Profiles

The first argument to tectonic is the execution profile. You can define multiple execution profiles with the current directory, the OS environment, and default arguments to the tectonic task:

config :tectonic,
version: "0.15.0",
default: [
args: ~w(
-X compile
--untrusted
)
]

When mix tectonic default is invoked, the task arguments will be appended to the ones configured above. Note profiles must be configured in your config/config.exs, as tectonic runs without starting your application (and therefore it won't pick settings in config/runtime.exs).

License

Copyright (c) 2024 Frank Polasek Dugan III.

Tectonic source code is licensed under the MIT License.