typetexCompile Typst and LaTeX documents to PDF via API. Send source code, get back a PDF.
Install via ClawdBot CLI:
clawdbot install gregm711/typetexCompile Typst (.typ) and LaTeX (.tex) documents to PDF using the TypeTex compilation API.
Base URL: https://studio-intrinsic--typetex-compile-app.modal.run
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"
}
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..."
}
GET /public/compile/health
Returns {"status": "ok", "service": "public-compile"} if the service is running.
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']}")
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']}")
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)
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
}
}
)
# 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
When compilation fails, the response includes:
success: falseerror: Human-readable error messagelog_output (LaTeX only): Full compilation log for debuggingCommon errors:
auxiliary_filessuccess before accessing pdf_base64auxiliary_files for multi-file projectsGenerated Mar 1, 2026
Researchers and students can compile LaTeX or Typst documents into PDFs for academic papers, theses, and reports. This skill automates the compilation process, handling complex formatting, bibliographies, and multi-file projects without local setup, ideal for collaborative writing in cloud environments.
Software developers and technical writers can use this skill to generate PDF documentation from Typst or LaTeX source code. It supports code snippets, diagrams via TikZ, and multi-file imports, streamlining the creation of user manuals, API docs, and internal reports in CI/CD pipelines.
Business analysts and consultants can compile financial reports, presentations, and proposals into polished PDFs. The skill handles tables, charts, and custom fonts, enabling quick updates and version control for documents shared across teams or with clients.
Publishers and authors can compile books, articles, and newsletters into PDF format for print or digital distribution. It supports advanced typography, image embedding, and multi-chapter projects, reducing reliance on desktop publishing software and facilitating remote collaboration.
Educators and trainers can create worksheets, exams, and course materials in Typst or LaTeX, compiling them to PDFs for distribution. The skill manages math equations, diagrams, and multi-file resources, making it easy to produce consistent, high-quality materials for online or in-person classes.
Offer the compilation service via a paid API with tiered pricing based on usage volume (e.g., requests per month). This model targets developers and businesses needing reliable PDF generation without infrastructure management, with potential upsells for premium support or custom features.
Provide a free tier for basic compilation with limited requests, and premium plans for higher limits, advanced features like custom fonts, and priority processing. This attracts individual users and small teams, converting them to paid plans as their needs grow.
Partner with cloud platforms, document management systems, or educational tools to embed the compilation service. Revenue comes from licensing fees or revenue sharing, leveraging existing user bases in industries like edtech, SaaS, and content management.
๐ฌ Integration Tip
Use the provided Python examples or curl commands to integrate the API into applications; ensure to handle base64 encoding for PDF outputs and error responses for robust implementation.
Edit PDFs with natural-language instructions using the nano-pdf CLI.
Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.
Convert documents and files to Markdown using markitdown. Use when converting PDF, Word (.docx), PowerPoint (.pptx), Excel (.xlsx, .xls), HTML, CSV, JSON, XML, images (with EXIF/OCR), audio (with transcription), ZIP archives, YouTube URLs, or EPubs to Markdown format for LLM processing or text analysis.
็จ MinerU API ่งฃๆ PDF/Word/PPT/ๅพ็ไธบ Markdown๏ผๆฏๆๅ ฌๅผใ่กจๆ ผใOCRใ้็จไบ่ฎบๆ่งฃๆใๆๆกฃๆๅใ
Generate hand-drawn style diagrams, flowcharts, and architecture diagrams as PNG images from Excalidraw JSON
The awesome PPT format generation tool provided by baidu.