How can i write the vertical line which is fitted witch the brackets. I have a big bracket because of summation and line don't look good. I tried to use \mid but it also doesn't work. Sample of my code.
$E\left[ \sum\limits_{i=1}^{k+1} \E_i^{(v)} - E \left[ \sum\limits_{i=1}^{k+1} \E_i^{(v)} \right] | \mathcal{F}_k \right]$

\E_i^{(v)}defined? – Mico Jun 25 '22 at 13:48\middle|. The accepted solution is not flexible; it does not work for all sizes of brackets. My solution sets the size automatically according to the outer brackets. – matj1 Oct 18 '23 at 14:35