I have also seen the variation:
x₁ = x₁⁺ - x₁⁻
x₂ = x₂⁺ - x₂⁻
…
xₙ = xₙ⁺ - xₙ⁻
and
x₁⁺, x₁⁻ ≥ 0
x₂⁺, x₂⁻ ≥ 0
…
xₙ⁺, xₙ⁻ ≥ 0
and
(x₁⁺ + x₁⁻) + (x₂⁺ + x₂⁻) + … + (xₙ⁺ + xₙ⁻) ≤ 10
Cost: an additional 2N variables, N equality constraints + 2N+1 inequality constraints. Much more than @fanfan's but with other benefits.
xₖ⁺ and xₖ⁻ can be used in an objective function to penalize either the absolute value of xₖ or to give different penalties for the positive and negative parts of xₖ. These slack variables are sometimes used to express transaction costs,
e.g.,
max theta'mu - lambda/2 theta'Sigma theta -TC(buy+sell)
theta = theta0+buy-sell
buy,sell>=0
and allow for an asymmetry in TC if required.