TeX \mathXY folding, account for deceptive codepts
This commit is contained in:
parent
3f5e109a37
commit
8c8d40dafd
45
config.org
45
config.org
|
@ -6478,7 +6478,50 @@ Let's enhance ~TeX-fold-math~ a bit
|
|||
(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)))
|
||||
(mapcar (lambda (c)
|
||||
(string-offset-apply-roman-char-exceptions
|
||||
(+ (if (>= c 97) (- c 6) c) offset)))
|
||||
word)))
|
||||
|
||||
(defvar string-offset-roman-char-exceptions
|
||||
'(;; lowercase serif
|
||||
(119892 . 8462) ; ℎ
|
||||
;; lowercase caligraphic
|
||||
(119994 . 8495) ; ℯ
|
||||
(119996 . 8458) ; ℊ
|
||||
(120004 . 8500) ; ℴ
|
||||
;; caligraphic
|
||||
(119965 . 8492) ; ℬ
|
||||
(119968 . 8496) ; ℰ
|
||||
(119969 . 8497) ; ℱ
|
||||
(119971 . 8459) ; ℋ
|
||||
(119972 . 8464) ; ℐ
|
||||
(119975 . 8466) ; ℒ
|
||||
(119976 . 8499) ; ℳ
|
||||
(119981 . 8475) ; ℛ
|
||||
;; fraktur
|
||||
(120070 . 8493) ; ℭ
|
||||
(120075 . 8460) ; ℌ
|
||||
(120076 . 8465) ; ℑ
|
||||
(120085 . 8476) ; ℜ
|
||||
(120092 . 8488) ; ℨ
|
||||
;; blackboard
|
||||
(120122 . 8450) ; ℂ
|
||||
(120127 . 8461) ; ℍ
|
||||
(120133 . 8469) ; ℕ
|
||||
(120135 . 8473) ; ℙ
|
||||
(120136 . 8474) ; ℚ
|
||||
(120137 . 8477) ; ℝ
|
||||
(120145 . 8484) ; ℤ
|
||||
)
|
||||
"An alist of deceptive codepoints, and then where the glyph actually resides.")
|
||||
|
||||
(defun string-offset-apply-roman-char-exceptions (char)
|
||||
"Sometimes the codepoint doesn't contain the char you expect.
|
||||
Such special cases should be remapped to another value, as given in `string-offset-roman-char-exceptions'."
|
||||
(if (assoc char string-offset-roman-char-exceptions)
|
||||
(cdr (assoc char string-offset-roman-char-exceptions))
|
||||
char))
|
||||
|
||||
(defun TeX-fold-parenthesize-as-neccesary (tokens &optional suppress-left suppress-right)
|
||||
"Add ❪ ❫ parenthesis as if multiple LaTeX tokens appear to be present"
|
||||
|
|
Loading…
Reference in New Issue