Subject: bug#77381: [PATCH] extend tex--prettify-symbols-alist

From: Arash Esbati <[email-masked]>
Date: Mon, 31 Mar 2025 19:58:44 +0200

"Paul D. Nelson" <[email-masked]> writes:

> This patch adds symbols to tex--prettify-symbols-alist.  The new symbols
> include math symbols, accented characters, quotes and fractions.
>
> From 7c9d1dea0e9b4b7b61df3c60b05badca11aa24bc Mon Sep 17 00:00:00 2001
> From: Paul Nelson <[email-masked]>
> Date: Sun, 30 Mar 2025 13:31:58 +0200
> Subject: [PATCH] Extend tex--prettify-symbols-alist
>
> * lisp/textmodes/tex-mode.el (tex--prettify-symbols-alist): Add
> further math symbols, accented characters, quotes and fractions.
> ---
>  lisp/textmodes/tex-mode.el | 183 +++++++++++++++++++++++++++++++++++--
>  1 file changed, 176 insertions(+), 7 deletions(-)
>
> diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
> index ad1d4fa1f88..73f634b7282 100644
> --- a/lisp/textmodes/tex-mode.el
> +++ b/lisp/textmodes/tex-mode.el
> +    ;; Accented characters
> +    ("{\\'a}" . ?á)
> +    ("{\\'e}" . ?é)
> +    ("{\\'i}" . ?í)
> +    ("{\\'o}" . ?ó)
> +    ("{\\'u}" . ?ú)
> +    ("{\\'A}" . ?Á)

Hi Paul,

I suggest to drop this part.  This notation kills kerning (due to
braces) and hyphenation when characters are constructed.  The modern way
is to use a font which contains these chars (e.g., lmodern), set the
buffer encoding to UTF-8 and just enter the char.  UTF-8 is standard for
LaTeX input since April 2018.  I admit, this is LaTeX and not plain TeX,
but `tex--prettify-symbols-alist' deals mostly with LaTeX.

Best, Arash