0

I am trying to get my equation to appear like this: enter image description here however, I am having a problem getting my program to compile properly using this alignat environment. Can you please help my get the equation to show up properly. Thanks.

Here is my code:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
{\mathbf{u}} & = H^{-1}({\mathbf{P}}_{T}-B) \\
& = \begin{bmatrix}
\sin\theta_{1} & \cos\theta_{1} \\
\cos\theta_{1} & \sin\theta_{1}
\end{bmatrix}^{-1}
\begin{split}
&\left(
\begin{bmatrix}
(L_{1} + \delta r_{3v} + r_{3v})\cos\theta_{1} + r_{2}\sin\theta_{1} \\
(L_{1} + \delta r_{3v} + r_{3v})\sin\theta_{1} - r_{2}\cos\theta_{1}
\end{bmatrix}\right.\\
& \left. - X \right)
\end{split}
\end{align}
Joe
  • 9,080
  • The problem is that you're trying to split a \left( ... \right) construct across lines -- not allowed. – Mico Nov 01 '15 at 18:50
  • Hello @Micro. I tried to modify the code based on the link that you sent me to (please see modified code in question), however, I still am having a problem getting the code to compile. Can you tell me what I am doing wrong? – Joe Nov 01 '15 at 19:04
  • 1
    you can't split up \left and \right across line breaks or & divisions. each \left ... \right pair has to be complete within a "cell". if you have need of an unmatched pair, match the "real" one with an empty delimiter -- \left. or \right. (in the proper order). if one of the lines doesn't have the same height, then you will need a \vphantom to stretch it; there are quite a few questions that address that situation, including the cited one. – barbara beeton Nov 01 '15 at 19:20
  • Hello, I keep getting the error now ''Extra }, or forgotten \right. – Joe Nov 01 '15 at 19:38
  • Even after the edit, there's still \left( on one line and \right) on the following line. Why would this work now, given that it didn't work earlier? – Mico Nov 01 '15 at 19:48
  • A separate issue: the linebreak before -X seems unnecessary. What are you trying to achieve with the linebreak? – Mico Nov 01 '15 at 19:51
  • Hello @Mico, X is actually another matrix, but the code was getting convoluted so I just put X in its place. I have modified the question code with the \right. and \left. but I am still unsuccessful in the compilation. – Joe Nov 01 '15 at 19:58
  • Hello, I moved the & and it compiles now but it does not look right. Can you help to fix it to show like the figure above? Thanks. – Joe Nov 01 '15 at 20:55

0 Answers0