The question about function restrictions didn't solve my problem, nor did the related questions about bigger parenthesis larger than Bigg.

I'd like to typeset a function restriction, with the vertical bar a bit lowered. f_{\big|W} results in something close to what I want:

enter image description here

To perfect it, the bar would be cut off where it reaches the baseline of the subscript symbol (in this case W). So that it doesn't reach below it.

How can I accomplish that?

  • 1
    Whatever you end up using, you should define a macro that you use like \restr{f}{W} or \restr{W}{f} and let the macro output the style you want. That way you have clearer code, and much easier to tweak in the whole document.
    – Manuel
    Jan 29, 2017 at 14:33

1 Answer 1


\vrule inside an horizontal box has the property to match the height and depth of this box. Also all dimensions (height, depth, width) can be explicitly specified.


\[ f_{\mkern 1mu \vrule height 2ex\mkern2mu W} \]


  • The spacing around the vertical bar is achieved by \mkern to use the math unit mu that adopts to the current math style automatically.

  • The "W" looks a tiny bit lower than the rule. The reason is that "W" draws this tiny bit outside its character bounding box. The depth can be explicitly specified for fine-tuning.


You must log in to answer this question.

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