diff --git a/config.org b/config.org index 7043c00..36925b4 100644 --- a/config.org +++ b/config.org @@ -1824,7 +1824,7 @@ Let's enhance ~TeX-fold-math~ a bit ("𝑑" ("dd")) ;; known commands ("" ("phantom")) - ("({1}β§Έ{2})" ("frac")) + ("βͺ{1}/{2}❫" ("frac")) ("β€˜{1}’" ("text")) ;; private commands ("|{1}|" ("abs")) @@ -1833,8 +1833,16 @@ Let's enhance ~TeX-fold-math~ a bit ("⌈{1}βŒ‰" ("ceil")) ("⌊{1}βŒ‰" ("round")) ("β­‘{1}" ("vec")) - ("𝑑{1}⧸𝑑{2}" ("dv")) - ("βˆ‚{1}β§Έβˆ‚{2}" ("pdv")) + ("𝑑{1}/𝑑{2}" ("dv")) + ("βˆ‚{1}/βˆ‚{2}" ("pdv")) + ;; fancification + ("{1}" ("mathrm")) + (TeX-fold-apply-mathbf ("mathbf")) + (TeX-fold-apply-mathcal ("mathcal")) + (TeX-fold-apply-mathfrak ("mathfrak")) + (TeX-fold-apply-mathbb ("mathbb")) + (TeX-fold-apply-mathsf ("mathsf")) + (TeX-fold-apply-mathtt ("mathtt")) ) TeX-fold-macro-spec-list '( @@ -1863,6 +1871,29 @@ Let's enhance ~TeX-fold-math~ a bit ("⬖ {1}" ("begin")) ("⬗ {1}" ("end")) )) + +(defun TeX-fold-apply-mathbf (word) + (string-offset-roman-chars 119743 word)) + +(defun TeX-fold-apply-mathcal (word) + (string-offset-roman-chars 119951 word)) + +(defun TeX-fold-apply-mathfrak (word) + (string-offset-roman-chars 120003 word)) + +(defun TeX-fold-apply-mathbb (word) + (string-offset-roman-chars 120055 word)) + +(defun TeX-fold-apply-mathsf (word) + (string-offset-roman-chars 120159 word)) + +(defun TeX-fold-apply-mathtt (word) + (string-offset-roman-chars 120367 word)) + +(defun string-offset-roman-chars (offset word) + "Shift the codepoint of each charachter in WORD by OFFSET with an extra -6 shift if the letter is lowercase" + (apply 'string + (mapcar (lambda (c) (+ (if (>= c 97) (- c 6) c) offset)) word))) #+END_SRC Let's just make the folding a little less manual