6

I am trying to create the following equation where I have n given that y where y must be split among two lines. This is the code I have so far (which will give me the big braces).

\left\{ 
  \begin{matrix}
  ...
  \end{matrix}
\right\}

Any idea how I can fill the matrix to obtain the following please? Thanks

enter image description here

7

Not sure what you have in mind for the dots. Here, I show it with either a matrix or an aligned block.

Thanks to egreg for the \middle reminder.

\documentclass{article} 
\usepackage{amsmath}
\begin{document}
\[
  \left\{ n\,\middle| \begin{matrix}2x & y\\3x & 2y\end{matrix}\right\}
\]
\[
  \left\{ n\,\middle| \begin{aligned} z &= 2x + y\\z &= 3x - 2y\end{aligned}\right\}
\]
\end{document}

enter image description here

| improve this answer | |
  • @egreg I sure did, though I can't say that I am enamored of the spacing. – Steven B. Segletes Mar 28 '19 at 12:26
9

Use mathtools:

\documentclass{article}
\usepackage{mathtools}

\DeclarePairedDelimiterX{\Set}[1]{\lbrace}{\rbrace}{\activatebar #1}

\newcommand{\activatebar}{%
  \begingroup\lccode`~=`| \lowercase{\endgroup\let~}\activebar
  \mathcode`|="8000
}
\newcommand{\activebar}{\nonscript\;\delimsize\vert\nonscript\;\mathopen{}}

\begin{document}

\[
\Set{n|n>0}
\Set[\big]{n|n>0}
\Set*{n|\begin{matrix} n>0 \\ n<42 \end{matrix}}
\]

\end{document}

enter image description here

Important note: don't use | for other purposes in the argument of \Set; it shouldn't be used anyway, preferring \lvert and \rvert for the absolute value. Or, of course, with macros based on mathtools, such as

\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.