Written and maintained by CASRAI Editorial Board
Published
On this page
In LaTeX mathematical typesetting, an inner product is represented using angle bracket delimiters (\langle and \rangle) or scalar dot notation (\cdot), rather than standard keyboard inequality symbols (< and >). Whether formulating finite-dimensional Euclidean dot products in linear algebra, function space projections in functional analysis, or state-vector overlaps in quantum mechanics, LaTeX provides typographic precision through core math mode and the extended mathtools package. This guide details how to write standard inner products, configure reusable scalable macros with \DeclarePairedDelimiterX, manage fence sizing around tall expressions, and resolve common compilation errors.
What it is used for in research
Inner products are foundational mathematical operations across computational, physical, and statistical disciplines. In scientific publishing, standardizing inner product notation ensures clarity and adheres to journal typographic styles:
- Linear Algebra and Data Science: In multivariate statistics and machine learning, the Euclidean inner product (dot product) between two vectors u and v is denoted as u · v or ⟨u, v⟩ = uᵀv. This formulation appears throughout principal component analysis, linear regression derivations, and covariance matrix calculations. Researchers formatting matrix equations often pair inner products with the LaTeX matrix transpose notation.
- Functional Analysis and Hilbert Spaces: In theoretical mathematics and partial differential equations, researchers evaluate inner products on infinite-dimensional function spaces, such as L² spaces: ⟨f, g⟩ = ∫ f(x) g*(x) dx. These formulations frequently incorporate integral signs, fractions, and norms. For paired vertical bar notation such as norms, researchers often consult the LaTeX absolute value guide.
- Quantum Mechanics and Computing: Quantum state vectors are expressed using Paul Dirac’s bra-ket notation. An inner product between a bra state ⟨ψ| and a ket state |φ⟩ is written as ⟨ψ | φ⟩, representing probability amplitudes and unitary overlaps in state space.
- Vector Calculus and Physics: In mechanics and electrodynamics, scalar products quantify work, energy, and flux. Authors contrast inner products against exterior products as detailed in LaTeX vector product documentation.
Install or access (official source only)
LaTeX mathematical packages are distributed as free and open-source software through the Comprehensive TeX Archive Network (CTAN). Researchers can install or access LaTeX through official distribution channels:
- TeX Live (Cross-Platform): The comprehensive TeX distribution maintained by the TeX Users Group (TUG). Available directly from the official portal at tug.org/texlive. Included in major Linux distribution package managers (e.g.,
texlive-latex-recommendedandtexlive-latex-extra). - MiKTeX (Windows, macOS, Linux): A lightweight TeX distribution maintained by Christian Schenk with integrated automatic package installation, downloadable from miktex.org.
- MacTeX (macOS): The curated macOS distribution prepared by the MacTeX TeX Technical Task Force of TUG, hosted at tug.org/mactex.
- Cloud TeX Workbenches: Web-based authoring platforms such as Overleaf provide pre-configured TeX Live compilation environments, as reviewed in Web LaTeX editors for research.
To access all inner product commands and delimiters, load the official American Mathematical Society (AMS) math extension packages in your LaTeX document preamble:
\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}
Step-by-step task (numbered, with menu names or commands exactly as in the current docs)
Follow these sequential steps to implement inner product notation in LaTeX manuscripts:
-
Load the Necessary Packages in the Document Preamble
Open your document source and verify that
mathtoolsis loaded. Themathtoolspackage automatically loadsamsmathand provides advanced delimiter handling:\usepackage{amsmath} \usepackage{mathtools} -
Typeset Basic Inner Products with Standard Delimiters
In LaTeX math mode, produce angle brackets using
\langleand\rangle. Separate the vector or function arguments with a comma:\langle u, v \rangleFor Euclidean vector dot products, use the binary operator
\cdot:\mathbf{u} \cdot \mathbf{v}Never type keyboard angle brackets (
< u, v >). TeX categorizes<and>as relational operators, introducing incorrect horizontal spacing and ASCII acute angle glyphs. -
Apply Dynamic Auto-Sizing to Delimiters Around Tall Expressions
When inner products contain fractions, summations, or integrals, standard brackets do not cover the full vertical height. Wrap the delimiters with
\left\langleand\right\rangle:\left\langle \frac{u}{2}, \frac{v}{3} \right\rangleIf manual height control is required to prevent over-stretching around subscripts, use AMS explicit sizing prefixes (
\bigl\langle,\Bigl\langle,\biggl\langle,\Biggl\langleand their corresponding right pairs) as outlined in the guide on parentheses and brackets in LaTeX. -
Configure Reusable Macros with \DeclarePairedDelimiterX
Rather than manually typing delimiters repeatedly or using rigid definitions with \newcommand in LaTeX, define a semantic two-argument macro in your preamble using
\DeclarePairedDelimiterXfrommathtools:\DeclarePairedDelimiterX\inner[2]{\langle}{\rangle}{#1, #2}This single command definition automatically creates three distinct invocation modes:
- Standard fixed size:
\inner{u}{v} - Automatic sizing (starred):
\inner*{\frac{u}{2}}{v}(internally applies\left\langle ... \right\rangle) - Explicit size control:
\inner[\Big]{u}{v}or\inner[\Bigg]{u}{v}
- Standard fixed size:
-
Typeset Inner Products with Vertical Dividers (Dirac and Hilbert Spaces)
In Hilbert space and quantum physics contexts where arguments are separated by a vertical bar, define a macro incorporating
\delimsize\vertso the central divider scales in proportion to the outer fences:\DeclarePairedDelimiterX\innerbar[2]{\langle}{\rangle}{#1 \delimsize\vert \mathopen{}#2}Alternatively, for dedicated quantum mechanics Dirac notation, load Donald Arseneau’s
braketpackage from CTAN and write:\usepackage{braket} \Braket{\psi | \phi}
Output and how to read it
When compiled with pdfLaTeX, XeLaTeX, or LuaLaTeX, each command renders a specific mathematical structure. Understanding how to read the visual output ensures proper typographic proofing:
- Angle Delimiters ⟨u, v⟩: The glyphs produced by
\langleand\rangleexhibit shallow, open interior angles designed specifically to enclose mathematical arguments without visually colliding with ascenders or descenders. In contrast, ASCII inequality symbols create sharp, acute wedges that crowd adjacent letters. - Scalar Dot u · v: The
\cdotcommand centers a solid circular point at the math axis, positioned symmetrically between the baseline and mean line. It denotes scalar multiplication or Euclidean dot products. - Vertical Bar Divider ⟨u | v⟩: When formatted with
\delimsize\vertor\Braket, the vertical separator matches the height of the outer angle brackets exactly. The spacing before and after the bar conforms to standard mathematical relation spacing. - Subscript and Superscript Alignment: Subscripts placed immediately following
\rangle(such as ⟨u, v⟩_H denoting an inner product on Hilbert space H) sit flush against the delimiter’s lower right edge.
Troubleshooting
The table below summarizes common compilation diagnostics, visual rendering defects, and exact technical solutions when typesetting inner products:
| Observed Issue or Error | Underlying Root Cause | Correction and Verification |
|---|---|---|
| Uneven gaps around brackets (< u, v >) | Keyboard inequality characters < and > are parsed as \mathrel operators with surrounding \medmuskip spacing. |
Replace keyboard characters with \langle and \rangle, which TeX parses as \mathopen and \mathclose delimiters. |
| ! Extra \right error | A \right\rangle was placed without a corresponding opening \left delimiter, or delimiters are nested across split lines. |
Ensure every \left has a matching \right. For unbalanced single fences, pair with an invisible delimiter: \left\langle u, v \right. |
| ! Undefined control sequence \DeclarePairedDelimiterX | The macro was declared without loading the mathtools package in the document preamble. |
Add \usepackage{mathtools} to the preamble. Note that amsmath alone does not include this command. |
| Delimiters overly tall around exponents | \left and \right compute fence height based on the maximum vertical extent, which can over-scale around high superscripts. |
Use manual sizing with \bigl\langle ... \bigr\rangle or invoke the macro with a size argument: \inner[\big]{u^2}{v^2}. |
| Vertical bar inside ⟨u | v⟩ does not scale with fraction | A standard keyboard pipe | was typed inside a \left\langle ... \right\rangle block without a scaling modifier. |
Use \middle| between \left and \right, or use \delimsize\vert within \DeclarePairedDelimiterX. |
Free alternatives (table)
Researchers authoring mathematical manuscripts can select among several free and open-source LaTeX tools, distributions, and rendering engines. The table below details their characteristics and inner product support:
| Tool or Environment | Distribution Type and Platform | Inner Product and Delimiter Support | Primary Research Use Case | Official Source |
|---|---|---|---|---|
| TeX Live | Complete TeX distribution; Linux, Windows, macOS | Native CTAN support for amsmath, mathtools, braket, and all AMS delimiter commands. |
Journal manuscript production, automated CI/CD document compilation, thesis publication. | tug.org/texlive |
| MiKTeX | Package-managed TeX distribution; Windows, macOS, Linux | Complete support with on-the-fly automated installation of mathematical packages. | Individual desktop authoring with minimal initial disk storage footprint. | miktex.org |
| Overleaf Community Edition | Self-hosted or web-based collaborative editor | Pre-loaded TeX Live engine supporting all standard preamble delimiter macros. | Collaborative authoring among multidisciplinary research teams and co-authors. | overleaf.com |
| MathJax (v3) | Open-source JavaScript math display library for the web | Supports standard LaTeX math syntax including \langle, \rangle, and mathtools extensions. |
Displaying scientific articles, interactive web reports, and online documentation. | mathjax.org |
| KaTeX | High-speed client-side math rendering engine | Full support for core math delimiters (\langle, \rangle, \left, \right, \cdot). |
Fast browser math rendering on web applications, notebooks, and research blogs. | katex.org |
FAQ
How do I write an inner product in LaTeX?
To write an inner product in LaTeX, enclose your arguments between \langle and \rangle within math mode, such as $\langle u, v \rangle$. For vector dot products, use the centered dot operator: $\mathbf{u} \cdot \mathbf{v}$.
Why shouldn’t I use keyboard angle brackets < and > for inner products?
In TeX, keyboard characters < and > are classified as relational operators (\mathrel), which inserts medium mathematical spacing (\medmuskip) on both sides. Additionally, their font glyphs are narrow acute wedges designed for inequalities rather than enclosure. Using \langle and \rangle applies correct delimiter spacing (\mathopen and \mathclose) and proper curved geometry.
How do I make inner product angle brackets scale automatically around fractions?
Wrap the delimiters with \left and \right: \left\langle \frac{a}{b}, c \right\rangle. When using the mathtools package with \DeclarePairedDelimiterX, invoke the macro with an asterisk, such as \inner*{\frac{a}{b}}{c}.
What is the difference between \DeclarePairedDelimiter and \DeclarePairedDelimiterX?
The standard \DeclarePairedDelimiter command from mathtools accepts only a single argument (e.g., \abs{x}). In contrast, \DeclarePairedDelimiterX allows you to specify multiple arguments (such as [2]) and customize the internal layout, making it ideal for inner products where two arguments are separated by a comma or vertical bar.
How do I write Dirac bra-ket inner products in LaTeX?
For Dirac notation, write \langle \psi | \phi \rangle for fixed size, or use \left\langle \psi \middle| \phi \right\rangle for dynamic sizing. Alternatively, load the CTAN braket package and use the command \Braket{\psi | \phi}.
Does MathJax support \DeclarePairedDelimiterX from mathtools?
Yes. MathJax v3 supports the mathtools extension. When the extension is enabled in your MathJax configuration, macros defined with \DeclarePairedDelimiterX compile directly in web browsers without requiring pre-compilation to SVG or HTML.
Sources (official docs)
- CTAN (Comprehensive TeX Archive Network). The mathtools Package: Tools for Mathematical Typesetting. Authors: Morten Høgholm, Lars Madsen, Will Robertson, Joseph Wright. Available at: https://ctan.org/pkg/mathtools (Accessed November 10, 2026).
- American Mathematical Society (AMS). User’s Guide for the amsmath Package. Available at: https://ctan.org/pkg/amsmath (Accessed November 10, 2026).
- Overleaf. Brackets and Parentheses in LaTeX. Available at: https://www.overleaf.com/learn/latex/Brackets_and_Parentheses (Accessed November 10, 2026).
- CTAN (Comprehensive TeX Archive Network). The braket Package: Dirac Bra-Ket Notation. Author: Donald Arseneau. Available at: https://ctan.org/pkg/braket (Accessed November 10, 2026).
- TeX Users Group (TUG). TeX Live Documentation and Distribution. Available at: https://tug.org/texlive/ (Accessed November 10, 2026).







