I'm using function restriction notation like here, but after switching to XeLaTeX with unicode-math I noticed that it looks slightly odd. Here's a minimal working example

\left. \frac{dy}{dx} \right\vert_{x=5} \quad 
\left. y \right\vert_{x=5}

Here's the output with unicode-math:

enter image description here

and here it is without unicode-math:

enter image description here

Apparently with unicode-math delimiters are shorter and the baseline of subscripts is lower.

Ideally I would like the bottom of the vertical bar to extend to the baseline of the subscript, and at the same time keep the automatic scaling of the delimiter wrt. the expression on the left of it.

How could I achieve this?

In case it's relevant: I'll be using texgyrepagella-math font.

  • Some of this is font-related, and some of it can be adjusted by looking at font dimensions... unfortunately I don't have a good interface to them, yet! Feb 5, 2018 at 14:11
  • Side note: Don't use the minimal documentclass :) Feb 5, 2018 at 14:43
  • @PhelypeOleinik thanks, I didn't know. But I checked and it doesn't seem to make much of a difference in the output in this case.
    – Michael
    Feb 5, 2018 at 15:32
  • 1
    @Michael No, it doesn't make a difference in this case. Just a question of good practice :) Feb 5, 2018 at 15:38

1 Answer 1


In case anyone is interested, this is the hack I came up with myself, combining things from this and this answer:




\settodepth{\bardepth}{\(#3 #1\)} %
\settoheight{\totbarheight}{\(#3 #1\)}%
\addtolength{\totbarheight}{1ex}% make it somewhat higher
\addtolength{\bardepth}{0.7ex}% make it extend somewhat further down
{#1 %
\rule[-\bardepth]{0ex}{\totbarheight} %invisible rule to force the next \vrule to be bigger
\mkern 2mu \vrule width 0.14ex \mkern 2.5mu}
{\addtolength{\bardepth}{-0.2ex}%make shorter to lift the baseline of the subscript


\(\restr{\frac{dy}{dx}}{x=2}  5\restr{y}{x=a}\)

\[\restr{\frac{dy}{dx}}{x=2} 5\restr{y}{x=a}\]


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.