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 poweredاكتب LaTeX باستخدام الذكاء الاصطناعي

أفضل محرر LaTeX بالذكاء الاصطناعي، بديل Overleaf

يساعد Octree الباحثين من أكثر من 15 جامعة على كتابة أوراق البحث بشكل أسرع باستخدام الذكاء الاصطناعي

  • أنشئ رسوم TikZ جميلة باستخدام الذكاء الاصطناعي
  • ارفع صورة وحولها إلى LaTeX بسلاسة
  • احصل على مساعدة فورية في كتابة وتنسيق أوراق البحث