What is a TEX file?
TeX Source Document
- Developed By
- Donald Knuth
- Initial Release
- 1978
- MIME Type
- application/x-tex
A TEX file is a plain text source document containing typesetting code written in the TeX language, developed by Donald Knuth. It consists of unformatted text combined with program macros and commands (starting with a backslash) that define the document's structure, mathematical notation, and layout. Used primarily in academia and scientific research, TEX files are not WYSIWYG; they must be compiled by a typesetting engine (such as pdfTeX or XeTeX) to produce a rendered output document, typically a PDF or DVI file.
How to open a TEX file
Since TEX files are plain text, they can be opened with any text editor (Notepad, Vim), but specialised LaTeX editors are required to compile and preview the document. TeXworks, TeXShop (macOS), and TeXstudio are popular desktop environments that include syntax highlighting and compiler integration. For a cloud-based solution that avoids local installation, Overleaf is the industry-standard browser-based editor.