Skip to main content
v2026.11,986 entries · CC-BY 4.0

Inner Product LaTeX: Syntax, Sizing and Macros

How to typeset inner products in LaTeX using angle brackets, mathtools delimiters, and scalable fences, with full syntax examples and troubleshooting fixes.

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-recommended and texlive-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:

  1. Load the Necessary Packages in the Document Preamble

    Open your document source and verify that mathtools is loaded. The mathtools package automatically loads amsmath and provides advanced delimiter handling:

    \usepackage{amsmath}
    \usepackage{mathtools}
  2. Typeset Basic Inner Products with Standard Delimiters

    In LaTeX math mode, produce angle brackets using \langle and \rangle. Separate the vector or function arguments with a comma:

    \langle u, v \rangle

    For 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.

  3. 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\langle and \right\rangle:

    \left\langle \frac{u}{2}, \frac{v}{3} \right\rangle

    If manual height control is required to prevent over-stretching around subscripts, use AMS explicit sizing prefixes (\bigl\langle, \Bigl\langle, \biggl\langle, \Biggl\langle and their corresponding right pairs) as outlined in the guide on parentheses and brackets in LaTeX.

  4. 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 \DeclarePairedDelimiterX from mathtools:

    \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}
  5. 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\vert so 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 braket package 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 \langle and \rangle exhibit 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 \cdot command 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\vert or \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).

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about Inner Product LaTeX: Syntax, Sizing and Macros

Ask your first 2 questions free below. Subscribers get 150 a day for $29 a month.

An AI assistant specialized in research administration. It cites the sources behind every answer, labels web answers and says when it can't answer.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →