I would like the output of the standard code

$x \left.\right|_{x\gets 5}$



but with the ability to lower the subscript and extend the vertical bar downwards. There are several relevant pages on Stack Exchange but none I found that quite does it. For instance

$x \left.\rule[-4mm]{0mm}{4mm}\right|_{x\gets 5}$

does it but at the cost of the vertical bar also extending upwards:


and I want to avoid that. Specifically, I would like the top of the vertical bar to be at the same height as given by the standard code.

1 Answer 1


   \vrule height \ht0 depth \dimexpr\dp0+1ex\relax




enter image description here

  • I like it so much I started to replace the very, very many, many occurrences of the hack I had before. I found only one instance where the vertical bar still sticks up. I couldn't care less but if you do, let me know how to get you the guilty code.
    – schremmer
    Nov 6, 2018 at 3:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .