Skip to content

A blazingly fast API for compiling La/TeX offline with Tectonic, hosted on Hugging Face Spaces.

Notifications You must be signed in to change notification settings

winstxnhdw/tectonic-api

Repository files navigation

tectonic-api

API build.yml warmer.yml dependabot.yml

Open in Spaces Open a Pull Request

A blazingly fast PGO/BOLT-optimised axum API for compiling La/TeX offline with Tectonic, hosted on Hugging Face Spaces.

Usage

Important

\input is not supported as it requires access to your file system.

GET /v2/pdf (compile TeX/LaTeX source)

Parameters

CompileSchema

name type data type description
source required string La/TeX source code

Responses

http code content-type reason
200 application/pdf compiled PDF document
400 text/plain bad request
500 text/plain internal server error

Example cURL

curl https://winstxnhdw-tectonic-api.hf.space/api/v2/pdf?source=<TEX_SOURCE_CODE>

Development

You can spin the server up locally by first building the Docker image.

docker build -f Dockerfile.build -t tectonic-api .

Finally, you can run the Docker container with the following environment variables.

docker run --init --rm \
    -e SERVER_PORT=7860 \
    -e MAX_CACHE_MEMORY=12884901888 \
    -e CACHE_EXPIRY=3600 \
    -p 7860:7860 \
    tectonic-api

About

A blazingly fast API for compiling La/TeX offline with Tectonic, hosted on Hugging Face Spaces.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •