diff options
| author | cashmere <cashmere@autistici.org> | 2026-04-26 20:36:04 +0200 |
|---|---|---|
| committer | cashmere <cashmere@autistici.org> | 2026-04-26 20:36:04 +0200 |
| commit | baa6cf8cc43ce676b806db01e390668dc4aa6790 (patch) | |
| tree | 103e8d459f7f3a79dd7985f9b36f8ff263a672ad /AGENTS.md | |
| parent | 7e4faffa32d6f0ef885fceb0a9ecd93b3fe5c43f (diff) | |
| download | kitty-graphics-baa6cf8cc43ce676b806db01e390668dc4aa6790.tar.gz | |
feat: add typst inline equation preview
Mirrors the existing LaTeX fragment integration but uses the `typst`
CLI to compile `$...$' math fragments into PNGs that are then displayed
inline through the existing kitty-graphics overlay pipeline.
- New section in kitty-graphics.el: customs (typst-command, ppi,
text-size, preamble), SHA-1 cached PNGs under /tmp/kitty-gfx-typst,
Emacs face-foreground -> typst rgb() hex conversion.
- Two autoloaded commands: `kitty-gfx-typst-preview' and
`kitty-gfx-typst-clear-preview', region-aware.
- Regex skips backslash-escaped dollars (\\$not math\\$).
- justfile with recipes: compile/lint/load + per-feature test-* and
headless typst-render / typst-show.
- tests/test-typst.typ fixture with inline, display, mixed and
edge-case fragments.
- AGENTS.md updated: test instructions, dependency note, issue marked
done.
Closes #7. Parent #5.
Diffstat (limited to 'AGENTS.md')
| -rw-r--r-- | AGENTS.md | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -48,6 +48,16 @@ TERM=xterm-256color emacs -nw -Q -l kitty-graphics.el \ # Then: C-c C-x C-v (org-toggle-inline-images) ``` +### Test typst inline equations + +```sh +TERM=xterm-256color emacs -nw -Q -l kitty-graphics.el \ + --eval "(kitty-graphics-mode 1)" tests/test-typst.typ +# Then: M-x kitty-gfx-typst-preview +# To clear: M-x kitty-gfx-typst-clear-preview +# Requires the `typst` CLI on PATH. +``` + ### Test text sizing (org heading scales) ```sh @@ -241,6 +251,10 @@ Key design differences from images: - **Limitation**: Sixel is 256 colors (vs truecolor on Kitty), stateless (re-emits on scroll) - **Done**: LaTeX fragment preview in org-mode (#3) - **Done**: doc-view / pdf-view-mode integration (#4) +- **Done**: Typst inline equation preview (#5) -- `kitty-gfx-typst-preview` + scans `$...$' fragments in the current buffer or region, compiles each + via the `typst' CLI, and displays the resulting PNG inline. No advice + hooks; bind to a key or invoke via `M-x'. - **Done**: Text sizing protocol for org heading sizes (OSC 66, Kitty >= 0.40.0) - **Done**: Sixel backend with auto-detection (v0.3.0) - **WIP**: Sixel image misplacement in org-mode (reported in foot terminal) @@ -253,6 +267,8 @@ Key design differences from images: for Kitty backend; foot/Konsole/xterm/mlterm/mintty for Sixel) - **Required for Sixel**: ImageMagick (`magick`/`convert`) for encoding - **Optional for Kitty**: ImageMagick for non-PNG formats and pixel-accurate sizing +- **Optional for typst preview**: `typst` CLI on PATH (used by + `kitty-gfx-typst-preview`) - **No external Elisp deps** beyond built-in `cl-lib` ## Versioning |
