0

As far as I understand, setting font-latex-fontify-sectioning to a number larger than 1.0 should make it so that the titles of sections of different levels have different sizes.

However, even though I set this variable to 3.5 as in:

(setq font-latex-fontify-sectioning 3.5) ;; headers with larger font

This is still not working. Instead, their fonts have different colors, not different sizes, as if this variable was set to color.

Why am I getting the same font size?


EDIT/UPDATE:

Since I asked this question I managed to find the main issue: I had a hook activating TeX-fold-mode which seems to override the section face set by font-latex-fontify-sectioning. I also had a hook running outline-hide-body, but this does not seem to interfere with font-latex-fontify-secitoning.

If instead of running these with the hook I run this function interactively, all goes well:

(defun latex-activate-outline-and-hide-body ()
  (outline-minor-mode 1)
  (outline-hide-body) ;; fold all sections
)

(defun latex-activate-folding-and-hide-buffer ()
  (TeX-fold-mode 1)
  (TeX-fold-buffer) ;; fold envs and macros
)

(defun latex-neat-folding ()
  (interactive "@")
  (setq font-latex-fontify-sectioning 1.3)
  (font-latex-update-sectioning-faces)
  (latex-activate-outline-and-hide-body)
  (latex-activate-folding-and-hide-buffer)
)

Surprisingly enough (to me - probably due to my limited understanding of hooks), this does not work if I add this function to latex's hook:

(add-hook 'TeX-mode-hook 'latex-neat-folding)
6
  • The doc string of the variable font-latex-fontify-sectioning says: ...Setting this variable directly does not take effect unless you call ‘font-latex-update-sectioning-faces’ or restart Emacs. - did you do that?
    – NickD
    Dec 31, 2021 at 15:43
  • I am aware. And yes, I did.
    – soap
    Dec 31, 2021 at 15:47
  • 1
    You did what exactly? Did you add the setq into your init file and restarted emacs? Or did you evaluate the setq in your current session and then evaluated (font-latex-update-sectioning-faces) in the same session? Or something else? In the first case, did you make sure that the setq was done before font-latex was loaded? You see, adding all these details to your question makes sure that we all understand the same thing: we have NO idea how much you know about emacs, so if you don't tell us all the details, we need to poke to find them all out. More detail is better than less...
    – NickD
    Dec 31, 2021 at 16:34
  • 1
    FWIW, when I do the setq in my current emacs session and evaluate (font-latex-update-sectioning-faces) in the same session, the sizes reflect the setting (and 3.5 is much too big for comfort).
    – NickD
    Dec 31, 2021 at 16:44
  • 1
    @NickD I found out that the problem is the interaction with fold-mode. I added the details to my question.
    – soap
    Jan 3, 2022 at 15:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.