# Send Compile LaTex & Typst into PDF with TypeTex to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "typetex",
    "name": "Compile LaTex & Typst into PDF with TypeTex",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/gregm711/typetex",
    "canonicalUrl": "https://clawhub.ai/gregm711/typetex",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/typetex",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=typetex",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "examples/compile_typst.py",
      "examples/compile_latex.py",
      "SKILL.md",
      "openapi.yaml"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "typetex",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-02T01:11:33.999Z",
      "expiresAt": "2026-05-09T01:11:33.999Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=typetex",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=typetex",
        "contentDisposition": "attachment; filename=\"typetex-1.5.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "typetex"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/typetex"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/typetex",
    "downloadUrl": "https://openagent3.xyz/downloads/typetex",
    "agentUrl": "https://openagent3.xyz/skills/typetex/agent",
    "manifestUrl": "https://openagent3.xyz/skills/typetex/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/typetex/agent.md"
  }
}
```
## Documentation

### Typst & LaTeX Compiler

Compile Typst (.typ) and LaTeX (.tex) documents to PDF using the TypeTex compilation API.

### API Endpoint

Base URL: https://studio-intrinsic--typetex-compile-app.modal.run

### Compile Typst

POST /public/compile/typst
Content-Type: application/json

Request Body:

{
  "content": "#set page(paper: \\"a4\\")\\n\\n= Hello World\\n\\nThis is a Typst document.",
  "main_filename": "main.typ",
  "auxiliary_files": {}
}

Response (Success):

{
  "success": true,
  "pdf_base64": "JVBERi0xLjQK..."
}

Response (Failure):

{
  "success": false,
  "error": "error: file not found: missing.typ"
}

### Compile LaTeX

POST /public/compile/latex
Content-Type: application/json

Request Body:

{
  "content": "\\\\documentclass{article}\\n\\\\begin{document}\\nHello World\\n\\\\end{document}",
  "main_filename": "main.tex",
  "auxiliary_files": {}
}

Response (Success):

{
  "success": true,
  "pdf_base64": "JVBERi0xLjQK..."
}

Response (Failure):

{
  "success": false,
  "error": "! LaTeX Error: Missing \\\\begin{document}.",
  "log_output": "This is pdfTeX..."
}

### Health Check

GET /public/compile/health

Returns {"status": "ok", "service": "public-compile"} if the service is running.

### Simple Typst Document

import requests
import base64

response = requests.post(
    "https://studio-intrinsic--typetex-compile-app.modal.run/public/compile/typst",
    json={
        "content": """
#set page(paper: "a4", margin: 2cm)
#set text(font: "New Computer Modern", size: 11pt)

= My Document

This is a paragraph with *bold* and _italic_ text.

== Section 1

- Item 1
- Item 2
- Item 3
""",
        "main_filename": "main.typ"
    }
)

result = response.json()
if result["success"]:
    pdf_bytes = base64.b64decode(result["pdf_base64"])
    with open("output.pdf", "wb") as f:
        f.write(pdf_bytes)
    print("PDF saved to output.pdf")
else:
    print(f"Compilation failed: {result['error']}")

### Simple LaTeX Document

import requests
import base64

response = requests.post(
    "https://studio-intrinsic--typetex-compile-app.modal.run/public/compile/latex",
    json={
        "content": r"""
\\documentclass[11pt]{article}
\\usepackage[margin=1in]{geometry}
\\usepackage{amsmath}

\\title{My Document}
\\author{Author Name}

\\begin{document}
\\maketitle

\\section{Introduction}

This is a LaTeX document with math: $E = mc^2$

\\end{document}
""",
        "main_filename": "main.tex"
    }
)

result = response.json()
if result["success"]:
    pdf_bytes = base64.b64decode(result["pdf_base64"])
    with open("output.pdf", "wb") as f:
        f.write(pdf_bytes)
else:
    print(f"Compilation failed: {result['error']}")
    if result.get("log_output"):
        print(f"Log: {result['log_output']}")

### Multi-File Project (Typst)

import requests
import base64

response = requests.post(
    "https://studio-intrinsic--typetex-compile-app.modal.run/public/compile/typst",
    json={
        "content": """
#import "template.typ": *

#show: project.with(title: "My Report")

= Introduction

#include "chapter1.typ"
""",
        "main_filename": "main.typ",
        "auxiliary_files": {
            "template.typ": """
#let project(title: none, body) = {
  set page(paper: "a4")
  set text(font: "New Computer Modern")

  align(center)[
    #text(size: 24pt, weight: "bold")[#title]
  ]

  body
}
""",
            "chapter1.typ": """
== Chapter 1

This is the first chapter.
"""
        }
    }
)

result = response.json()
if result["success"]:
    pdf_bytes = base64.b64decode(result["pdf_base64"])
    with open("report.pdf", "wb") as f:
        f.write(pdf_bytes)

### Including Images

For binary files like images, base64-encode them:

import requests
import base64

# Read and encode an image
with open("figure.png", "rb") as f:
    image_base64 = base64.b64encode(f.read()).decode("utf-8")

response = requests.post(
    "https://studio-intrinsic--typetex-compile-app.modal.run/public/compile/typst",
    json={
        "content": """
#set page(paper: "a4")

= Document with Image

#figure(
  image("figure.png", width: 80%),
  caption: [A sample figure]
)
""",
        "main_filename": "main.typ",
        "auxiliary_files": {
            "figure.png": image_base64
        }
    }
)

### Using curl

# Typst compilation
curl -X POST https://studio-intrinsic--typetex-compile-app.modal.run/public/compile/typst \\
  -H "Content-Type: application/json" \\
  -d '{
    "content": "#set page(paper: \\"a4\\")\\n\\n= Hello World\\n\\nThis is Typst.",
    "main_filename": "main.typ"
  }' | jq -r '.pdf_base64' | base64 -d > output.pdf

# LaTeX compilation
curl -X POST https://studio-intrinsic--typetex-compile-app.modal.run/public/compile/latex \\
  -H "Content-Type: application/json" \\
  -d '{
    "content": "\\\\documentclass{article}\\n\\\\begin{document}\\nHello World\\n\\\\end{document}",
    "main_filename": "main.tex"
  }' | jq -r '.pdf_base64' | base64 -d > output.pdf

### Typst

Full Typst language support
Multi-file projects with imports
Images (PNG, JPG, SVG)
Custom fonts (New Computer Modern, etc.)
Math equations
Tables and figures
Bibliography (using Hayagriva format)

### LaTeX

Full TeX Live distribution via Tectonic
Multi-file projects (\\input, \\include)
BibTeX/BibLaTeX bibliography
Custom style files (.sty, .cls)
All standard packages (amsmath, graphicx, etc.)
TikZ/PGFPlots graphics
Images (PNG, JPG, PDF, EPS)

### Error Handling

When compilation fails, the response includes:

success: false
error: Human-readable error message
log_output (LaTeX only): Full compilation log for debugging

Common errors:

Syntax errors: Check your source code for typos
Missing files: Ensure all imported/included files are in auxiliary_files
Package not found: Most common packages are available; contact support for additions
Timeout: Complex documents may timeout after 60 seconds

### Rate Limits

No authentication required
Please be respectful of shared resources
For high-volume usage, contact support

### Tips for Agents

Always check success before accessing pdf_base64
Parse errors to provide helpful feedback to users
Use minimal documents when testing - complex documents take longer
Cache results if compiling the same content multiple times
Include all dependencies in auxiliary_files for multi-file projects

### Related Resources

Typst Documentation
LaTeX Wikibook
TypeTex - Full document editor with AI assistance
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: gregm711
- Version: 1.5.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-02T01:11:33.999Z
- Expires at: 2026-05-09T01:11:33.999Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/typetex)
- [Send to Agent page](https://openagent3.xyz/skills/typetex/agent)
- [JSON manifest](https://openagent3.xyz/skills/typetex/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/typetex/agent.md)
- [Download page](https://openagent3.xyz/downloads/typetex)