[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX-devel] sub and super scripts in prettifying

From: Uwe Brauer
Subject: [AUCTeX-devel] sub and super scripts in prettifying
Date: Mon, 22 Aug 2016 19:57:12 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)


I just found this message from 3th of september 2015 by Tassilo

| I guess what Uwe wants is that `prettify-symbols-mode' in a (La)TeX
| buffer (with stock latex-mode or AUCTeX; doesn't really matter) could
| have the option to make the ^ and _ invisible, too.
| I already told him that this is not what p-s-m is meant for.  But it's
| easy enough to write a custom font-lock rule for that:
| --8<---------------cut here---------------start------------->8---
| (defun th/invisible-super-sub-scripts ()
|   (interactive)
|   (cl-pushnew 'invisible font-lock-extra-managed-props)
|   (font-lock-add-keywords
|    nil
|    '(("[^\\\\]\\([_^]\\)" (1 '(face nil invisible t) t))))
|   (font-lock-flush))
| --8<---------------cut here---------------end--------------->8---
| Uwe, if you want you could do something like that:
| --8<---------------cut here---------------start------------->8---
| (add-hook 'prettify-symbols-mode-hook
|           (lambda ()
|             (when (eq major-mode 'latex-mode)
|               (th/invisible-super-sub-scripts))))
| --8<---------------cut here---------------end--------------->8---
| Bye,
| Tassilo

My question is: is this feature implemented in either GNU emacs core or
in auctex?
If not it should be added to the documentation of auctex.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]