Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I can't seem to make this work. I want the matrix and the second equation with the same equation number.

\begin{equation}
\begin{aligned}
[{\bf Z}] &=\begin{bmatrix}
R_1+j\omega L_1 & -j\omega M \\
j\omega M & -R_2-j\omega L_2
\end{bmatrix} \\
k &=\frac{M}{\sqrt{L_1L_2}}
\end{aligned}   
\end{equation} 
share|improve this question
    
If you're referring to {\bf Z} as a "vector" or "matrix", then consider reading How can I get bold math symbols? –  Werner Jun 10 at 4:24

1 Answer 1

up vote 8 down vote accepted

This is actually quite a subtle thing that has come up in a few different varieties on the site.

The aligned environment takes an optional argument; in your use case, you have been unlucky enough to select a combination that makes LaTeX think that you are supplying the aligned environment with the argument {\bf Z}, when actually you intend to skip the optional argument altogether, and begin your content with [{\bf Z}].

So, we have to tell LaTeX not to look for an optional argument, which we can do using \relax.

% arara: pdflatex
\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{equation}
\begin{aligned}\relax
[{\bf Z}] &=
\begin{bmatrix}
R_1+j\omega L_1 & -j\omega M \\
j\omega M & -R_2-j\omega L_2
\end{bmatrix} \\
k &=\frac{M}{\sqrt{L_1L_2}}
\end{aligned}   
\end{equation} 
\end{document}

Alternatively, you can 'protect' [{\bf Z}] by using {[\bf Z]}, which is demonstrated in "[" as first character in table row. However, as discussed in the comments, and in What is the difference between \relax and {}?, \relax is the safer option.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.