From b60fcceb5be147e7ec6237935aed8e5879fd1f75 Mon Sep 17 00:00:00 2001 From: cashmere Date: Thu, 26 Feb 2026 10:18:42 +0100 Subject: feat: add LaTeX fragment preview in org-mode via Kitty graphics C-c C-x C-l now renders LaTeX fragments as images in terminal Emacs. Bypasses org's display-graphic-p guard since the latex+dvipng pipeline works fine without a GUI. - Advise org-latex-preview to handle terminal color fallbacks (unspecified-fg -> Black) and suppress clear-image-cache - Advise org--make-preview-overlay to display generated PNGs via kitty-gfx-display-image instead of Emacs image specs - Add kitty-gfx--org-clear-latex-preview for C-u cleanup - Add LaTeX test fragments to test-kitty-gfx.org --- tests/test-kitty-gfx.org | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests/test-kitty-gfx.org') diff --git a/tests/test-kitty-gfx.org b/tests/test-kitty-gfx.org index 4b34193..5d746ea 100644 --- a/tests/test-kitty-gfx.org +++ b/tests/test-kitty-gfx.org @@ -27,4 +27,16 @@ Line 10 [[./test-image.png]] +* LaTeX fragment preview test + +Inline math: $E = mc^2$ + +Display math: + +\begin{equation} +\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2} +\end{equation} + +Another inline: $\sum_{i=1}^{n} i = \frac{n(n+1)}{2}$ + End of test file. -- cgit v1.3.1