问题
In Emacs I frequently use math symbols when I write my theory summaries of math textbooks. I use org-mode to structure information and I know about at least two methods of entering special symbols:
- Using embedded LaTeX: enter its representation in the form
\land
then press C-c C-x \ (org-toggle-pretty-entities
) to view it literally; - Using C-x 8 RET (
insert-char
).
I want it however to behave the following way: I enter the LaTeX representation, and it is automatically converted into the physical Unicode form (abbrev?). Is there a package for that and if not, what elisp should I write to implement this behavior?
回答1:
M-x set-input-method
RET TeX
sounds like what you want.
View available symbols by executing M-x describe-input-method
RET TeX
(or its binding C-h I
).
If you'll want to use this often, you can customize the variable default-input-method
and set it to TeX
. That way, you can activate the input method with C-\
(for toggle-input-method
) in any buffer where you need it.
回答2:
There's also latex-pretty-symbols, which may be a bit less finnicky.
来源:https://stackoverflow.com/questions/11863576/emacs-automatically-replace-latex-to-unicode-symbols