# Math symbol question: Vertical bar for ''evaluated at ...''

How do I insert the line "|" after the equation in LaTeX (see image below)? I'm using LyX so if you can point me to the symbol of that line is also OK.

I don't know if this line has a proper name so the title of this question may be very vague. If you could provide me a name, I'll edit this question's title.

You could just type the symbol (|) directly. This won't scale, to get it larger you could use the same technique as Niel de Beaudrap. In the LyX GUI this is done via the Insert Delimiter button on the math toolbar:

Set the left delimiter to None, and the right to |. Uncheck Keep matched, and let the Size be set to Variable:

In LyX this looks like as below (left). The dotted vertical line indicates an invisible delimiter (as \left. in Niels example). Result in PDF on the right.

Edit in response to Marcs answer:

To use \rvert I think you have to use ERTs. If you don't have any other math constructs that use amsmath, you may have to make LyX use this package manually: Document --> Settings --> Math options. Uncheck Use AMS math package automatically, and check Use AMS math package.

In your equation, add an ERT (Ctrl + L) and type \biggr\rvert. That is, the first backslash may appear automatically, in which case don't type it.

\biggr is one of several commands for manually scaling a delimiter, rather than the automatic provided by \left \right. Other sizes are \bigr, \Bigr and \Biggr, with the latter being the largest. For left delimiters, replace r with l. (See section 4.14.1 Delimiter sizes in amsmaths manual.)

Should you want to use \left\right, you need to add an ERT with \left. before the fraction (or whatever it is) and have \right\rvert in the one after.

I don't know how you would get this in LyX. However, if you're comfortable with writing things in mathmode by hand, I would write this as

T(s) = \frac{1}{H(\hat S)} \bigg\rvert_{\hat S = \epsilon^{1/n} \frac{s}{\omega_P}}


The relevant bit is the \bigg\rvert, which you can substitute with \Big\rvert or \Bigg\rvert to get a smaller or larger vertical stroke. If you would like to resize the vertical stroke automatically depending on what occurs to the left of it, I would recommend

T(s) = \left. \frac{1}{H(\hat S)} \right\rvert_{\hat S = \epsilon^{1/n} \frac{s}{\omega_P}}


where \left. puts an invisible left-bracket-like symbol on the left, whose right-side partner is the vertical stroke given by \right|. These pairs work equally for other braces/brackets.

• It seems like all I can find is how to type | instead of ]. what's the corresponding command for ]? Sep 17 '19 at 18:06
• @steven ] will work just fine. You can also use \rbrace. Mar 12 at 16:08

Do not use | directly. Instead I suggest you use \rvert, which is provided by the amsmath package to address the overloading of the | symbol. See section 4.14.2 of the amsmath documentation.

Try the following:

$$\left.\frac{\frac{1}{x}}{\frac{5}{1+\frac{x}{7}}}\right\vert_{-5}^{17}$$

• This isn't much different from what is suggested in the other answers... Sep 7 '13 at 6:21
• This answer is actually much better than the others because the vertical bar automatically scales to the height of the rest of the expression. The other answers require fiddling by the user to get the right height. Jul 23 '20 at 21:28
• @TylerR. The other answers do mention using \left. \right\rvert. There are also some who object to using \left/\right because it doesn't get the spacing correct. See tex.stackexchange.com/q/173717/107497 Mar 12 at 16:13

When using Lyx, I found it very useful (and fast) to create a shortcut for the command math-delim . |. It creates a variable sized container with nothing on the left side and the \vert on the right side, so this works perfectly for me.

So: Tools > Preferences > Editing > Shortcuts... New... Function: math-delim . | (with the blank space bethween the dot and the vertical line) and choose your preferred keys for the shortcut.