magic-latex-buffer
magic-latex-buffer copied to clipboard
Adding symbols
How can I add new symbols to magic-latex-buffer and keep them after any update? E.g., adding \Vert to render as ||
Thanks
@DrWaleedAYousef,
magic-latex-buffer
currently does not have any (user-friendly) interface to add symbols dynamically.
A workaround is to push '(regexp . symbol)
pairs to ml/symbols
(defconst
marks the symbol value to be constant, but it actually can be updated dynamically).
(push '("\\\\Vert\\>" . "||") ml/symbols)
Thanks so much; it works!
zk-phi [email protected] writes:
@DrWaleedAYousef,
magic-latex-buffer currently does not have any (user-friendly) interface to add symbols dynamically.
A workaround is to push '(regexp . symbol) pairs to ml/symbols (defconst marks the symbol value to be constant, but it actually can be updated dynamically).
(push '("\Vert>" . "||") ml/symbols)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.*
Thank you so much for your support; I tried it for many symbols and it works great. For example, I used it for \textsuperscript as:
(push '("\\textsuperscript\>" . "⁺") ml/symbols)
However, now I need to treat the whole \textsuperscript{ANY THING} as the mathematical superscript and raise it up. I looked at the superscript function of your code but my little knowledge of elisp was a challenge. Any help?
zk-phi [email protected] writes:
@DrWaleedAYousef,
magic-latex-buffer currently does not have any (user-friendly) interface to add symbols dynamically.
A workaround is to push '(regexp . symbol) pairs to ml/symbols (defconst marks the symbol value to be constant, but it actually can be updated dynamically).
(push '("\\Vert\>" . "||") ml/symbols)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.*