1

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.

  • 3
    ..$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
  • 1
    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
7

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}

enter image description here

| improve this answer | |
4

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.)

enter image description here

\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}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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