# How to write two small equations in the same line?

I am trying to write equations x=a and x=b in the same line.

\begin{eqnarray}

\end{eqnarray}


does not provide the solution. Kindly help me.

• ..$x=a$ and $x=b$ ... – David Carlisle Jan 3 '16 at 12:28
• And what if the equations are long ? like x = max{n/2,l/2} and y = min{n/2,l/2} . – monalisa Jan 3 '16 at 12:30
• they may break over the line as the lines in the paragraph are arranged, but that would be a different question since this question explictly asks for two short equations fitting on a line. – David Carlisle Jan 3 '16 at 12:31
• why did you tag this with biblatex? – David Carlisle Jan 3 '16 at 12:33
• ...and why do you use the outdated eqnarray environment? – user31729 Jan 3 '16 at 12:40

You could use the align environment for such purposes.

\documentclass{article}

\usepackage{mathtools}
\begin{document}
\begin{align}
x &= a & x &= b \\
x &=\max(n/2,l/2)  & x &= \min(n/2,l/2)
\end{align}
\end{document}


I assume you want the pairs of equations to occupy an entire line and that the amount of whitespace between the pair should equal that to the left of the first equation and to the right of the second equation. If this assumption is correct, you could use \hfill instructions as is done the following code. (The \hrule directives are used merely to illustrate with width of the text block.)

\documentclass{article}
\begin{document}
\hrule

\bigskip\noindent
$\hfill x=a \hfill x=b \hfill$

\bigskip\noindent
$\hfill x = \max(n/2,l/2) \hfill y = \min(n/2,l/2) \hfill$

\bigskip\hrule
\end{document}