I would like to typeset the differential of a multivariate function evaluated at a point where two of the variables take precise value. I typeset the "evaluated at" using a vertical bar, at the bottom of which I indicate the point at which it's evaluated.

When it's evaluated at just "one variable", no problem, I would just do:

   \frac{\partial f}{\partial x}

But how could I evaluate the derivative at y=0, z=1? I could write it in one line but it becomes quite long. So ideally I would like to "stack" them. At the moment, I use:

   \frac{\partial f}{\partial x}

which is very kludgy to say the least. And it doesn't work very nicely: the y=0 is typeset a bit smaller than the z=0.

Any idea on how I could do this properly?

  • 1
    I found out that I can achieve a somewhat acceptable result using the "mathtools" package, and the \substack command: $\left.\frac{\partial f}{\partial x} \right|_{\tiny\substack{y=0\\ z=1}}$ The \tiny is optional, and actually throws in a warning that it's not valid in math mode, so it's probably not the exact perfect solution. Also the second line is further down than the vertical bar, but that's a start.
    – Peutch
    Commented Sep 20, 2011 at 10:16
  • The \substack command is actually provided by the amsmath package (in its v2.0 at least).
    – Peutch
    Commented Sep 20, 2011 at 10:20

2 Answers 2


You can modify the definition of subarray and \substack to accept an optional argument:

  \Let@ \restore@math@cr \default@tag
  \baselineskip\fontdimen10 \scriptfont\tw@
  \advance\baselineskip\fontdimen12 \scriptfont\tw@
  \lineskip\thr@@\fontdimen8 \scriptfont\thr@@
  \ialign\bgroup\ifx c#2\hfil\fi


$\left.\frac{\partial f}{\partial x}\right|_{\substack[b]{y=0\\z=1}}$

will do. The optional argument default is c, that is, the usual placement. It can be also b, to get "bottom alignment".


This code uses the \shortstack command in the subscript. I also use \left. before the matrix and \right| after the matrix to fit the vertical bar.

    0 & 1 & 0 & 0 \\
    0 & 1 & 0 & 0 \\
    0 & 1 & 0 & 0 \\
    0 & 1 & 0 & 0
\right|_{\shortstack{\tiny $a=0$ \\ \tiny $b=0$ \\ \tiny $c=0$ \\ \tiny $d=0$}}

You must log in to answer this question.

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