2

I've been using the fontify features of AUCTeX, as well as magic-latex-buffer, to display my TeX code in a more readable way.

But I'm wondering if I can crank this up to 11: is there a way to render the document text in a variable width font, but have any actual LaTeX code (macros, etc.) rendered using a monospace font.

This isn't a true WYSIWYG, but it at least would make the buffer contents feel more like the final document.

2

You can make the face used for math and the so-called sedate face used for macro names inherit from fixed-pitch, and activate variable-pitch-mode in the LaTeX mode hook:

(set-face-attribute 'font-latex-sedate-face nil :inherit 'fixed-pitch)
(set-face-attribute 'font-latex-math-face nil :inherit 'fixed-pitch)
(add-hook 'LaTeX-mode-hook #'variable-pitch-mode)
| improve this answer | |

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.