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
arrayenvironment.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 ofxto the bottom ofS_3(say)? Or should they have differing heights? – Werner Feb 22 '17 at 20:26#2contains 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. – Ian Thompson Feb 22 '17 at 20:28\left\{and\right\}should span from the initialxto 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. – murray Feb 22 '17 at 20:29\setstexcept that the printed braces should be proportionately larger, as in the usual situation with\left\{and\right\}. – murray Feb 22 '17 at 20:31\bigl\{...\bigr\}. Will the expected expansion be larger than that? – Werner Feb 22 '17 at 20:49\left\{and\right\}are required so they will stretch sufficiently. – murray Feb 22 '17 at 20:54arrayhas a large element inside it? Currently you can expand based on the left-hand side, but not the first row of thearray. There may some manual work required for this to work as expected. Maybe. – Werner Feb 22 '17 at 21:03\phantomexpression to size the brace large enough on one or the other of the two printed rows. I'm willing to live with that provided I can take care of the rest. – murray Feb 22 '17 at 21:09\phantom, but a zero-width box whose height was that of the tall expression (via thecalcpackage's\totalheightof). – murray Feb 22 '17 at 21:21array? – Mico Feb 22 '17 at 21:26