What are their uses and are they even standard?
2 Answers
\left
and \right
are used for delimiters when they have to change the size dynamically depending on the content. Consider the following example:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Compare this:
\begin{align*}
\left(\sqrt{2}+\sqrt{3}\right)^2
&=\left(\sqrt{2}\right)^2+2\times\sqrt{2}\times\sqrt{
3}+\left(\sqrt{3}\right)^2\\
&=2+2\sqrt{6}+3\\
&=5+2\sqrt{6}
\end{align*}
with:
\begin{align*}
(\sqrt{2}+\sqrt{3})^2
&=(\sqrt{2})^2+2\times\sqrt{2}\times\sqrt{
3}+(\sqrt{3})^2\\
&=2+2\sqrt{6}+3\\
&=5+2\sqrt{6}
\end{align*}
First one uses \verb|\left(| and \verb|\right)| and second one uses just \verb|(| and \verb|)|. I hope the difference is clear.
Just another example:
\[\left(\frac{1}{2}\right) \qquad (\frac{1}{2})\]
\end{document}
In this particular case, the (\sqrt{2}+\sqrt{3})
with \left
and \right
gives bit bigger parenthesis making it to look ugly (to some extent) as noted by Enrico. In such cases, proper variant of delimiters (\bigl
and \bigr
in this case) may be used to get the appropriate height.
For more details, refer to amsmath documentation - page 15, section 4.14 (texdoc amsldoc
from command prompt). Here is a screen shot of the same:
-
1+1 but I think we don't need a blank line between "Just another..." and
\[...
. Commented Oct 14, 2012 at 2:15 -
@ガベージコレクタ: OK As you wish. I am updating :)– user11232Commented Oct 14, 2012 at 2:39
-
+1; you could point out that in your example with
(\sqrt{2}+\sqrt{3})
the result with\left
and\right
is less good than without it (not to say wrong).– egregCommented Oct 14, 2012 at 9:08 -
@egreg: Yes and added that here also. Thank you :)– user11232Commented Oct 14, 2012 at 9:24
-
1I think there should be a tip when we should use
\left...\right
when we should not use them, with examples. :-) Commented Oct 14, 2012 at 9:31
\left
and \right
are delimiter counterparts and TeX primitives, to be used with so-called "extensible delimiters" in math mode within the same group. This implies two things:
- If you use one, you have to use the other as well; and
- They have to be opened/closed at and within the same group level depth.
Common or typical uses include
\left\{
...\right\}
\left[
...\right]
\left(
...\right)
although there is no requirement for the delimiters to be matching. For example, it is fine to use \left\}
...\right(
, just as long as you use both \left
and \right
. For example (to mimic amsmath
's bmatrix
environment),
\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
\[
\begin{bmatrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9
\end{bmatrix} \qquad
\left[\begin{array}{@{}ccc@{}}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9
\end{array}\right]
\]
\end{document}
If you want to use only one of the two, you still need to include the counterpart, but this time with the argument .
. That is, either \left.
or \right.
, referred to as the null delimiter. TeX inserts a \nulldelimiterspace
for these.
Extensible delimiters are ones that are comprised of a number of fixed and some variable-length parts. For some eye-candy, here's a visual of an extensible }
:
-
you will probably not see this but how did you do the eye-candy delimiter thing? Commented Aug 24, 2021 at 10:56
-
@Spirit_bird: Look at the code:
symbol.tex
. There you'll find the symbols set using\cmexchar
where\newcommand{\cmexchar}{\usefont{OMX}{cmex}{m}{n}\selectfont\char}
. To see the individual characters, read How do I know what symbols/characters are available in a font package?– Werner ♦Commented Aug 24, 2021 at 15:25