views:

61

answers:

1

An enormous equation. You need to add \left| on the left side of corresponding |. The corresponding | you need to replace with \right|.

Equation

\begin{equation}
| \Delta w_{0} | = \frac{|w_{0}|}{2} \left( |\frac{\Delta g}{g}|+|\frac{\Delta (\Delta r)}{\Delta r}| + |\frac{\Delta r}{r}| +|\frac{\Delta L}{L}| \right)
\end{equation}

[Premises]

  1. The amount of | is even.
  2. No nesting. So scenario such as M_OPEN|----X_OPEN|-----X_CLOSED|------M_CLOSED| is not possible, just M_OPEN|---M_CLOSED|---H_OPEN|----H_CLOSED|.
+3  A: 
 sed -r -e 's/\|([^|]+)\|/\\left|\1\\right|/g'

But this works only if you do not have nested |...|.

ZyX
+1 smart, succint :)
HH