feat(emacs): xetex and plex

This commit is contained in:
2025-11-11 00:40:32 -07:00
parent 8b4b60067a
commit 9a49230095
5 changed files with 29 additions and 30 deletions

View File

@@ -25,6 +25,7 @@ in {
sydnix.users.msyds.emacs = {
jinx.enable = true;
tufte-latex.enable = true;
plex-latex.enable = true;
};
sydnix.emacs = {

View File

@@ -5,7 +5,7 @@
"Default fixed-pitch (monospace) font.")
(defvar syd-variable-pitch-font
(font-spec :family "IBM Plex Serif" :size 15)
(font-spec :family "IBM Plex Serif" :size 17)
"Default variable-pitch font.")
(defvar syd-alt-fixed-pitch-font

View File

@@ -15,7 +15,8 @@
(org-latex-preview 'buffer))
(use-package org
:custom (org-startup-with-latex-preview t)
:custom ((org-startup-with-latex-preview t)
(org-latex-compile "xelatex"))
:general (:keymaps 'org-mode-map
:states '(normal visual motion emacs insert)
:major-modes t
@@ -38,32 +39,11 @@
(org-latex-preview-live-debounce 0.25)
;; Increase size of previews.
(org-latex-preview-appearance-options
(plist-put org-latex-preview-appearance-options :zoom 1.2)))
:hook (org-mode . org-latex-preview-mode)
:config
(add-to-list
'org-latex-preview-process-alist
`(dvisvgm
:programs ("latex" "dvisvgm") :description "dvi > svg" :message
"you need to install the programs: latex and dvisvgm."
:image-input-type "dvi" :image-output-type "svg" :latex-compiler
("%l -interaction nonstopmode -output-directory %o %f")
:latex-precompiler
("%l -output-directory %o -ini -jobname=%b \"&%L\" mylatexformat.ltx %f")
:image-converter
(,(syd-str
" "
"dvisvgm"
"--page=1-"
"--optimize"
"--clipjoin"
"--relative"
"--no-fonts"
"-v3"
"--message='processing page {?pageno}: output written to {?svgpath}'"
"--bbox=min"
"-o %B-%%9p.svg"
"%f")))))
(plist-put org-latex-preview-appearance-options :zoom 1.0))
(org-latex-preview-process-precompile
;; Not suported by XeLaTeX or LuaLaTeX }:(.
(eq org-latex-compiler "pdflatex")))
:hook (org-mode . org-latex-preview-mode))
(use-package org-contrib)

View File

@@ -0,0 +1,20 @@
{ config, lib, pkgs, ... }:
let cfg = config.sydnix.users.msyds.emacs.plex-latex;
in {
options.sydnix.users.msyds.emacs.plex-latex = {
enable = lib.mkEnableOption "the IBM Plex font within Org-mode LaTeX";
};
config = lib.mkIf cfg.enable {
sydnix.emacs.tex.extraTexPackages = {
inherit (pkgs.texlive)
plex
plex-otf
fontaxes
unicode-math
xetex
;
};
};
}