# How to render latex expressions (not necessarily formula) inside buffer?

By `preview-latex` on can render latex formulae inside a `tex` buffer. The package `px` package renders latex formular inside an arbitrary buffer (see https://emacs.stackexchange.com/a/219/).

A similar question: How to render latex expressions (not necessarily formulae) inside buffer? For example to render something like `\textbf{some text...}`.

• Turn on tex macros. – Dan Jul 20 '15 at 22:30
• @Dan How to turn tex macro? I tried `(add-hook 'LaTeX-mode-hook 'turn-on-tex-macros)` with no effect. – Name Jul 21 '15 at 5:22
• Am away from my computer for a few days so can't check myself, but look in the auctex manual. – Dan Jul 21 '15 at 10:54
• @Dan Thanks. I found it! Putting `(require 'tex-fold) (add-hook 'LaTeX-mode-hook 'TeX-fold-mode) ` in .emacs then `M-x TeX-fold-buffer` can do what I was looking for. (Note the command is `M-x TeX-fold-buffer` not `M-x tex-fold-buffer`). – Name Jul 22 '15 at 9:14
• Great! Go ahead and post that as the answer. – Dan Jul 22 '15 at 10:27

``````(require 'tex-fold)
in .emacs then `M-x TeX-fold-buffer` (or the shortcut `C-c C-o C-b`) can do what I was looking for.