Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Next: , Previous: Outline Mode, Up: Text

30.9 TeX Mode

TeX is a powerful text formatter written by Donald Knuth; it is also free, like GNU Emacs. LaTeX is a simplified input format for TeX, implemented by TeX macros; it comes with TeX. SliTeX is a special form of LaTeX.1 DocTeX (.dtx) is a special file format in which the LaTeX sources are written, combining sources with documentation.

Emacs has a special TeX mode for editing TeX input files. It provides facilities for checking the balance of delimiters and for invoking TeX on all or part of the file.

TeX mode has four variants: Plain TeX mode, LaTeX mode, SliTeX mode, and DocTeX mode (these distinct major modes differ only slightly). They are designed for editing the four different formats. The command M-x tex-mode looks at the contents of the buffer to determine whether the contents appear to be either LaTeX input, SliTeX, or DocTeX input; if so, it selects the appropriate mode. If the file contents do not appear to be LaTeX, SliTeX or DocTeX, it selects Plain TeX mode. If the contents are insufficient to determine this, the variable tex-default-mode controls which mode is used.

When M-x tex-mode does not guess right, you can use the commands M-x plain-tex-mode, M-x latex-mode, M-x slitex-mode, and doctex-mode to select explicitly the particular variants of TeX mode.


[1] SliTeX is obsoleted by the ‘slides’ document class in recent LaTeX versions.

  Published under the terms of the GNU General Public License Design by Interspire