Metric Tensor in LaTeX (g_{ij})

gijg_{ij}
LaTeX command
g_{ij}
Package
No package needed: built into LaTeX
Mode
Math mode only

Where it is used

Components of the metric tensor, the symmetric positive-definite form that defines lengths and angles on a manifold.

The line element is written ds^2 = g_{ij}\, dx^i dx^j with summation implied, and the length of a curve is \int \sqrt{g_{ij}\dot x^i \dot x^j}\, dt. In relativity the metric is Lorentzian and indexed g_{\mu\nu}, for example the Minkowski metric \eta_{\mu\nu}. Its determinant appears in the volume form \sqrt{\det g}\, dx^1 \cdots dx^n, often abbreviated \sqrt{g}. Add thin spaces with \, between the metric and the differentials so ds^2 = g_{ij}\,dx^i\,dx^j does not crowd. In matrix form it is often written (g_{ij}) or simply g.

Minimal compilable example

Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.

ds2=gij dxi dxjds^2 = g_{ij}\, dx^i\, dx^j
\documentclass{article}
\begin{document}
Metric Tensor: $g_{ij}$

\[ ds^2 = g_{ij}\, dx^i\, dx^j \]
\end{document}

Related symbols

All 미분기하학 →

Frequently asked questions

How do I write Metric Tensor in LaTeX?
Type g_{ij} in math mode, for example $ds^2 = g_{ij}\, dx^i\, dx^j$. It works in plain LaTeX without loading any package.
Which package do I need for g_{ij}?
None. g_{ij} is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use g_{ij} in text mode, or only in math mode?
Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $g_{ij}$ in running text.
Math poweredAI로 LaTeX 작성

최고의 AI LaTeX 편집기, Overleaf 대안

Octree는 15개 이상의 대학의 연구자들이 AI를 사용하여 논문을 더 빠르게 작성하도록 도움

  • AI로 아름다운 TikZ 다이어그램 생성
  • 이미지를 업로드하고 LaTeX로 원활하게 변환
  • 논문 작성 및 서식에 대한 즉각적인 지원 받기