latex-mindmap
/latex-mindmap
Zamienia notatki LaTeX, podręcznik lub pracę dyplomową w jeden plik HTML z mapą myśli: definicje, twierdzenia i dowody jako powiązane węzły.
- Autor
- AlphaShk ↗
- Repozytorium
- math-notes-agent-skills ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 08.11.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 14
- Skrypty
- 8
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 08.11.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
- 8 skryptów w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.
Skrypty: scripts/audit.js, scripts/build.js, scripts/engine.js, scripts/flatten.py, scripts/inventory.py, scripts/layout.js, scripts/merge.js, scripts/tex.js
Co robi i kiedy
Zamienia notatki LaTeX, podręcznik lub pracę dyplomową w jeden plik HTML z mapą myśli: definicje, twierdzenia i dowody jako powiązane węzły.
Oryginalny opis (EN)
Turn LaTeX lecture notes, a textbook, or a thesis into a single self-contained HTML mind map — every definition, theorem, lemma, proposition, corollary, remark, example and exercise as a bubble in a dependency tree, with statements, proofs and a searchable cheat sheet built in. Use this whenever someone wants to study, revise, or navigate mathematical or technical notes: asks for a mind map, concept map, dependency graph, knowledge graph, revision aid, cheat sheet, study guide or exam prep from a .tex file; wants to see how theorems depend on each other or what a proof rests on; or points at l
Jak działa
- Why the work is split the way it is
- Workflow
- Choices already made, and why
- Files
- If the source isn't LaTeX
Podgląd SKILL.md
---
name: latex-mindmap
description: "Turn LaTeX lecture notes, a textbook, or a thesis into a single self-contained HTML mind map — every definition, theorem, lemma, proposition, corollary, remark, example and exercise as a bubble in a dependency tree, with statements, proofs and a searchable cheat sheet built in. Use this whenever someone wants to study, revise, or navigate mathematical or technical notes: asks for a mind map, concept map, dependency graph, knowledge graph, revision aid, cheat sheet, study guide or exam prep from a .tex file; wants to see how theorems depend on each other or what a proof rests on; or points at lecture notes and asks to make them easier to learn from. Also use it when they have a PDF of notes and the LaTeX source alongside it."
license: MIT
compatibility: "Python 3.9+ and Node.js 20.19+, 22.13+ or 24+ (the range jsdom 29 supports); the build needs the two npm packages pinned in package.json (mathjax-full, jsdom)."
---
# Mind maps from LaTeX notes
Build one HTML file that holds an entire course: a clickable dependency tree of
every numbered result, plus the full statement and proof of each one. It works
offline — maths is pre-rendered to SVG at build time, so there is no MathJax,
no CDN, nothing to load.
The output has two halves. On the left, chapters as bubbles; open one and its
results appear as a tree with arrows running downward from a result to the ones
whose proofs use it. On the right, a reading pane that fills as you hover.
Below, `$SKILL` is the directory that contains this file. Every script path is
relative to it; working files (`inv.json`, `extract/`, the output) go wherever
the user wants them, normally next to their notes.
## Why the work is split the way it is
Two very different kinds of work are involved, and conflating them is the main
way this goes wrong:
**Mechanical** — finding the items, working out their numbers, laying out the
tree, rendering the maths, assembling the HTML. Fully scripted here. Don't
re-implement any of it; the scripts already handle the fiddly parts (numbering
schemes, crossing reduction, offline font embedding).
**Editorial** — reading the notes and writing, for each result, an exact
statement, a board-ready proof outline, and the *reasons* one result depends on
another. This needs a model that has actually read the section. It is the slow,
expensive part and the part that determines whether the map is worth anything.
So: run the scripts, spend the effort on extraction, then run the scripts again.
## Workflow
### 0. Install the build dependencies — once
```bash
npm ci --prefix "$SKILL" # mathjax-full and jsdom, exact versions from package-lock.json
```
If the skill directory is read-only, copy `package.json` and
`package-lock.json` to a writable directory, run `npm ci` there, and prefix the
`node` commands below with `NODE_PATH=<that directory>/node_modules`.
### 1. Inventory first — always
If the notes are split across files with `\input`/`\include`, flatten them
first; ids and line ranges refer to one file:
```bash
python3 "$SKILL/scripts/flatten.py" main.tex -o notes.tex --skip titlepage references
```
Then:
```bash
python3 "$SKILL/scripts/inventory.py" NOTES.tex --preamble MAIN.tex --json inv.json
```
`--preamble` points at whichever file declares the theorem environments and
macros — often the main document that `\input`s the content. Getting this right
matters twice over: it is where both the numbering scheme and the custom macros
come from, and `inv.json` carries them forward to the renderer. A flattened
file contains its own preamble, so `--preamble` can be dropped.
Add `--sections 1-3` to restrict everything to part of the document. Use this
for a trial run before committing to a whole course — the user usually wants to
see one chapter before paying for twenty.
Two things to check in the output before going further:
*The printed "first five" against the actual PDF.* If the numbers don't match,
everything downstream inherits the error, and a study aid with wrong numbers is
worse than none.
*The macro count.* Notes normally define dozens. If it says zero, `--preamble` is
pointing at the wrong file and every custom command in the notes will fail to
render later.
### 2. Tell the user the size, then agree the chapters
Extraction costs roughly one agent per chapter, and each agent reads a slab of
LaTeX and writes a few thousand words. Report the item count and the proposed
split before spending that. For scale: one full course, about 170 results in 7
chapters, took 7 agents and produced a map of about 10 MB.
Group the notes' sections into chapters — 5 to 9 for a whole course, since
twenty chapters of eight items makes a cluttered top level. For a scoped run of
two or three sections, or a short document such as a thesis, one chapter per
section is fine. Write `chapters.json`:
```json
[
{"id":"basics","name":"Measure & integration","sub":"one line on what lives here","file":"basics.json","lines":[1,780]},
{"id":"clt","name":"Limit theorems","sub":"…","file":"clt.json","lines":[781,1600]}
]
```
`id` must be a short slug; `lines` is the range each extraction agent reads.
Colours are assigned automatically.
Tell the agents to use the notes' own macros and nothing else. `build.js` refuses
to produce a map containing a formula it could not render, and an invented macro
is the usual cause.
### 3. Extract, one agent per chapter, in parallel
Give each agent `references/extraction-prompt.md` filled in for its chapter.
Launch them in a single message so they run concurrently. Each writes
`extract/<id>.json`. Insist they write the file with a script rather than
hand-typing JSON — LaTeX backslashes and hand-written JSON do not mix.
The single most valuable thing an agent produces is the **edge reasons**: not
just that Girsanov depends on the product rule, but *why* — "the drift terms
cancel in d(MZ)". That is what makes the map teach something rather than just
look impressive.
### 4. Merge and validate
```bash
node "$SKILL/scripts/merge.js" --inventory inv.json --chapters chapters.json \
--in extract/ --out graph.json
```
This refuses to continue on: items in the notes with no entry, entries that
aren't in the notes, duplicate ids, dangling edges, dependency cycles,
unbalanced `$`/braces/`\left`-`\right`, a bare `<` in the text, or a map label
over 24 characters. The `$` and `<` checks matter because those mistakes don't
crash anything — they silently corrupt a statement. Fix what it reports and
re-run.
For a scoped run, generate `inv.json` with the same `--sections` filter you gave
the agents, so the 1:1 check compares against the slice you actually extracted.
`--allow-extra` permits entries that aren't numbered environments, such as an
important passage of running prose. An edge without a written `why` is refused;
write the reason rather than reaching for `--allow-missing-why`.
### 5. Build
```bash
node "$SKILL/scripts/build.js" --graph graph.json --out mindmap.html --title "Course name"
```
Paths are yours to choose; the script locates its own `style.css` and `engine.js`.
Budget several minutes for a full course — every formula is rendered to SVG
once and the glyphs deduplicated. Size grows with the number of distinct
formulas: the 18-result demo map in this repository is 0.39 MB, and the full
course above came out at about 10 MB. That is the price of needing no network,
and it opens instantly from disk.
If it stops with **MATHS DID NOT RENDER**, it has listed the undefined macros.
Either `--preamble` missed the file defining them, or the extraction invented
them. As a last resort, `--macros extra.json` supplies them by hand:
`{"EE":"\\mathbb{E}"}`. Don't reach for `--force` — it ships a map with visibly
broken formulas.
### 6. Check it
```bash
node "$SKILL/scripts/audit.js" mindmap.html
```
Verifies it loads clean, has no external references, has a bubble for every
result, every glyph resolves, and that opening a chapter, hovering, clicking,
searching, the reading view and resetting all work.
The audit can't see layout. Two things to eyeball, because they have bitten
before: text that is too small at the default zoom (the map fits the whole
canvas, so a large course renders tiny), and anything that looks half-visible
rather than hidden.
## Choices already made, and why
Worth knowing before you change them:
**Everything is pre-rendered and inlined.** A CDN link is one line instead of a
build step, but it breaks the moment the user is offline or behind a filter, and
it fails silently — a page of raw `$\sigma$`. Inline SVG always works.
**Cards are injected on demand.** A full course is ~6000 formulas; putting them
all in the DOM at load makes the page crawl. Only the visible card exists.
**Cross-chapter arrows are hidden** unless you click a result, in which case you
see its own. They were roughly a third of all edges and made the map unreadable.
**Layers come from dependency depth, not reading order.** A result sits below
everything its proof needs. Notes order breaks ties, so it still reads roughly
top-left to bottom-right, but a later-numbered result can appear higher.
**Proof provenance is labelled.** Where the notes give no proof and one was
reconstructed, the card says so in a different colour — for the full proof and
for the board outline of a theorem-like result. Silently inventing proofs in a
study aid is how someone learns a wrong argument.
**Rendering failures are fatal, not cosmetic.** MathJax will happily draw an
undefined macro as red text. That is the worst outcome for a build tool — the map
looks finished and is wrong — so the strictness is deliberate.
## Files
| File | Role |
|---|---|
| `scripts/flatten.py` | Inlines `\input`/`\include` into one file. Only for split documents. |
| `scripts/inventory.py` | Finds every item, its real number, and the preamble's macros. Run first. |
| `scripts/merge.js` | Merges extractions, validates hard, writes `graph.json`. |
| `scripts/build.js` | Assembles the HTML. |
| `scripts/tex.js` | LaTeX → inline SVG, with a shared glyph cache. |
| `scripts/layout.js` | Layered tree layout, crossing reduction, chapter packing. |
| `scripts/engine.js` | Runtime behaviour of the page. Copied in verbatim. |
| `scripts/style.css` | Styling. Copied in verbatim. |
| `scripts/audit.js` | Headless smoke test. |
| `package.json`, `package-lock.json` | The two npm dependencies, pinned. |
| `references/extraction-prompt.md` | Template for the extraction agents. |
| `references/schema.md` | Node and edge fields. |
## If the source isn't LaTeX
The pipeline needs `graph.json`; nothing below step 4 cares where it came from.
For Markdown or a PDF-only source, produce the same node and edge shape by hand
(see `references/schema.md`) and start at step 4. Expect a weaker graph —
without theorem environments there is no reliable numbering and dependencies
have to be inferred from prose.
Pliki w paczce (14)
- SKILL.md 11 KB
- package-lock.json 21 KB
- package.json 1 KB
- references/extraction-prompt.md 4 KB
- references/schema.md 2 KB
- scripts/audit.js 4 KB
- scripts/build.js 15 KB
- scripts/engine.js 21 KB
- scripts/flatten.py 4 KB
- scripts/inventory.py 13 KB
- scripts/layout.js 8 KB
- scripts/merge.js 6 KB
- scripts/style.css 12 KB
- scripts/tex.js 3 KB
Wersje
W bazie nie ma innych skilli o nazwie latex-mindmap.
Migawka bazy z 13.11.2026 · wersja paczki 233018d64af6 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100handwritten-notes-to-latex
Zamienia odręczne notatki z wykładu w PDF na złożony dokument LaTeX zgodny z oryginałem: numeracja, tytuły, twierdzenia i dowody. - 100audit-proof
Dokładnie sprawdza pojedynczy dowód twierdzenia, lematu lub wniosku: luki logiczne, spójność założeń, przypadki brzegowe, poprawność zależności i zakres kwantyfikatorów. - 100study-atlas
Buduje interaktywną aplikację do nauki działającą offline w jednym pliku HTML: mapę myśli, fiszki, testy na czas i ściągę. - 100aris-proof-writer
Pisze rygorystyczne dowody matematyczne dla teorii ML i AI: twierdzenia, lematy, propozycje i wnioski. - 100theorem-proving
Konstruuje i weryfikuje dowody matematyczne w LaTeX z weryfikacją obliczeniową przez jupyter_execute, przy dowodzeniu twierdzeń i sprawdzaniu poprawności argumentów. - 100proof-writer
Pisze rygorystyczne dowody matematyczne dla teorii ML i AI: twierdzeń, lematów i wniosków oraz sprawdza, czy dowód da się domknąć.