I would like to know if it is possible to make this. Basically its kind of the opposite from using the {cases} command
Thanks in advance!
[Tex/LaTex] two equations with curly brace
brackets
Related Solutions
Here's a variant of Gonzalo's code that uses \mathop{}\limits
instead of \raisebox
. The output is almost the same.
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\[
f = \langle x | R\mathclap{\mathop{}\limits_{\overbrace{
\textstyle\int d^3 p |p\rangle \langle p|}}}y
\rangle
\]
\end{document}
If you want something more flexible, use the \braceinsert
macro from the code below. It takes one optional argument (the amount by which the brace should be lowered, with default 0ex
) and one mandatory argument (the stuff you want under the brace). Moreover, it takes care of the case that the \braceinsert
is surrounded by \left...\right
delimiters, like this:
To be precise, you'll have to use \bileft...\biright
instead of \left...\right
(like b
racei
nsert left and right). After the outermost \biright
, only explicit superscripts will work, so instead of '
you'd have to use ^\prime
. (Subscripts won't work properly, but I don't know when one would want one.)
\documentclass{article}
\usepackage{mathtools}
\setlength{\textwidth}{11cm}
\makeatletter
\newcounter{left@right}
\newcommand*\bileft[1]{\left#1\stepcounter{left@right}}
\newcommand*\biright[1]{\right#1%
\@ifnextchar^{\with@superscript}{\without@superscript}}
\def\with@superscript^#1{^{#1}\without@superscript}
\def\without@superscript{%
\addtocounter{left@right}{-1}%
\ifnum\theleft@right=0
\vphantom{\brace@insert@strut}
\gdef\brace@insert@strut{}
\fi
}
\def\brace@insert@strut{}
\newcommand{\braceinsert}[2][0ex]{%
\def\insert@material{%
\mathop{\rule[-#1]{0pt}{0pt}}\limits_{\overbrace{#2}}%
}%
\expandafter\g@addto@macro\expandafter\brace@insert@strut
\expandafter{\insert@material}
\ifnum\theleft@right>0
\smash{\mathclap{\insert@material}}
\else
\mathclap{\insert@material}
\fi
}
\makeatother
\begin{document}
In the formula
\[
f = 5 \bileft( b^2 + \langle x | R
\braceinsert[0.2ex]{\textstyle\int d^3 p |p\rangle \langle p|}
y \rangle \biright)^2,
\]
the depth of the stuff under the brace is added only \emph{after}
\verb|\biright)^2|.
\end{document}
(Maybe this is wayyy too complicated?)
The following may be close to what you're looking for:
\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}
\begin{gather*}
c \colon \{1, \dots, n\} \rightarrow \{1, \dots, n\} \text{ such that}\\
\begin{cases}
c(a_i) = a_{i+1} & \text{for }1\le i<l\\
c(a_l) = a_1
\end{cases}
\end{gather*}
\end{document}
Some comments:
- Use the
cases
environment, provided by theamsmath
package, to place a left curly brace ahead of two or more expressions. - Don't use
...
to create a typographical ellipsis; instead, use\dots
. - Use the
\text{ }
command to write text material inside mathematical expressions. - As pointed out in the comments by @SvendTveskæg and @daleif, it's better (typographically speaking) to use the command
\colon
instead of:
.
On the other hand, if you need the left-hand curly brace to span all three rows, you could do so with the following code:
\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}
\begin{equation*}
\begin{cases}
c \colon \{1, \dots, n\} \rightarrow \{1, \dots, n\} \text{ such that}\\
c(a_i) = a_{i+1} \text{ for $1\le i<l$}\\
c(a_l) = a_1
\end{cases}
\end{equation*}
\end{document}
Observe, though, that this code doesn't make full use of the capabilities of the cases
environment; for sure, one could replace \begin{cases} ... \end{cases}
with a more basic \left\{\begin{array}{@{}l} ... \end{array}\right.
construct.
Best Answer
It is a possible solution of your question.