Metric Tensor in LaTeX (g_{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.
\documentclass{article}
\begin{document}
Metric Tensor: $g_{ij}$
\[ ds^2 = g_{ij}\, dx^i\, dx^j \]
\end{document}Related symbols
- Inverse Metric
g^{ij} - Scalar Curvature
R - Exterior Derivative
d\omega - Ricci Tensor
R_{ij} - Wedge Product
\alpha \wedge \beta - Riemann Curvature
R^l_{ijk}
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.
Pinakamahusay na AI LaTeX Editor, Alternatibo sa Overleaf
Tinutulungan ng Octree ang mga researcher mula sa 15+ na unibersidad na sumulat ng research papers nang mas mabilis gamit ang AI
- Gumawa ng magagandang TikZ diagrams gamit ang AI
- Mag-upload ng larawan at i-convert ito sa LaTeX nang walang problema
- Makakuha ng instant na tulong sa pagsulat at pag-format ng research papers