2

I am trying to break one vector to two lines in combination with an align environment. Assume the following reproducible example

\documentclass[a5paper,oneside]{book}
\usepackage[paper=a4paper,left=40mm,right=30mm,top=30mm,bottom=35mm]{geometry} 
\geometry{a4paper} 
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathtools}

\begin{document}

 Two vectors of the form 
\begin{align*}
&1. \ \beta= (4.5, 2.5, 0, 0, 1.5, 3.5 ,0, 5, 3, 3, 0, 0, 0,0, 4,0,1.5, 2.5, 0,0,0,0,4,5,4.5,0,0,0,0,0,4.5,3.5,0,0,0)^T \\
&2. \ \beta_j= [0.7;0.9], \quad  j=1,...,35. 
\end{align*}
\end{document}

enter image description here

I want to break the first line after the second "2.5" value, that the last 17 numbers should display in a new row aligned under the first value "4.5" of the first line

0

UPDATE: I think this comes closest to what you are looking for. I've used array and flalign. Also to get the equal signs aligned, I've used _{\phantom{v}} on the first line.

enter image description here

\documentclass{book}
\usepackage[a4paper,left=40mm,right=30mm,top=30mm,bottom=35mm]{geometry}
\usepackage{amssymb}
\usepackage{mathtools}

\setlength{\arraycolsep}{0pt}
\renewcommand{\arraystretch}{1.5}

\begin{document}

Two vectors of the form 
\begin{flalign*}
\begin{array}{ll}
1. \ \beta_{\phantom{j}} = (&4.5, 2.5, 0, 0, 1.5, 3.5 ,0, 5, 3, 3, 0, 0, 0,0, 4,0,1.5, 2.5,  \\ 
                &0,0,0,0,4,5,4.5,0,0,0,0,0,4.5,3.5,0,0,0)^T \\
2. \ \beta_j = [&0.7;0.9], \quad  j=1,...,35. 
\end{array} &&   
\end{flalign*}

\end{document}

Original answer

Here is a proposal using alignat, which allows you to have multiple alignment points.

As an aside, careful with your preamble. You had a5paper and a4paper options loaded. Also, note that mathtools already loads amsmath.

enter image description here

\documentclass{book}
\usepackage[a4paper,left=40mm,right=30mm,top=30mm,bottom=35mm]{geometry} 
\usepackage{amssymb}
\usepackage{mathtools}

\begin{document}

 Two vectors of the form 
\begin{alignat*}{2}
&1. \ \beta= (&&4.5, 2.5, 0, 0, 1.5, 3.5 ,0, 5, 3, 3, 0, 0, 0,0, 4,0,1.5, 2.5,\\ 
&              &&0,0,0,0,4,5,4.5,0,0,0,0,0,4.5,3.5,0,0,0)^T \\
&2. \ \beta_j= [&&0.7;0.9], \quad  j=1,...,35. 
\end{alignat*}
\end{document}

If you want the equation flush left, then you could use flalign like so.

enter image description here

\documentclass{book}
\usepackage[a4paper,left=40mm,right=30mm,top=30mm,bottom=35mm]{geometry}
\usepackage{amssymb}
\usepackage{mathtools}

\begin{document}

Two vectors of the form 
\begin{flalign*}
1. \ \beta = (&4.5, 2.5, 0, 0, 1.5, 3.5 ,0, 5, 3, 3, 0, 0, 0,0, 4,0,1.5, 2.5, & \\ 
               &0,0,0,0,4,5,4.5,0,0,0,0,0,4.5,3.5,0,0,0)^T &\\
2. \ \beta_j = [&0.7;0.9], \quad  j=1,...,35. &
\end{flalign*}
\end{document}
  • Great ! I cant vote up the answer, since I have under 15 reputations – Leo96 Aug 1 '18 at 12:34
  • I would suggest to even use a third alignment for the equation sign after beta, so that they are aligned – sporc Aug 1 '18 at 12:35
  • Is there a way to align the numbering, so that "1." and "2." are left aligned as in the flalign environment – Leo96 Aug 1 '18 at 12:36
  • I added an update to my answer. – Milo Aug 1 '18 at 13:10
0

I wouldn't use align, but enumerate in combination with multlined:

\documentclass[a5paper,oneside]{book}
\usepackage[paper=a4paper,left=40mm,right=30mm,top=30mm,bottom=35mm]{geometry} 
\geometry{a4paper} 
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathtools}

\begin{document}

Two vectors of the form 
\begin{enumerate}
\item $\beta=\begin{multlined}[t]
             (4.5, 2.5, 0, 0, 1.5, 3.5 ,0, 5, 3, 3, 0, 0, 0,0, 4,0,1.5, 2.5,\\
              0,0,0,0,4,5,4.5,0,0,0,0,0,4.5,3.5,0,0,0)^T
      \end{multlined}$
\item $\beta_j= [0.7;0.9]$, $j=1,\dots,35$. 
\end{enumerate}

\end{document}

enter image description here

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.