The following definition, from How to continue a piece of text so it is aligned with the last line of an inline multiline box?, allows splitting a math set-builder expression across two lines:
\newcommand\setst[2]{\{#1 :
\begin{array}[t]{@{}l@{}}#2 \}\end{array}}
I want:
- to change
\{
and\}
to\left\{
and\right\}
, respectively. The following attempt generates an error of a missing `\right. ; and -
not to have symbols that would normally be tall in display math, such as integral signs, get squashed down by the
array
environment.What's wrong with my syntax?
\newcommand\Setst2{\left{#1 : \right. %
\begin{array}[t]{@{}l@{}}\left.#2 \right}\end{array}}
And how fix the issue of squashed normally-tall symbols retain their noraml display-math height? (See 2nd source file below.)
Example source (modified from above-cited link):
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\newcommand\setst[2]{\{#1 :
\begin{array}[t]{@{}l@{}}#2 \}\end{array}}
% my attempted mod
\newcommand\Setst[2]{\left\{#1 : \right. %
\begin{array}[t]{@{}l@{}}\left.#2 \right\}\end{array}}
\begin{document}
Braces OK:
\[
\setst{x}{ x \in S_1 \land {} \\
(x \in S_2 \lor x \in S_3) }
\]
Error:
\[
\Setst{x}{ x \in S_1 \land {} \\
(x \in S_2 \lor x \in S_3) }
\]
\end{document}
Here's the printed output from just the "OK" version, using the original command \setst
:
The aim is to replace the { and the } in the output with the coresponding large versions — assuming, of course, that the math expression within causes those braces to expand. But each brace should not expand so as to encompass both lines of the printed output!
Here's a more realistic example, where larger braces are really needed:
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\newcommand\setst[2]{\{#1 :
\begin{array}[t]{@{}l@{}}#2 \}\end{array}}
% my attempted mod
\newcommand\Setst[2]{\left\{#1 : \right. %
\begin{array}[t]{@{}l@{}}\left.#2 \right\}\end{array}}
\begin{document}
Works, but integral sign and absolute value get squashed down smaller than they ought to appear in display math:
\[
\setst{f}{f(t) > 0 \text{ for all $t$ with } 0 < t < 1\\
\text{and }\left|\int_{0}^{1}e^{-\frac{1}{2} t^{2}}f(t) dt\right| \leq 1 }
\]
\end{document}
And the output from that, with the two braces indicated:
Best Answer
I suggest pursuing a less-than-fully-automatic approach to sizing the outer curly braces. In the code below the default size of the outer curly braces is
\big
, but this may be changed by specifying an optional sizing-related parameter, which may take on valuesBigg
,bigg
,Big
(and, of course,big
). I favor a minimum size ofbig
(rather than normalsize) as IMNSHO, the curly braces simply need to "look" a bit more prominent.In the following screenshot, the curly braces in the first example are of size
\big
(the default); they are of size\bigg
in the second, where\displaystyle
is in effect for the second row.