I've been trying to typset an equation which, at a certain point, spans several lines, but is a single step (so no numbering may occur). For this I used newline, but this doesn't seem to work. How do I resolve this?
code:
% SLOPPY EQUATION!!!! EDIT !!!!
\begin{equation}
K_t = [\hspace{1pt}^{1}K_t ,\hspace{1pt}^{2}K_t, \ldots, \hspace{1pt}^{m}K_t]^T \in \mathbb{R}^m , \hspace{1cm} t = 1, 2, \ldots, M \newline
\hspace{1pt}^{i}f_{j_{1}j{2}\ldots j{M}} = \frac{\delta^{M}f(z)}{\delta^{j1}z\delta^{j2}z\ldots \delta^{jM}z} \newline
e_i = [0,0,\ldots,0,1,0,\ldots,0]^T \in \mathbb{R}^m \newline
\textit{met 1 op de i-de plaats in $e_i$ .}
\end{equation}
Best Answer
To make your multiline equation work, and to add the spacing that you want more easily and in a way that will make TeX complain less, there are some things you should do.
You're already using the
amsmath
package, which is good. You can use the multiline math environments in it, such asalign
andalign*
, which are in my experience the most useful numbered and un-numbered environments for multi-line equations, respectively. This will allow you to typeset nice multi-line equations with a certain amount of control.In those environments, just the command
\\
is used for making new lines. You can also tweak the vertical spacing, if nexeccary, with an optional argument, e.g.\\[1ex]
or\\[-0.5ex]
.For spacing in mathematics, you should use the
\mspace
command rather than\hspace
. The arguments of\mspace
are measured in units ofmu
, which are 1/18 of anem
. There are also shortcuts for spacing in mathmode:\qquad
=\mspace{36mu}
\quad
=\mspace{18mu}
\;
=\mspace{5mu}
\:
=\mspace{4mu}
\,
=\mspace{3mu}
\!
=\mspace{-3mu}
To make your mathematics also a bit easier to read, you can use macros to take care of some of the more picky or repetitive bits of typesetting, which might help make the markup easier to read. For instance, in your case, I would put the following into the pre-amble:
Adding some extra whitespace will also make it easier for you to read and edit your equations later.
Here's what the markup for your equations look like after a makeover:
Markup.
Result.