2

I have the following code which can generate pdf as the figure shows. However, it lacks some alignments I want. I knew there is systeme package which may be useful, yet I found it didn't work for this case. So how to get what I want as the red pen shows?

enter image description here

\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{amsmath}
\usepackage{babel}
\usepackage{pdflscape}
\usepackage{systeme}

\begin{document}
\begin{landscape}
\begin{align}\label{eq:laplace-qem}
    (L_{ijr}^{T}L_{ijr}+\left[\begin{array}{cc}q_{11} & 0\\0 & 0 \end{array}\right])\mathbf{v}_{er,x}
    +\left[\begin{array}{cc}q_{12} & 0\\0 & 0 \end{array}\right]\mathbf{v}_{er,y}
    +\left[\begin{array}{cc}q_{13} & 0\\0 & 0 \end{array}\right]\mathbf{v}_{er,z}
    +\left[\begin{array}{c}v_{e,g}q_{14}+q_{15}\\0\end{array}\right]
    +L_{ijr}^{T}b_{x} = 0 \\
    \left[\begin{array}{cc}q_{12} & 0\\0 & 0\end{array}\right]\mathbf{v}_{er,x}
    +(L_{ijr}^{T}L_{ijr}+\left[\begin{array}{cc}q_{22} & 0\\0 & 0\end{array}\right])\mathbf{v}_{er,y}
    +\left[\begin{array}{cc}q_{23} & 0\\0 & 0\end{array}\right]\mathbf{v}_{er,z}
    +\left[\begin{array}{c}v_{e,g}q_{24}+q_{25}\\0\end{array}\right]
    +L_{ijr}^{T}b_{y} = 0 \\
    \left[\begin{array}{cc}q_{13} & 0\\0 & 0\end{array}\right]\mathbf{v}_{er,x}
    +\left[\begin{array}{cc}q_{23} & 0\\0 & 0\end{array}\right]\mathbf{v}_{er,y}
    +(L_{ijr}^{T}L_{ijr}+\left[\begin{array}{cc}q_{33} & 0\\0 & 0\end{array}\right])\mathbf{v}_{er,z}
    +\left[\begin{array}{c}v_{e,g}q_{34}+q_{35}\\0\end{array}\right]
    +L_{ijr}^{T}b_{z} = 0 \\
    \left[\begin{array}{cc}q_{14} & 0\end{array}\right]\mathbf{v}_{er,x}
    +\left[\begin{array}{cc}q_{24} & 0\end{array}\right]\mathbf{v}_{er,y}
    +\left[\begin{array}{cc}q_{34} & 0\end{array}\right]\mathbf{v}_{er,z}
    +q_{44}v_{e,g}
    +q_{45} = 0
\end{align}
\end{landscape}

\end{document} 

2 Answers 2

4

To remove the equation numbering, you use the align* environment. To align at certain places, you use the & symbol. You can look at page 4 of the amsmath package documentation to see examples of how to align different equations. I also took this opportunity to insert \left( and \right) to make the () the correct size with respect to the array. See the updated example which does what you want.

\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{amsmath}
\usepackage{babel}
\usepackage{pdflscape}
\usepackage{systeme}

