magic-latex-buffer icon indicating copy to clipboard operation
magic-latex-buffer copied to clipboard

Adding symbols

Open DrWaleedAYousef opened this issue 7 years ago • 3 comments

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 avatar Oct 03 '16 06:10 DrWaleedAYousef

@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)

zk-phi avatar Oct 03 '16 09:10 zk-phi

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.*

DrWaleedAYousef avatar Oct 03 '16 10:10 DrWaleedAYousef

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.*

DrWaleedAYousef avatar Sep 11 '17 10:09 DrWaleedAYousef