Compile Typst and LaTeX documents to PDF via API. Send source code, get back a PDF.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install typetex或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install typetex⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/typetex/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: Typst & LaTeX Compiler description: Compile Typst and LaTeX documents to PDF via API. Send source code, get back a PDF. metadata: clawdbot: config: requiredEnv: [] stateDirs: [] ---
Compile 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 projects安装 Compile LaTex & Typst into PDF with TypeTex 后,可以对 AI 说这些话来触发它
Help me get started with Compile LaTex & Typst into PDF with TypeTex
Explains what Compile LaTex & Typst into PDF with TypeTex does, walks through the setup, and runs a quick demo based on your current project
Use Compile LaTex & Typst into PDF with TypeTex to compile Typst and LaTeX documents to PDF via API
Invokes Compile LaTex & Typst into PDF with TypeTex with the right parameters and returns the result directly in the conversation
What can I do with Compile LaTex & Typst into PDF with TypeTex in my developer & devops workflow?
将技能文件夹放到 ~/.claude/skills/typetex/ 目录(个人级,所有项目可用),或 .claude/skills/typetex/(项目级)。重启 AI 客户端后,用 /typetex 主动调用,或让 AI 根据上下文自动发现并使用。
Compile LaTex & Typst into PDF with TypeTex 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Compile LaTex & Typst into PDF with TypeTex 可免费安装使用。请查阅仓库了解许可证信息。
Compile Typst and LaTeX documents to PDF via API. Send source code, get back a PDF.
Lists the top use cases for Compile LaTex & Typst into PDF with TypeTex, with example commands for each scenario
Automate my developer & devops tasks using Compile LaTex & Typst into PDF with TypeTex
Identifies repetitive steps in your workflow and sets up Compile LaTex & Typst into PDF with TypeTex to handle them automatically
Compile LaTex & Typst into PDF with TypeTex 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。