Skip to content

An instant latex previewer for Emacs, based on xwidget and child-frame

Notifications You must be signed in to change notification settings

fuxialexander/emacs-webkit-katex-render

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 

Repository files navigation

webkit-katex-render: an instant Latex Previewer for Emacs

Demo

./demo.png

Please checkout the demo video.

Preparation

You need emacs compiled with xwidget support.

If you are on mac OS, you can use brew to install it.

brew tap d12frosted/homebrew-emacs-plus
brew install emacs-plus --HEAD --with-xwidgets

On Linux, you can build Emacs from git Repository.

git clone --depth 1 --branch emacs-27 https://github.com/emacs-mirror/emacs.git
cd emacs
./autogen.sh
./configure --with-modules --with-xwidgets
make -j4
sudo make install

Install

  • use-package
(use-package webkit-katex-render
  :init
  ;; if you use doom-emacs
  (setq webkit-katex-render--background-color (doom-color 'bg))
  ;; if you want to set a different path to the html client
  (setq webkit-katex-render--client-path "PATH/TO/CLIENT.html")
  ;; if you want to add your customized ~math-at-point~ function
  (setq webkit-katex-render--math-at-point-function 'function))
  • My config for doom-emacs
(def-package! webkit-katex-render :load-path "~/Source/playground/emacs-webkit-katex-render"
  :commands (webkit-katex-render-mode)
  :config
  (setq webkit-katex-render--background-color (doom-color 'bg)))

Usage

  • M-x webkit-katex-render-mode to start the minor mode
  • Move your cursor to a latex fragment (in either org mode or latex-mode)
  • Try look around and type equations!

Plans

See issue board.

About

An instant latex previewer for Emacs, based on xwidget and child-frame

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published