Will.hou

LaTeX Compiler

開發程式設計v1.0.6
作者:Will.hou更新於 2026-05-11共 7 個版本 · 最新版本釋出於 2026-03-16latex-compiler@clawhub_willamhou/latex-compiler
指令碼工具#PDF

據 AlphaMoat 統計,截至 2026-09,LaTeX Compiler 累計下載 1,963 次、獲 0 個星標,在全部 5,078 個 AI 技能中排名第 4,455 位,在「開發程式設計」分類(577 個)中排名第 533 位。

累計安裝
452
累計下載
1963
星標
-
全站排名
#4,455
全站前 88% · 「開發程式設計」前 93%
平台累計安裝累計下載星標評論
ClawHub ↗321307--
SkillHub ↗4521963-—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

它支援 pdflatex、xelatex、lualatex、起始模板、biber 參考文獻和多輪編譯。PDF 儲存在容器內,可透過 base64 取回預覽。依賴文件所述本地服務;服務不可達時返回錯誤而不回退。執行前應審查容器配置,所描述資料流程不讀取宿主檔案或憑據。

資料釋出於 2026-10-27

可以用來做什麼

  • 編譯提供的 LaTeX 內容並預覽 PDF

什麼時候用

  • 本地編譯服務已可用,需要將 LaTeX 文件輸出為 PDF 時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

檢查可用模板,編譯這份提供的原始碼,返回 PDF 預覽以及錯誤或警告。

月度資料趨勢

累計下載1963
541130520682026-03 · 累計下載 6462026-05 · 累計下載 9892026-06 · 累計下載 11042026-07 · 累計下載 13122026-08 · 累計下載 14782026-09 · 累計下載 196326-0326-09
星標-
0112026-03 · 星標 -2026-05 · 星標 -2026-06 · 星標 -2026-07 · 星標 -2026-08 · 星標 -2026-09 · 星標 -26-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-091963—-
2026-081478+12.7%-
2026-071312+18.8%-
2026-061104+11.6%-
2026-05989—-
2026-03646—-

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

5.1 KB · ClawHub v1.0.6
---
name: latex-compiler
description: Compile LaTeX documents to PDF using pdflatex, xelatex, or lualatex with template support
metadata:
  openclaw:
    emoji: 📝
    tags: [latex, pdf, academic, writing, compilation]
    source: https://github.com/Prismer-AI/Prismer
    homepage: https://github.com/Prismer-AI/Prismer
    requires:
展開全部(共 126 行)
      bins: []
      os: [darwin, linux, win32]
      runtime: node
      services:
        - name: prismer-latex-server
          port: 8080
          description: LaTeX compilation server bundled in the Prismer container
          source: https://github.com/Prismer-AI/Prismer/tree/main/docker/base
---

# latex-compiler

Compile LaTeX documents to PDF. Accepts LaTeX source as content strings and returns compiled PDF via base64 or container-internal path.

## Prerequisites

This skill requires a LaTeX compilation server listening on `localhost:8080`. The Prismer project provides one as part of its container setup.

**Source & review:** The container source is at [github.com/Prismer-AI/Prismer/tree/main/docker/base](https://github.com/Prismer-AI/Prismer/tree/main/docker/base) (Apache-2.0). Before running, review the [Dockerfile](https://github.com/Prismer-AI/Prismer/blob/main/docker/base/Dockerfile) and [docker-compose.dev.yml](https://github.com/Prismer-AI/Prismer/blob/main/docker/docker-compose.dev.yml) to verify:
- No host filesystem volumes are mounted (the dev compose only maps ports)
- The container runs as a non-root user
- Only port 16888 (gateway) is exposed to the host

If the container is not running, all tool calls will fail with a connection error. The skill does not fall back to other local services or retry on different ports.

## Description

This skill sends LaTeX source strings via HTTP POST to `localhost:8080`. It supports pdflatex, xelatex, and lualatex engines, bibliography processing via biber, multi-pass compilation for cross-references, and starter templates.

**Data flow:** The skill sends only LaTeX content strings (from tool parameters) to the container via HTTP. It does not read host files, environment variables, or credentials. Output PDFs are generated inside the container at `/home/user/output/reports/` (container-internal path, not host-mounted). Use `latex_preview` to retrieve PDFs as base64 — no host filesystem mount is involved.

## Usage Examples

- "Compile this LaTeX document to PDF"
- "Preview the PDF output of my paper"
- "What LaTeX templates are available?"
- "Give me the IEEE template"
- "Compile this with xelatex for Chinese support"

## Process

1. **Choose template** — Use `latex_templates` to see available templates, then `latex_get_template` to get starter content
2. **Write LaTeX** — Edit the source document
3. **Compile** — Use `latex_compile` to generate the PDF (saved in container)
4. **Preview** — Use `latex_preview` to get an inline base64 PDF for display

## Tools

### latex_compile

Compile LaTeX source to PDF. The PDF is saved inside the container.

**Parameters:**
- `content` (string, required): Full LaTeX source code
- `filename` (string, optional): Output filename stem (default: `document`)
- `engine` (string, optional): `pdflatex` | `xelatex` | `lualatex` (default: `pdflatex`)
- `bibliography` (string, optional): BibTeX/BibLaTeX content (triggers biber)
- `runs` (number, optional): Compilation passes (default: 2 for cross-references)

**Returns:** `{ success, pdf_path, log, errors, warnings, compile_id }`

**Example:**
```json
{ "content": "\\documentclass{article}\\begin{document}Hello\\end{document}", "engine": "pdflatex" }
```

### latex_preview

Compile LaTeX source and return the PDF as base64 for inline preview.

**Parameters:**
- `content` (string, required): Full LaTeX source code
- `filename` (string, optional): Output filename stem (default: `document`)
- `engine` (string, optional): `pdflatex` | `xelatex` | `lualatex` (default: `pdflatex`)
- `bibliography` (string, optional): BibTeX/BibLaTeX content (triggers biber)

**Returns:** `{ success, pdf_base64, pdf_path, log, errors, warnings, compile_id }`

**Example:**
```json
{ "content": "\\documentclass{article}\\begin{document}Hello\\end{document}" }
```

### latex_templates

List available LaTeX templates and supported engines.

**Parameters:** None

**Returns:** `{ templates: string[], engines: string[] }`

### latex_get_template

Get the LaTeX source of a starter template.

**Parameters:**
- `name` (string, required): Template name — `article`, `article-zh`, `beamer`, `ieee`

**Returns:** `{ name, content }`

**Example:**
```json
{ "name": "ieee" }
```

## Notes

- Chinese documents (`article-zh`) require `xelatex` or `lualatex` engine
- Compilation timeout is 120 seconds per run
- Multi-pass compilation (default 2 runs) resolves cross-references and TOC
- If `bibliography` is provided, biber runs automatically between passes
- PDFs are saved to `/home/user/output/reports/` **inside the container** (not on the host)
- Use `latex_preview` to get PDF as base64 without needing host filesystem access
- No host filesystem mounts are required — all I/O is via HTTP to the container
- If localhost:8080 is unreachable, tools return a connection error (no fallback to other services)

「開發程式設計」分類下的熱門技能

資料月份:2026-09 · 下載/星標/安裝數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。