[Tex/LaTex] Two equations in one line

equations

How can I write these two equations in a single row:

∀i,j 1≤i,j≤n and cij = ∑ aikbkj 

Thank you

Best Answer

Even ordinary equation enable to write two equation in the same row (transcribed in classic math notation):

\begin{equation}
\forall i,j:\ 1\leq i,j\leq n
   \quad\mathrm{and}\quad 
c_{ij} = \sum a_{ik} b_{kj}
\end{equation}

where with \mathrm is mimic surrounding text font. In this case, both equation will have common number. Without equation numbering just use equation* or \[ ... \].

With package amsmath or mathtools you can write:

\documentclass{article
\usepackage{mathtools}

    \begin{document}
\begin{equation}
\forall i,j 1\leq i,j\leq n 
   \quad\text{and}\quad 
c_{ij} = \sum a_{ik} b_{kj}
\end{equation}
or if you liked
    \begin{equation}
\forall i,j:\ 1\leq i,j\leq n
   \text{ and }
c_{ij} = \sum a_{ik} b_{kj}
\end{equation}
    \end{document}

which gives:

enter image description here

or use math environments, which are defined by amsmath or mathtools. For example: gather. In this case you can use \text{ ...} which for text use font from main text together with spaces (what mathrm not).

In the case, that those equations is in the text, than seems to be naturally to write (split them into two math expression):

some text $\forall i,j:\ 1\leq i,j\leq n$ and $c_{ij} = \sum a_{ik} b_{kj}$ some more text

Related Question