1

I wrote an array environment inside align. As array have a blank space around it, I cant align it properly.

I'm using array{l}, because I do want elements on the left inside array.

\documentclass[]{report}
\usepackage{amsmath}

\begin{document}
\begin{align*}
a=&a
\\
a=&\begin{array}{l}
bb
\\
ccc
\end{array}
\end{align*}
\end{document}

enter image description here

2
  • One suggestion: could you perhaps change the title of your question to How to align entries of a matrix? That way it may get more attention, and I do not think that the problem is related to the math environment align. But this is all up to you.
    – user121799
    May 12, 2018 at 4:09
  • Try \begin{array}{@{}l@{}}. May 12, 2018 at 4:16

2 Answers 2

2

Now I think to understand what you want: the matrix* environment from the mathtools package.

\documentclass[]{report}
\usepackage{amsmath}
\usepackage{mathtools}
\begin{document}
\begin{align*}
a&=aaaa
\\
a&=\begin{matrix*}[l]
bbb
\\
cc
\end{matrix*}
\end{align*}
\end{document}

enter image description here

6
  • I didnt explain well enough and my example was poor. It should be left aligned and elements have different size. Matrix are centered. May 12, 2018 at 3:14
  • I updated my question. Maybe I have a solution with \hspace[-5pt] but I dont know if it is a general solution May 12, 2018 at 3:18
  • Your matrix is centered. as you see in my question, I use array{l}. I made an answer myself using hspace, I just dont know if it is a general solution. May 12, 2018 at 3:33
  • Now you made it general. I have already seen solutions like yours on pmatrix, but it didnt work on matrix. I didnt know things changed on matrix* environment. May 12, 2018 at 3:44
  • The spacing around = is wrong. It should be &=
    – egreg
    May 12, 2018 at 9:34
1

Remove the padding.

\documentclass[]{report}
\usepackage{amsmath}

\begin{document}
\begin{align*}
a&=a
\\
a&=\begin{array}{@{}l@{}}
bb
\\
ccc
\end{array}
\end{align*}
\end{document}

For correct spacing around the = sign, the & should go in front of it.

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.