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:
\left\{
and\right\}
span from the top ofx
to the bottom ofS_3
(say)? Or should they have differing heights?#2
contains a double backslash, which ends the array line before processing reaches\right.
I'm not sure what result you want, so I don't know what fix to suggest.\left\{
and\right\}
should span from the initialx
to the finalS_3
. I tried to do that directly, but think there may be an issue with putting a single\left\{
before the array but then a single\right\}
inside the array.\setst
except that the printed braces should be proportionately larger, as in the usual situation with\left\{
and\right\}
.\bigl\{
...\bigr\}
. Will the expected expansion be larger than that?