\begin{document}
\begin{landscape}
\begin{align*}\label{eq:laplace-qem}
    \left(L_{ijr}^{T}L_{ijr}+\left[\begin{array}{cc}q_{11} & 0\\0 & 0 \end{array}\right]\right)&\mathbf{v}_{er,x}&
    +\left[\begin{array}{cc}q_{12} & 0\\0 & 0 \end{array}\right]&\mathbf{v}_{er,y}&
    +\left[\begin{array}{cc}q_{13} & 0\\0 & 0 \end{array}\right]&\mathbf{v}_{er,z}&
    +\left[\begin{array}{c}v_{e,g}q_{14}+q_{15}\\0\end{array}\right]
    +L_{ijr}^{T}b_{x} = 0 \\
    \left[\begin{array}{cc}q_{12} & 0\\0 & 0\end{array}\right]&\mathbf{v}_{er,x}&
    +\left(L_{ijr}^{T}L_{ijr}+\left[\begin{array}{cc}q_{22} & 0\\0 & 0\end{array}\right]\right)&\mathbf{v}_{er,y}&
    +\left[\begin{array}{cc}q_{23} & 0\\0 & 0\end{array}\right]&\mathbf{v}_{er,z}&
    +\left[\begin{array}{c}v_{e,g}q_{24}+q_{25}\\0\end{array}\right]
    +L_{ijr}^{T}b_{y} = 0 \\
    \left[\begin{array}{cc}q_{13} & 0\\0 & 0\end{array}\right]&\mathbf{v}_{er,x}&
    +\left[\begin{array}{cc}q_{23} & 0\\0 & 0\end{array}\right]&\mathbf{v}_{er,y}&
    +\left(L_{ijr}^{T}L_{ijr}+\left[\begin{array}{cc}q_{33} & 0\\0 & 0\end{array}\right]\right)&\mathbf{v}_{er,z}&
    +\left[\begin{array}{c}v_{e,g}q_{34}+q_{35}\\0\end{array}\right]
    +L_{ijr}^{T}b_{z} = 0 \\
    \left[\begin{array}{cc}q_{14} & 0\end{array}\right]&\mathbf{v}_{er,x}&
    +\left[\begin{array}{cc}q_{24} & 0\end{array}\right]&\mathbf{v}_{er,y}&
    +\left[\begin{array}{cc}q_{34} & 0\end{array}\right]&\mathbf{v}_{er,z}&
    +q_{44}v_{e,g}
    +q_{45} = 0
\end{align*}
\end{landscape}

\end{document} 

output

4

This should be an array; note that bmatrix gives a better result than array for matrices.

\documentclass[english]{article}
\usepackage{amsmath}
\usepackage{babel}
\usepackage{pdflscape,array}

\begin{document}
\begin{landscape}
\[
\begin{array}{
  @{}
  r % coefficient
  @{}
  l % variable
  @{}
  *{2}{>{{}}r@{}l@{}} % two similar groups
  >{{}}r % other terms
  @{}
  >{{}}l % equals 0
}
\left(L_{ijr}^{T}L_{ijr}+\begin{bmatrix}q_{11} & 0\\0 & 0 \end{bmatrix}\right)&\mathbf{v}_{er,x}&
    +\begin{bmatrix}q_{12} & 0\\0 & 0 \end{bmatrix}&\mathbf{v}_{er,y}&
    +\begin{bmatrix}q_{13} & 0\\0 & 0 \end{bmatrix}&\mathbf{v}_{er,z}&
    +\begin{bmatrix}v_{e,g}q_{14}+q_{15}\\0\end{bmatrix}
    +L_{ijr}^{T}b_{x} &= 0 \\[3.5ex]
    \begin{bmatrix}q_{12} & 0\\0 & 0\end{bmatrix}&\mathbf{v}_{er,x}&
    +\left(L_{ijr}^{T}L_{ijr}+\begin{bmatrix}q_{22} & 0\\0 & 0\end{bmatrix}\right)&\mathbf{v}_{er,y}&
    +\begin{bmatrix}q_{23} & 0\\0 & 0\end{bmatrix}&\mathbf{v}_{er,z}&
    +\begin{bmatrix}v_{e,g}q_{24}+q_{25}\\0\end{bmatrix}
    +L_{ijr}^{T}b_{y} &= 0 \\[3.5ex]
    \begin{bmatrix}q_{13} & 0\\0 & 0\end{bmatrix}&\mathbf{v}_{er,x}&
    +\begin{bmatrix}q_{23} & 0\\0 & 0\end{bmatrix}&\mathbf{v}_{er,y}&
    +\left(L_{ijr}^{T}L_{ijr}+\begin{bmatrix}q_{33} & 0\\0 & 0\end{bmatrix}\right)&\mathbf{v}_{er,z}&
    +\begin{bmatrix}v_{e,g}q_{34}+q_{35}\\0\end{bmatrix}
    +L_{ijr}^{T}b_{z} &= 0 \\[3.5ex]
    \begin{bmatrix}q_{14} & 0\end{bmatrix}&\mathbf{v}_{er,x}&
    +\begin{bmatrix}q_{24} & 0\end{bmatrix}&\mathbf{v}_{er,y}&
    +\begin{bmatrix}q_{34} & 0\end{bmatrix}&\mathbf{v}_{er,z}&
    +q_{44}v_{e,g}
    +q_{45} &= 0
\end{array}
\]
\end{landscape}

\end{document} 

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .