.TEX LaTeX Document
.tex

LaTeX Document

A TEX file contains LaTeX source code, a plain-text markup language compiled into PDF by engines like pdflatex or xelatex. It is the standard format for academic papers, theses, and scientific publishing. FileDex does not convert TEX files but provides format reference information.

Document structure
Header version
Body content tree
Index references
Text FormatLaTeX SourceAcademic StandardUTF-8Typesetting
By FileDex
Not convertible

LaTeX requires the TeX typesetting engine for compilation to PDF, not available in browser WASM.

Looking to convert? Try a related format:

Common questions

How do I compile a TEX file to PDF?

Run 'pdflatex document.tex' in a terminal with a TeX distribution installed (TeX Live, MiKTeX, or MacTeX). For bibliography support, run bibtex then pdflatex twice more.

What is the difference between pdflatex, xelatex, and lualatex?

pdflatex is the classic engine (fast, wide compatibility). XeLaTeX adds native Unicode and OpenType font support. LuaLaTeX embeds the Lua scripting language for advanced customization. All produce PDF output.

Can I convert a TEX file to Word?

Yes, using Pandoc: 'pandoc document.tex -o document.docx'. Complex layouts and custom macros may require manual adjustment after conversion.

What makes .TEX special

What is a TEX file?

TEX files contain LaTeX source code, a document preparation system built on Donald Knuth's TeX typesetting engine. LaTeX is the standard for producing scientific papers, theses, books, and technical documents. It excels at mathematical typesetting, bibliography management, and consistent formatting.

Continue reading — full technical deep dive

How to open TEX files

  • Overleaf (Web) — Online LaTeX editor, collaborative
  • TeXstudio (Windows, macOS, Linux) — Free IDE
  • VS Code (Windows, macOS, Linux) — With LaTeX Workshop extension
  • Any text editor — TEX files are plain text

Technical specifications

Property Value
Language LaTeX (macro layer over TeX)
Output PDF (via pdflatex, xelatex, lualatex)
Encoding UTF-8 (recommended)
Package Manager CTAN / TeX Live / MiKTeX
Bibliography BibTeX, BibLaTeX

Common use cases

  • Academic papers: Research articles for journals and conferences.
  • Theses: University dissertations and theses.
  • Books: Technical books and textbooks.
  • Mathematical documents: Equations, proofs, and formulas.

.TEX compared to alternatives

.TEX compared to alternative formats
Formats Criteria Winner
..TEX vs ..DOCX
Mathematical typesetting quality
LaTeX produces publication-quality math typography with precise spacing; Word's equation editor is adequate but less refined
.TEX wins
..TEX vs ..MD
Ease of learning
Markdown has a far simpler syntax for basic formatting, while LaTeX requires learning commands, environments, and package ecosystems
.MD wins
..TEX vs ..TYP
Modern usability
Typst offers faster compilation, simpler syntax, and built-in scripting while approaching LaTeX output quality
.TYP wins

Technical reference

MIME Type
text/x-tex
Developer
Leslie Lamport / Donald Knuth
Year Introduced
1984
Open Standard
Yes

Binary Structure

TEX files are plain-text files containing LaTeX markup. They begin with a document class declaration (\documentclass{}) followed by a preamble with package imports (\usepackage{}) and configuration commands. The document body is enclosed between \begin{document} and \end{document}. Content uses backslash commands for formatting, environments for structures, and dollar signs for math mode.

1978Donald Knuth releases TeX, the underlying typesetting engine1984Leslie Lamport releases LaTeX as a macro package over TeX1994LaTeX2e becomes the standard version, maintained by the LaTeX Project2004XeTeX released, adding native Unicode and OpenType font support2007LuaTeX released, embedding Lua scripting into the TeX engine2010Overleaf launches as a collaborative online LaTeX editor
Compile LaTeX to PDF with pdflatex other
pdflatex -interaction=nonstopmode -halt-on-error document.tex

Compiles a TEX file to PDF using pdflatex, continuing past warnings but stopping on errors

Full build with bibliography other
pdflatex document.tex && bibtex document && pdflatex document.tex && pdflatex document.tex

Runs the full LaTeX build cycle: compile, process bibliography, then compile twice more to resolve all cross-references

Convert TEX to DOCX with Pandoc other
pandoc document.tex -o document.docx --bibliography=refs.bib

Uses Pandoc to convert LaTeX source to Word format, processing bibliography references

Compile with XeLaTeX for Unicode other
xelatex -interaction=nonstopmode document.tex

Compiles with XeLaTeX engine for full Unicode support and system font access via fontspec

TEX PDF render lossless Compile LaTeX source into a typeset PDF document — the primary output format
TEX PDF render lossless Compile with XeLaTeX for Unicode and OpenType font support
TEX HTML render near-lossless Convert LaTeX to HTML for web publishing or accessibility
TEX DOCX render lossy Convert LaTeX to Word format for collaborators not using LaTeX
LOW

Attack Vectors

  • \write18 (shell escape) can execute arbitrary system commands if enabled
  • \input and \include can read arbitrary files from the filesystem
  • Malicious packages from untrusted sources could contain shell escape calls

Mitigation: FileDex does not open, execute, or parse these files. Reference page only.

TeX Live tool
Comprehensive cross-platform TeX distribution including pdflatex, xelatex, and thousands of packages
Overleaf service
Online collaborative LaTeX editor with real-time preview and thousands of templates
Pandoc tool
Universal document converter supporting LaTeX to/from HTML, DOCX, Markdown, and dozens of formats
TeXstudio tool
Free cross-platform LaTeX IDE with syntax highlighting, auto-completion, and integrated PDF viewer
CTAN service
Comprehensive TeX Archive Network — central repository for TeX packages and documentation