amsmath – Best Way to Create Complex Formulas in LaTeX
amsmathmatrices
I'm trying to create this formula (the one with the matrices) for my essay in latex but I'm having a hard time finding the best way of going about it.
Best Answer
The coding of this matrix product is quite straightforward, just take the time to write the four matrices that make up the formula with indexed variables.
The error has been caused by accidentally nesting align* and equation, as Ben informed.
Displayed math environments cannot be nested. However, there are environments such as aligned and split which work inside an equation environment.
This answer has been posted and marked as community wiki, in the hope that after an upvote this question isn't marked as "unanswered" by the site any more.
When using a formula that introduces new variables I would try very hard to describe them in the text, either immediately before, or immediately after the formula.
Something like
or
\documentclass{article}
\begin{document}
Assuming that $n$ is the number of weeks, and $M$
represents `Missed', then a formula for something is
\begin{equation}
\sum_{i=0}^{n}\frac{\left(\omega_MM_i+\omega_PP_i+\omega_TT_i\right)\omega_i}{n}
\end{equation}
The formula for something is
\begin{equation}
\sum_{i=0}^{n}\frac{\left(\omega_MM_i+\omega_PP_i+\omega_TT_i\right)\omega_i}{n}
\end{equation}
where $n$ is the number of weeks, and $M$ represents `Missed'.
\end{document}
Best Answer
The coding of this matrix product is quite straightforward, just take the time to write the four matrices that make up the formula with indexed variables.