Hi Arash, This works! I use `use-package' so I had to do it by adding the `setq-default' part to LaTeX-mode-hook. (Maybe the method could be added to the manual?)
Thanks! All the best, Greg ------------------------------------------------------------------------------- On Wed 27 Aug 2025 at 09:11 Arash Esbati wrote: > > Hi Greg, > > Greg Bognar via General discussion about AUCTeX <[email protected]> writes: > > > I would like to apply my own font-locking to footnotes in my > > documents. I want the footnote text to be smaller and set in a dimmer > > color to make it less obtrusive. > > > > I first defined a new face: > > > > (defface my-font-latex-footnote-face > > '((t :foreground "MistyRose4" :height 0.9)) > > "Face used for footnotes." > > :group 'font-latex-highlighting-faces) > > > > Then I set `font-latex-user-keyword-classes': > > > > (setq font-latex-user-keyword-classes > > '(("my-footnote" (("footnote" "{")) 'my-font-latex-footnote-face > > command))) > > > > Then I restarted Emacs. > > > > Interestingly, the footnote text is now shown in a smaller font (so > > :height 0.9 works), but not in the new foreground color. It is still > > fontified with `font-lock-constant-face'. > > > > In `font-latex.el' there is the customizable variable > > `font-latex-deactivated-keyword-classes'. But I don't want to > > deactivate the whole `reference' class, only change the face used for > > the footnote text. How can I achieve that? > > The way I see it you have to remove AUCTeX fontification for "footnote" > before adding your own rule. Overall, something like this seems to work > in my brief testing: > > --8<---------------cut here---------------start------------->8--- > (defface my-font-latex-footnote-face > '((t :foreground "DarkOliveGreen4" :height 0.9)) > "Face used for footnotes." > :group 'font-latex-highlighting-faces) > > (setq font-latex-user-keyword-classes > '(("my-footnote" (("footnote" "{")) > my-font-latex-footnote-face command))) > ;; ^ Quote removed > > ;; Added as described in AUCTeX manual: > (with-eval-after-load 'font-latex > (setq-default > font-latex-match-reference-keywords-local > (remove (assoc-string "footnote" > font-latex-match-reference-keywords-local) > font-latex-match-reference-keywords-local))) > --8<---------------cut here---------------end--------------->8--- > > I also removed a ' in the (setq font-latex-user-keyword-classes form, I > think it is not needed. Do you want to try the above at your end? > > Best, Arash
