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 = { sydnix.users.msyds.emacs = {
jinx.enable = true; jinx.enable = true;
tufte-latex.enable = true; tufte-latex.enable = true;
plex-latex.enable = true;
}; };
sydnix.emacs = { sydnix.emacs = {

View File

@@ -5,7 +5,7 @@
"Default fixed-pitch (monospace) font.") "Default fixed-pitch (monospace) font.")
(defvar syd-variable-pitch-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.") "Default variable-pitch font.")
(defvar syd-alt-fixed-pitch-font (defvar syd-alt-fixed-pitch-font

View File

@@ -15,7 +15,8 @@
(org-latex-preview 'buffer)) (org-latex-preview 'buffer))
(use-package org (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 :general (:keymaps 'org-mode-map
:states '(normal visual motion emacs insert) :states '(normal visual motion emacs insert)
:major-modes t :major-modes t
@@ -38,32 +39,11 @@
(org-latex-preview-live-debounce 0.25) (org-latex-preview-live-debounce 0.25)
;; Increase size of previews. ;; Increase size of previews.
(org-latex-preview-appearance-options (org-latex-preview-appearance-options
(plist-put org-latex-preview-appearance-options :zoom 1.2))) (plist-put org-latex-preview-appearance-options :zoom 1.0))
:hook (org-mode . org-latex-preview-mode) (org-latex-preview-process-precompile
:config ;; Not suported by XeLaTeX or LuaLaTeX }:(.
(add-to-list (eq org-latex-compiler "pdflatex")))
'org-latex-preview-process-alist :hook (org-mode . org-latex-preview-mode))
`(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")))))
(use-package org-contrib) (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
;
};
};
}

View File

@@ -19,8 +19,6 @@
home.file.".ssh/id_ed25519.pub".source = home.file.".ssh/id_ed25519.pub".source =
../../public-keys/ssh/crumb-at-nixos-testbed.pub; ../../public-keys/ssh/crumb-at-nixos-testbed.pub;
home.packages = [];
fonts.fontconfig.enable = true; fonts.fontconfig.enable = true;
sydnix = { sydnix = {