Skip to main content

overview

Introduction to LaTeX

LaTeX is a professional typesetting system based on the TeX engine, developed by Leslie Lamport. It uses plain text to compose documents and compiles them into PDF, allowing authors to focus on content rather than layout details. It excels at mathematical formulas and bibliography handling, and is the mainstream typesetting tool for scientific and technical papers in STEM fields.

Packages: LaTeX's extension library, loaded in the preamble with \usepackage{package-name}, used to add functionality not available natively, such as Chinese rendering, formulas, and graphics.

Features of LaTeX

  • High-quality typesetting: LaTeX is renowned for its professional typesetting quality, especially for complex mathematical formulas and bibliographies. It automatically adjusts document formatting to produce publication-standard output.
  • Markup-based: LaTeX uses a plain-text markup language. Users define document structure and formatting with specific commands and tags. For example, use \section{} for sections and \textbf{} for bold text.
  • Cross-platform support: LaTeX is cross-platform, supporting Windows, macOS, and Linux. Generated documents are usually PDF and display consistently across platforms.
  • Suitable for academic writing: LaTeX is ideal for writing academic papers, books, technical documents, and reports, especially those with many mathematical formulas, references, and complex layout requirements. It offers excellent support for bibliography management, formula input, and typesetting effects.
  • Automated document management: LaTeX provides powerful automation for long documents, books, and papers, such as automatic numbering, table of contents generation, cross-references, and formula typesetting. It can automatically handle citations and reference lists, making it ideal for documents requiring precise formatting.

LaTeX vs. Word

FeatureLaTeXMicrosoft Word
Typesetting qualityProfessional-grade, especially for complex formulas and long documents.Suitable for simple documents; complex layouts require manual adjustment.
Learning curveRequires learning basic syntax; steeper at first.WYSIWYG, easy to get started.
AutomationAutomatic numbering, cross-references, table of contents, etc.Manual numbering and formatting required.
Math formula supportPowerful formula typesetting, supporting complex symbols and structures.Limited formula editor; complex formulas are difficult.
Cross-platform supportFully cross-platform, consistent document rendering across systems.Good cross-platform support, but formatting may vary by version.
Document structureContent and formatting separated, easier maintenance and collaboration.Content and formatting mixed, harder to maintain long documents.
ExtensibilityExtend functionality via packages, support custom commands and environments.Feature extensions rely on plugins, less flexible.

LaTeX Workflow

  1. Write LaTeX source code: Use a plain text editor to write .tex files containing document structure, text, and commands.
  2. Compile LaTeX source code: Use a LaTeX compiler (such as pdflatex, xelatex, lualatex, etc.) to compile the source code into a PDF file.
  3. Preview the PDF file: Use a PDF reader to preview the compiled PDF file; the content is automatically typeset according to the source code.
  4. Modify the source code: Modify the LaTeX source code as needed, and repeat the compile and preview steps until satisfied.