3

I use emacs with auctex to run lualatex. Is there a way to modify the math input of auctex, e.g. modify LaTeX-math-zeta, bound to the keystroke <`z>, so the unicode character ζ instead of \zeta is written?

I thought of redefining the function LaTeX-math-insert, but could not figure out how this could be done.

  • mistake, my error... – Zoltán Jan 15 '16 at 13:29
  • one dumb way to do it, is to redefine the LaTeX-math-... commands in .emacs: (defun LaTeX-math-zeta () "Insert ζ" (interactive) (insert "ζ" )) ' – Zoltán Jan 15 '16 at 13:30
  • How do you plan to insert the ζ character? Depending on that, it may or may not be possible to do what you ask. – giordano Jan 15 '16 at 13:45
2

This is the purpose of preview-latex. Here, with auctex 11.89, with the cursor on the math item, just type C-c C-p C-p and the editor displays the ζ .

  • thank you for your answer. I know and use preview-latex. What I want to do is to insert unicode characters directly. – Zoltán Jan 18 '16 at 12:46
2

Not elegant, but it works for me: I just use my dumb solution and define a function for each character I need. What I have so far is

(defun LaTeX-math-alpha  () "Insert α" (interactive) (insert "α" ))
(defun LaTeX-math-approx () "Insert ≈" (interactive) (insert "≈" ))
(defun LaTeX-math-beta   () "Insert β" (interactive) (insert "β" ))
(defun LaTeX-math-delta  () "Insert δ" (interactive) (insert "δ" ))
(defun LaTeX-math-epsilon() "Insert ϵ" (interactive) (insert "ϵ" ))
(defun LaTeX-math-zeta   () "Insert ζ" (interactive) (insert "ζ" ))
(defun LaTeX-math-eta    () "Insert η" (interactive) (insert "η" ))
(defun LaTeX-math-theta  () "Insert θ" (interactive) (insert "θ" ))
(defun LaTeX-math-iota   () "Insert ι" (interactive) (insert "ι" ))
(defun LaTeX-math-kappa  () "Insert κ" (interactive) (insert "κ" ))
(defun LaTeX-math-lambda () "Insert λ" (interactive) (insert "λ" ))
(defun LaTeX-math-mu     () "Insert μ" (interactive) (insert "μ" ))
(defun LaTeX-math-nu     () "Insert ν" (interactive) (insert "ν" ))
(defun LaTeX-math-xi     () "Insert ξ" (interactive) (insert "ξ" ))
(defun LaTeX-math-pi     () "Insert π" (interactive) (insert "π" ))
(defun LaTeX-math-rho    () "Insert ρ" (interactive) (insert "ρ" ))
(defun LaTeX-math-sigma  () "Insert σ" (interactive) (insert "σ" ))
(defun LaTeX-math-tau    () "Insert τ" (interactive) (insert "τ" ))
(defun LaTeX-math-upsilon() "Insert υ" (interactive) (insert "υ" ))
(defun LaTeX-math-phi    () "Insert ϕ" (interactive) (insert "ϕ" ))
(defun LaTeX-math-chi    () "Insert χ" (interactive) (insert "χ" ))
(defun LaTeX-math-psi    () "Insert ψ" (interactive) (insert "ψ" ))
(defun LaTeX-math-omega  () "Insert ω" (interactive) (insert "ω" ))
(defun LaTeX-math-varepsilon()"Insert ε" (interactive) (insert "ε" ))
(defun LaTeX-math-vartheta   () "Insert ϑ" (interactive) (insert "ϑ" ))
(defun LaTeX-math-varpi      () "Insert ϖ" (interactive) (insert "ϖ" ))
(defun LaTeX-math-varrho     () "Insert ϱ" (interactive) (insert "ϱ" ))
(defun LaTeX-math-varsigma   () "Insert ς" (interactive) (insert "ς" ))
(defun LaTeX-math-varphi () "Insert φ" (interactive) (insert "φ" ))

(defun LaTeX-math-cdot   () "Insert ⋅" (interactive) (insert "⋅" ))
(defun LaTeX-math-dif    () "Insert 𝚍" (interactive) (insert "𝚍" ))
(defun LaTeX-math-ell    () "Insert ℓ" (interactive) (insert "ℓ" ))
(defun LaTeX-math-iiint  () "Insert ∭" (interactive) (insert "∭" ))
(defun LaTeX-math-iint   () "Insert ∬" (interactive) (insert "∬" ))
(defun LaTeX-math-in     () "Insert ∈" (interactive) (insert "∈" ))
(defun LaTeX-math-int    () "Insert ∫" (interactive) (insert "∫" ))
(defun LaTeX-math-itrans () "Insert ⊷" (interactive) (insert "⊷" ))
(defun LaTeX-math-partial() "Insert ∂" (interactive) (insert "∂" ))
(defun LaTeX-math-sum    () "Insert ∑" (interactive) (insert "∑" ))
(defun LaTeX-math-transf ()"Insert ⊶" (interactive) (insert "⊶" ))

(defun LaTeX-math-Rarrow () "Insert ⇒" (interactive) (insert "⇒" ))
(defun LaTeX-math-rarrow () "Insert →" (interactive) (insert "→" ))

With my LaTeX-math-list:

(setq LaTeX-math-list '(
         ("ä (" "left" nil nil)
         ("ä )" "right" nil nil)
         ("ä =" "approx" "personal" 8776)
         ("ä F" "dfrac" nil nil)
         ("ä I" "iint" "personal" 8748)
         ("ä R" "Rarrow" "personal" 8658)
         ("ä T" "itrans" "personal" 8887 )
         ("ä d"  "dif" "personal" 100)
         ("ä f" "frac"  nil nil)
         ("ä i" "int" "personal" 8747)
         ("ä j" "iiint" "personal" 8749)
         ("ä l" "ell"     "personal" 8467 )
         ("ä p" "partial" "personal" 8706)
         ("ä r" "rarrow" "personal" 8594)
         ("ä s" "sum"    "personal" 8721)
         ("ä t" "transf" "personal" 8886 )
        ))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.