.tex TeX document

Text & source code

MIME typetext/x-tex
DescriptionTeX document
CategoryText & source code
Based ontext/plain
Other extensions.cls, .dtx, .ins, .latex, .ltx, .sty

Frequently asked questions

What is a .tex file?

A .tex file is a “TeX document” (MIME type text/x-tex).

How do I open a .tex file?

With any text editor – Notepad++, Visual Studio Code, or gedit and vim on Linux. The file contains readable text, possibly source code or configuration.

How can you tell a genuine .tex file?

No fixed signature at the start of the file is registered for this format; it is recognised mainly by its extension. On Linux and macOS, file --mime-type example.tex shows the guessed type.

Which format is .tex based on?

Technically a .tex file is a subtype of “Plain text document” (text/plain), so programs for that base format can often read it too.

Which MIME type belongs to .tex?

The MIME type is text/x-tex. In the Apache web server: AddType text/x-tex .tex; in nginx: types { text/x-tex tex; }.

Nearby entries