4

In LaTeX mode, the content of \frametitle{...} gets a bigger font size. How can I prevent that from happening? And is there a general to prevent /all/ variation in font size? (I wish emacs would just look like a terminal.)

  • The question isn't too clear, to me. But a guess is that different faces are used for different parts of the text, and you can just customize the faces to all be the same or all have the same font size. Use M-x list-faces-display or C-u C-x = to find out which face(s) you need to customize. – Drew May 27 '18 at 13:41
  • @Drew, yes, different sizes are used, but I find it surprising if there is no simple way to prevent that from ever happening, without changing every individual setting. – Toothrot May 27 '18 at 14:23
  • You can make Emacs look like a terminal by ... running it inside a terminal. – Stefan May 28 '18 at 0:17
  • @Stefan, yes, but only at the rather steep price of escape, super, and hyper. – Toothrot May 28 '18 at 7:07
2

From AUCTeX's manual:

Sectioning commands

Sectioning commands are macros like \chapter or \section. For these commands there are two fontification schemes which may be selected by customizing the variable font-latex-fontify-sectioning.

User Option: font-latex-fontify-sectioning

Per default sectioning commands will be shown in a larger, proportional font, which corresponds to a number for this variable. The font size varies with the sectioning level, e.g. \part (font-latex-sectioning-0-face) has a larger font than \paragraph (font-latex-sectioning-5-face). Typically, values from 1.05 to 1.3 for font-latex-fontify-sectioning give best results, depending on your font setup. If you rather like to use the base font and a different color, set the variable to the symbol color. In this case the face font-lock-type-face will be used to fontify the argument of the sectioning commands. [...]

Related to sectioning there is special support for slide titles which may be fontified with the face font-latex-slide-title-face. You can add macros which should appear in this face by customizing the variable font-latex-match-slide-title-keywords.

For the first part, do M-x customize-variable RET font-latex-fontify-sectioning RET and choose color from the Value Menu, read the docstring and hit Apply and Save.

For the second part, doM-x customize-face RET font-latex-slide-title-face RET and adjust the settings to your needs.

  • I actually had this set to 'color from before, but that doesn't seem to have any effect. – Toothrot May 27 '18 at 15:22
  • 1
    @Toothrot - font-latex-slide-title-face is an exception here. Just customize it and you should be done. – Arash Esbati May 27 '18 at 15:25
1

Here's a crude hack that might give the behavior you're looking for:

(advice-add 'face-spec-set-2 :around
            (lambda (f face frame attrs)
              (funcall f face frame (plist-put attrs :height 1.0))))

Make sure to use it early in your ~/.emacs since it tends to only apply to faces defined/set after it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.