L1 Norm in LaTeX (\| \theta \|_1)

∥θ∥1\| \theta \|_1
LaTeX command
\| \theta \|_1
Package
No package needed: built into LaTeX
Mode
Math mode only

Where it is used

L1 norm of theta: the sum of the absolute values of its entries.

The L1 norm, \|\theta\|_1 = \sum_i |\theta_i|, is the lasso penalty and promotes sparse solutions because its unit ball has corners on the axes. \| gives double bars but treats them as ordinary symbols, so spacing can be off when a minus sign follows; \lVert \theta \rVert_1 marks them as left and right delimiters and spaces correctly. For tall arguments, use \left\| ... \right\| to scale. Many papers define a \norm macro through mathtools' \DeclarePairedDelimiter for consistency. Do not confuse it with |\theta|, which denotes an absolute value or cardinality.

Minimal compilable example

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

min⁡θ∥y−Xθ∥22+λ∥θ∥1\min_{\theta} \|y - X\theta\|_2^2 + \lambda \| \theta \|_1
\documentclass{article}
\begin{document}
L1 Norm: $\| \theta \|_1$

\[ \min_{\theta} \|y - X\theta\|_2^2 + \lambda \| \theta \|_1 \]
\end{document}

Related symbols

All Machine Learning & AI →

Frequently asked questions

How do I write L1 Norm in LaTeX?
Type \| \theta \|_1 in math mode, for example $\min_{\theta} \|y - X\theta\|_2^2 + \lambda \| \theta \|_1$. It works in plain LaTeX without loading any package.
Which package do I need for \| \theta \|_1?
None. \| \theta \|_1 is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use \| \theta \|_1 in text mode, or only in math mode?
Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\| \theta \|_1$ in running text.
Math poweredSchrijf LaTeX met AI

Beste AI LaTeX Editor, Overleaf Alternatief

Octree helpt onderzoekers van 15+ universiteiten sneller onderzoeksartikelen schrijven met AI

  • Genereer mooie TikZ-diagrammen met AI
  • Upload afbeelding en converteer naadloos naar LaTeX
  • Krijg directe hulp bij het schrijven en opmaken van onderzoeksartikelen