What does \right. do?

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.)


\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


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.

Tags:

Math Mode