L1 Norm in LaTeX (\| \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.
\documentclass{article}
\begin{document}
L1 Norm: $\| \theta \|_1$
\[ \min_{\theta} \|y - X\theta\|_2^2 + \lambda \| \theta \|_1 \]
\end{document}Related symbols
- L2 Norm
\| \theta \|_2 - Product Over Samples
\prod_{i=1}^{N} - Frobenius Norm
\| \mathbf{W} \|_F - Sum Over Classes
\sum_{c=1}^{C} - Conditional Probability
p(y | x) - Probability Distribution
p(x)
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.
최고의 AI LaTeX 편집기, Overleaf 대안
Octree는 15개 이상의 대학의 연구자들이 AI를 사용하여 논문을 더 빠르게 작성하도록 도움
- AI로 아름다운 TikZ 다이어그램 생성
- 이미지를 업로드하고 LaTeX로 원활하게 변환
- 논문 작성 및 서식에 대한 즉각적인 지원 받기