I want to use \middle| inside of brackets like this.
\documentclass{article}
\begin{document}
\begin{equation}
\left\{\frac{1}{n} \middle| n>0\right\}
\end{equation}
\end{document}
\end{document}
But this examples lacks space before and after the mid |. I don't want to write every time:
left\{\frac{1}{n} \;\middle|\; n>0\right\}
How can I redefine the \middle| command to mean \;\middle|\;? I tried
\edef{\middle|}{\,\middle|\,}
and
\let\originalmiddle\middle
\renewcommand{\middle}{\;\originalmiddle\;}
but neither works. What is the difference between both commands and why do they not work with \middle?
\mid
? Though, that won't scale vertically.\middle|
to behave exactly as\mid