[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: prettify-symbols-mode to handle "\alpha-\beta" ...
From: |
Óscar Fuentes |
Subject: |
Re: prettify-symbols-mode to handle "\alpha-\beta" ... |
Date: |
Thu, 04 Feb 2021 03:08:00 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
pietru@caramail.com writes:
> I am using prettify-symbols-mode for displaying greek command using
> the corresponding greek glyph when using mathematical expressions
> in texinfo.
>
> Here is an example
>
> (push '("\\alpha" . ?α) prettify-symbols-alist)
> (push '("\\beta" . ?β) prettify-symbols-alist)
>
> This works well when using "\alpha\beta", "\alpha - \beta"
> But the expression fails when using "\alpha-\beta" or
> "\alpha_i", "\alpha_{ij}", "\beta^i", "\beta+\alpha".
> The expressions are all valid mathematical expressions
> when using tex.
>
> Would you be so kind to update "prettify-symbols-mode"
> so the substitutions can become possible to handle.
>
> Does this require that SYMBOL in (SYMBOL . CHARACTER) be
> a regexp?
The docstring of prettify-symbols-alist says:
Each element looks like (SYMBOL . CHARACTER), where the symbol
matching SYMBOL (a string, not a regexp) will be shown as CHARACTER
instead.
so no, SYMBOL *must* *not* be a regexp.
I can't reproduce the problem you are describing. After starting Emacs:
emacs -Q
if I evaluate this in *scratch*:
(push '("\\alpha" . ?α) prettify-symbols-alist)
then open a .tex file, write \alpha_i, M-x prettify-symbols-alist, the
string is transformed to α_i.
Please note that the definition of SYMBOL depends on the major mode of
the buffer, so make sure that your current major mode is tex-mode.
- prettify-symbols-mode to handle "\alpha-\beta" ..., pietru, 2021/02/03
- Re: prettify-symbols-mode to handle "\alpha-\beta" ...,
Óscar Fuentes <=
- Re: prettify-symbols-mode to handle "\alpha-\beta" ..., pietru, 2021/02/03
- Re: prettify-symbols-mode to handle "\alpha-\beta" ..., Óscar Fuentes, 2021/02/03
- Re: prettify-symbols-mode to handle "\alpha-\beta" ..., Christopher Dimech, 2021/02/03
- Re: prettify-symbols-mode to handle "\alpha-\beta" ..., pietru, 2021/02/03
- Re: prettify-symbols-mode to handle "\alpha-\beta" ..., Stefan Monnier, 2021/02/03
- Re: prettify-symbols-mode to handle "\alpha-\beta" ..., Christopher Dimech, 2021/02/03
- Re: prettify-symbols-mode to handle "\alpha-\beta" ..., Stefan Monnier, 2021/02/04
- Re: prettify-symbols-mode to handle "\alpha-\beta" ..., Christopher Dimech, 2021/02/04
- Re: prettify-symbols-mode to handle "\alpha-\beta" ..., Stefan Monnier, 2021/02/04
- Re: prettify-symbols-mode to handle "\alpha-\beta" ..., Christopher Dimech, 2021/02/04