31

I have tried searching for \right. in many places but have not been able to decipher its magical properties. Many texts use the arcane symbol but none that I have found explain it. The composition of the symbol with its elusive period, has also made the search problematic.

Please help!

38

It produces an "invisible" delimiter that is used to match a corresponding \left. You can use it when you need a delimiter only on one side of the expression. lshort also describes it.

An example of such usage would be typesetting a multi-case function definition: with a figure brace on the left and nothing on the right.

\documentclass{article}

\usepackage{amstext}

\begin{document}

\[
  |x| = \left\{ \begin{array}{rl}
       x, & \text{if $x \geq 0$} \\
      -x, & \text{otherwise} 
    \end{array} \right.
\]

\end{document}

enter image description here

(NOTE: This is only an example and has improper spacing. In real life you would use the cases environment for this.)

  • 3
    As a true real-life example, I've used it for integration bounds. Something like \[ \int_a^b f(x) = \left. F(x) \right |_{x=a}^{x=b} \]. – Kris Harper Nov 15 '11 at 14:44
  • @root45: I used to do that, but I found that the bar is not long enough when F(x) is of normal height. It turned out to be better just to use \Bigr| in that situation. – Ryan Reich Nov 15 '11 at 18:28
29

\right. is not exactly an invisible delimiter, because it inserts a small space, which is usually desirable, but no symbol and so can be used to pair a \left. Similarly, also \left. will insert a small space.

The space inserted has width \nulldelimiterspace; the default value is 1.2pt, so it's small but noticeable. In some cases one doesn't desire such a space and it's necessary to eliminate it. However it should be kept in mind that TeX processes a formula, inserting kerns and penalties only when it has scanned the "end-of-formula" marker ($ or $$, the latter usually masked by macros in LaTeX) and uses the values of the parameters which are valid at that moment.

How can one define a "really void" delimiter that matches a \left or \right without adding spaces? Here's how:

\newcommand{\zerodel}{.\kern-\nulldelimiterspace}

Now

\[ \left(\frac{a}{b}\right\zerodel \]

won't add the small space after the formula. One can think to better examples. Here's code that shows the differences (the parameter \nulldelimiterspace has been set to 10pt for better showing the result, the \bigg| is to make the delimiter grow and | indicates the end of the space taken by the "invisible delimiter"):

$\left(\bigg|\right.|$

$\left(\bigg|\right.|\nulldelimiterspace=0pt$ 

$\left(\bigg|\right\zerodel|$

$|\left.\bigg|\right)$

$|\left.\bigg|\right)\nulldelimiterspace=0pt$

$|\left\zerodel\bigg|\right)$

enter image description here

  • 1
    @user0 \mright. removes the additional space due to the inner atom, but inserts \nulldelimiterspace. – egreg Feb 8 at 7:50
5

Using \left<char> and \right<char> you can create delimiters which are resized to be as high as the content between them. So e.g. \left( ... \right) creates big ( ... ). These build a pair and you can't just use \left without \right. However, it is possible to use different characters for both.

Now, if you want a resizable delimiter on the left side but not on the right side you can use the dot . with \right to use it but tell him to not print anything there. A good example would be some case statement: a = \left\{ <some cases> \right.

5

a \left needs a right and vice versa. With \left.or \right. TeX inserts a \nulldelimiterspace which is by default 1.2pt

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.