An AI-facing LaTeX editor engine: work on the PDF, not the .tex.
latex what the source says LaTeX sections, labels, includes
pdftext what the page says every glyph of every page, with its place
synctex where the page comes from the source of a place on the page
diff what is different word differences, moved passages
compare the two together the areas of the page that changed
git the work, kept apart worktrees and snapshots
build the typeset result latexmk, reproducibly
task one round of one task the edits of the agent and where they belong
journal what the author decided the append only record of the decisions
server the interface HTTP, on 127.0.0.1agent: edit the worktree ─▶ publish ─▶ the changes appear on the page
│
author: accept · reject · commentmoon build --target native
./_build/native/debug/build/cmd/main/main.exe --helpUsage: papilot [command]
An AI facing LaTeX editor: work on the PDF, not the .tex.
Commands:
serve Run the review engine for a repository.
publish Publish a round of a task and show what changed.
compare Compare two PDFs and report what changed.
synctex Show where a point of the page comes from.
source Show the structure of a LaTeX document.$ papilot source sections/01-introduction.tex
4 sections
level 2: Introduction
level 3: Three commitments
level 3: What this paper does
level 3: A note on this document$ papilot publish --repo /path/to/paper --task my-task
{
"round": 1,
"changes": [
{
"page": 1,
"rect": { "x": 92.01, "y": 683.3, "width": 60.69, "height": 13.87 },
"old_text": "{Hi}hello",
"new_text": "{Hello}the second line",
"edit": 0,
"source": { "file": ".../main.tex", "line": 2 }
}
]
}$ moon build --target native
$ sh examples/demo.sh
== round 1: nothing has changed ==
{ "round": 1, "changes": [] }
== the agent changes a line in the worktree ==
== round 2: the change appears on the page ==
{
"round": 2,
"changes": [
{
"page": 1,
"rect": { "x": 127.36, "y": 683.3, "width": 17.34, "height": 13.87 },
"old_text": "brown",
"new_text": "red",
"edit": 0,
"source": { "file": ".../main.tex", "line": 2 }
}
]
}$ papilot synctex --file main.synctex.gz --page 1 --x 300 --y 400
main.tex:31$ papilot serve --repo /path/to/paper --port 8765| Endpoint | What it does |
|---|---|
| GET /health | Is the engine alive? |
| GET /tasks | The tasks that exist. |
| POST /tasks | Create a task. |
| GET /tasks/:id | The task and its last round. |
| POST /tasks/:id/publish | Compile both versions and report the changes. |
| GET /tasks/:id/changes | The changes of the last round. |
| POST /tasks/:id/decisions | Accept, reject or comment on a change. |
| POST /tasks/:id/undo | Take a decision back. |
http://localhost:8765/ → the index of the endpoints
http://localhost:8765/tasks/t1/view → the review page of the task
http://localhost:8765/tasks/t1/page/1/after.svg → one page, as vectors// The page says something different than before.
///|
let changes = @compare.compare(before, after)
// The change is at a place on the page.
///|
let change = changes[0]
// The place on the page has a source.
///|
let located = @compare.locate(page, synctex, change.page, change.rect)@journal.Entry::Decided(task, round, 0, @journal.Decision::Accepted)Install
Download zipAn AI-facing LaTeX editor engine: work on the PDF, not the .tex.