iLoveConverter
Categories 11 categories

The LaTeX (.tex) Format, Explained

iLoveConverter Team 3 min read

On this page

LaTeX — pronounced roughly “lah-tek” — is a typesetting system used almost exclusively for academic and technical writing. A .tex file is plain text with markup commands: you describe what you want (chapter, equation, bibliography) and LaTeX produces beautifully typeset output, typically PDF.

A minimal LaTeX file

\documentclass{article}
\begin{document}
Hello \LaTeX!
\end{document}

Compiled with pdflatex main.tex or xelatex main.tex, this produces a PDF with the title “Hello LaTeX!”. The source is never viewed directly by a reader; it is compiled into PDF, DVI (an obsolete intermediate) or HTML.

The TeX engine and LaTeX

  • TeX — the original typesetting engine written by Donald Knuth in the 1970s. It is stable, compact and designed specifically for mathematics.
  • LaTeX — a set of macros built on top of TeX that adds document classes (article, book, report), packages and an easier markup language.
  • XeLaTeX / LuaLaTeX — modern variants that handle Unicode and OpenType fonts natively, making non-Latin scripts and modern typography much easier than classic pdfLaTeX.

When people say “LaTeX” they almost always mean the full LaTeX-on-TeX stack.

What makes LaTeX special

  • Separation of content and presentation. You type \section{Introduction}; LaTeX decides what a section heading looks like. Change one template and the whole document follows.
  • Outstanding mathematics. Math mode renders equations, alignments and symbols that Word still struggles with.
  • Reference and citation automation. \ref{fig:plot} updates when you renumber figures; \cite{smith2024} generates consistent citations.
  • Cross-platform source. The .tex file is plain text that compiles identically on Windows, Mac and Linux.

The compilation pipeline

Building a LaTeX document is two or more passes:

pdflatex main.tex
bibtex main         # if using BibTeX references
pdflatex main.tex
pdflatex main.tex

Each pass reads auxiliary files produced by the previous one and resolves references. Overleaf and VS Code LaTeX Workshop automate this, but the underlying two-pass structure is why “undefined reference” errors appear when you first compile.

TeX vs Word vs DOCX vs Markdown

AspectLaTeXWord/DOCXMarkdown
Math renderingSuperiorMediocreBasic via KaTeX
AutomationScriptableHardScriptable
Control over layoutHigh (expert level)High (visual)Low
Track changesVia git or toolsBuilt inVia git
CollaborationGit with PDFsLive co-editingGit with HTML/PDF

For mathematics and long-form technical writing, LaTeX has no real peer. For everything else, the visual authoring tools are more convenient.

When to use LaTeX

  • Academic papers, theses and dissertations — most journals and thesis systems accept LaTeX directly.
  • Mathematics-heavy documents — equations, proofs and notation.
  • Technical books and manuals — especially with cross-references and citations.
  • Scripts that generate PDFs — LaTeX is the engine under many scientific document builders.

When to convert LaTeX

  • To PDF — the default output, universally readable. The compilation already does this.
  • To DOCX — for collaborators who use Word. Pandoc (pandoc main.tex -o main.docx) converts, but complex layouts and custom macros need manual review.
  • To HTML — tex4ht or Pandoc produce web pages; formulas can become MathML or MathJax-rendered.
  • From Markdown to PDF via LaTeX — pandoc paper.md -o paper.pdf --pdf-engine=xelatex gives you LaTeX quality without writing LaTeX directly.

Common problems

  • Undefined reference — rerun pdflatex or rebuild the project.
  • Missing packages — install the missing CTAN package; tlmgr does this on most systems.
  • Font not found — switch to XeLaTeX/LuaLaTeX and specify a system font.
  • Table overfull box — LaTeX warns and may extend tables past the margin; resize or use tabularx.

FAQ

Is LaTeX still used?

Absolutely. It is the standard in mathematics, physics, computer science and engineering publications.

Can I open a .tex file in Word?

Word can read some LaTeX via import, but round-trip fidelity is limited. Pandoc is more reliable.

Why does LaTeX need multiple passes?

References and page numbers are computed after the content is laid out. The first pass writes auxiliary files; later passes resolve them.

Is LaTeX hard to learn?

The basics are easy. Customising layouts, packages and fonts takes experience — but most authors only use a small subset.

Try it yourself — free, right in your browser

Everything mentioned in this guide runs locally on this site: no upload, no watermark, no sign-up.

Format deep-dives: LaTeX (.tex) , PDF (.pdf) , DOCX (.docx)