2

I have a list, where the item content is supposed to be systems of two linear equations, grouped with a big left brace. I would like the top equation from the system to have the same baseline as the item number. The problem is that the brace always centers on the main line (the line of the item number). So even if I succeed at getting the equations top-aligned, the brace is still mis-centered.

This question was closed as a duplicate of this question. If you think that this is a duplicate, please read below to see where I explicitly demonstrate that the answers there do not help. (And besides, it's really a different question even if you feel an answer there applies here.)

Here is what I would try first:

\begin{enumerate}
\item 
  $\left\{
    \begin{aligned}
      x &= 0\\
      y &= 1
    \end{aligned}
  \right.$
\end{enumerate}

centers the system so that it is too high. The first equation is not on the same baseline as the item number. (Screen shot below.) So I try top-aligning:

\begin{enumerate}
\item 
  $\left\{
    \begin{aligned}[t]
      x &= 0\\
      y &= 1
    \end{aligned}
  \right.$
\end{enumerate}

Now the top equation is aligned where I want it, but the brace is too tall. (Screen shot below.) This is because the brace remains centered on the first line, and grows in both directions to encompass content, including the "down-shifted" aligned environment. So I try using vcenter after reading some tex.se posts:

\begin{enumerate}
\item 
  $\left\{\vcenter{\hbox{$
    \begin{aligned}[t]
      x &= 0\\
      y &= 1
    \end{aligned}$}}
  \right.$
\end{enumerate}

and the output is just like the first try. (Screen shot below.)

Here is a screen shot of these three tries, respectively.

enter image description here

Is it possible to do what I am trying to do?


EDIT: It's been suggested that this question is a duplicate of this one. At this point, this questions is even closed because of this misunderstanding.

That question is not this question, and I see no way to adapt the answers there to answer this. But to demonstrate that I really am looking into that question and its answers and demonstrate that things just don't work out, here is what it looks like if you try the highest-voted answer there:

\usepackage[fleqn]{amsmath}
\newcommand\mathitem{\item\leavevmode\vspace*{-\dimexpr\baselineskip+\abovedisplayskip\relax}}
    \begin{enumerate} %
        \mathitem \begin{align*}
          x&=0\\
          y&=1
        \end{align*}
    \end{enumerate}

(Screen shot below.) This uses actual display mode, not inline math with displaystyle. And there is no way to get the big left brace. So I try the following. Note I do not expect the following to work, since this answer from the other question is designed for display mode math, not inline math (that happens to use displaystyle):

\usepackage[fleqn]{amsmath}
\newcommand\mathitem{\item\leavevmode\vspace*{-\dimexpr\baselineskip+\abovedisplayskip\relax}}
    \begin{enumerate} %
        \mathitem $\left\{\begin{aligned}
          x&=0\\
          y&=1
        \end{aligned}\right.$
    \end{enumerate}

It does not work. It looks like my original example. Screen shot below of these last two tries:

enter image description here

Now I look at the accepted answer to that question, which uses macros like \Longunderstack from a certain package. This macro is stacking math vertically. I fail to see how it can be used to get aligned equations and a big left brace. It appears you feed this macro math content, so I try:

    \begin{enumerate}  %result looks fine, but code ugly
        \item 
%       FOR SIMPLE REGULAR-HEIGHT STACKS
        \Longunderstack{\begin{aligned}
          x&=0\\
          y&=1
          \end{aligned}}
        \item 
%       FOR IRREGULAR HEIGHT STACKS IN \textstyle
        \Shortunderstack{\begin{aligned}
          x&=0\\
          y&=1
          \end{aligned}}
        \item 
%       FOR IRREGULAR HEIGHT STACKS IN \displaystyle
        \tabbedShortunderstack{\begin{aligned}
          x&=0\\
          y&=1
          \end{aligned}}
    \end{enumerate}

The third item here causes compilation to fail. If I remove the third item, I get:

enter image description here

Braces aside, this is not top-aligned. So I try without the aligned:

    \begin{enumerate}  %result looks fine, but code ugly
        \item 
%       FOR SIMPLE REGULAR-HEIGHT STACKS
        \Longunderstack{x=0\cr y=1}
        \item 
%       FOR IRREGULAR HEIGHT STACKS IN \textstyle
        \Shortunderstack{x=0\cr y=1}
    \end{enumerate}

Better, but the equals signs are not really aligned, so this won't help when I apply it to more general equations. It looks like this:

enter image description here

But now, how am I supposed to get the brace back in without the aligned or some similar array environment?

So I tried the answers from the other post. And as I've argued in the comments, they don't work, and never would have worked. Because that question is a different question. That question is about vertical space from display mode math. My question is about how an extensible brace gets centered and its height gets computed.

  • @MadyYuvi This is different. For one thing, that is about display math mode, which is not part of my question. But really my question is about the brace: how can it be recentered so its "tip" is down lower at the true center of the two equations as they were typeset in the second example. – alex.jordan Jul 12 at 15:36
  • aligned is a display environment, even if you incorrectly use it in $. So you should combine your first approach with one of the duplicate's answers. (And look into the cases environment.) – Teepeemm Jul 12 at 16:39
  • @Teepeemm The blank line I see in my second example is a different animal altogether than the blank line that someone gets when they use \[...\]. I'm sorry I am failing to get people to see this. Anyway have you read the "duplicate's" answer? It uses special aligned equation environments from a certain package, and there is no way to get \left\{...\right. into those special environments. At least no obvious way from the way those answers are written. – alex.jordan Jul 12 at 16:45
  • @Teepeemm "aligned is a display environment". It does use \displaystyle. \displaystyle is not the same thing as display mode. Display mode, among other things, puts the math on its own centered line with surrounding vertical space. That is not a factor in anything happening in my question, and I think you are confusing \displaystyle with display mode. – alex.jordan Jul 12 at 18:16
  • But your main problem is vertical spacing, so the duplicate is definitely relevant. But I do see that the duplicate is not quite solving your problem. I've posted a new answer there that seems to work. – Teepeemm Jul 13 at 0:11
4

You should use the package delarray:

\documentclass{article}
\usepackage{amsmath}
\usepackage{delarray}
\begin{document}
\begin{enumerate}
\item 
$\begin{array}[t]\{{r@{}l}.
      x & {} = 0\\
      y & {} = 1
\end{array}$
\end{enumerate}
\end{document}

enter image description here

1

You could also use \raisebox. To try to align the baselines, I needed to measure the height before adding the brace.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{enumerate}
\sbox0{$\begin{aligned}
      x &= 0\\
      y &= 1
    \end{aligned}$}%
\item \raisebox{\dimexpr\ht\strutbox-\ht0}{$\left\{\usebox0\right.$}
\end{enumerate}
\end{document}
0

An approach I'm fond of is to use the optional argument to line break to move things upward. A bare \\ would complain that there's no line to end, so we first put in an \mbox:

\documentclass{article}
\usepackage[fleqn]{amsmath}
\newcommand\mathitem{\item\mbox{}\\[-\baselineskip]}
\begin{document}
 \begin{enumerate} %
  \mathitem $\left\{\begin{aligned}
          x&=0\\
          y&=1
   \end{aligned}\right.$
 \end{enumerate}
\end{document}

You can also get a similar result with \mathitem $\begin{cases}x=0\\y=1\end{cases}$, although it doesn't perfectly align on the =.

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.