LaTeX Write Two Equations at the Same Line in Latex

  • Thread starter Thread starter EngWiPy
  • Start date Start date
  • Tags Tags
    Latex Line
Click For Summary
To write two equations on the same line in LaTeX, users can utilize various methods, including spacing characters, matrices, or the tabular environment for better alignment. The tabular* environment allows for flexible column widths, which can be adjusted to fit the page layout. For separate numbering of equations, the minipage environment is effective, allowing each equation to be placed in its own block. This setup ensures that the equations are displayed at the extreme edges of the page while maintaining proper formatting. Overall, these techniques provide multiple options for presenting equations in LaTeX.
EngWiPy
Messages
1,361
Reaction score
61
Hello,

How can I write two differents equations at the same line using Latex? for example:

\begin{align}<br /> y_1(x)=&amp;x^2\\<br /> y_2(x)=&amp;2x+1<br /> \end{align}

Thanks in advance
 
Physics news on Phys.org
You could either "jimmy" it by just putting spacing characters in between, or put them in a matrix.
<br /> y_1(x) = x^2 \,\,\,\,\, y_2(x) = 2x+1<br />
Code:
y_1(x) = x^2 \,\,\,\,\, y_2(x) = 2x+1
Or a slightly more elegant
<br /> \begin{array}{cc}<br /> y_1(x) = x^2 &amp; y_2(x) = 2x+1 \\<br /> \end{array}<br />
Code:
\begin{array}{cc}
y_1(x) = x^2 & y_2(x) = 2x+1 \\
\end{array}
 
minger said:
You could either "jimmy" it by just putting spacing characters in between, or put them in a matrix.
<br /> y_1(x) = x^2 \,\,\,\,\, y_2(x) = 2x+1<br />
Code:
y_1(x) = x^2 \,\,\,\,\, y_2(x) = 2x+1
Or a slightly more elegant
<br /> \begin{array}{cc}<br /> y_1(x) = x^2 &amp; y_2(x) = 2x+1 \\<br /> \end{array}<br />
Code:
\begin{array}{cc}
y_1(x) = x^2 & y_2(x) = 2x+1 \\
\end{array}

First, thank you for replying. Second, I want the equation numbers, and the two equations be at the two extreme edges (left and right) of the page. Can we do that?
 
OK, I got something. I had to switch to the tabular environment; it has some better column definition flexibility (furthermore, you really need to use the tabular* environment). Either way, you get the optional table width with you will typically want to use
Code:
0.8\textwidth
or something like that. For the purpose of displaying it proprely on this webpage, I have chosen an arbitrary width. The
Code:
}{@{\extracolsep{\fill}}
is important as it let's the columns have "rubber widths" so they decide how wide they should each be.
<br /> \begin{equation}<br /> \begin{tabular*}{20cm}{@{\extracolsep{\fill}} l r }<br /> y_1(x) = x^2 &amp; y_2(x) = 2x+1 \\<br /> \end{tabular*}<br /> \end{equation}<br />
Code:
\begin{equation}
\begin{tabular*}{20cm}{@{\extracolsep{\fill}} l r }
  y_1(x) = x^2 & y_2(x) = 2x+1 \\
\end{tabular*}
\end{equation}
Hope that helps.

edit: Check out thsi page for more information
http://en.wikibooks.org/wiki/LaTeX/Tables
 
Last edited:
Have you thought of minipage environment. It should allow you to do such a thing.

Cheers
 
my first reply

<br /> P_h^a_n^i /, /, /, 985685<br /> 9//1//2<br />
 
fatra2 said:
Have you thought of minipage environment. It should allow you to do such a thing.

Cheers

Ok, thank you. you are right, minipage environment solves the issue. Here is the code:

\begin{minipage}{0.5\linewidth}<br /> \begin{equation}<br /> y_1(x)=x^2<br /> \end{equation}<br /> \end{minipage}<br /> \hspace{0.5cm}<br /> \begin{minipage}{0.5\linewidth}<br /> \begin{equation}<br /> y_2(x)=2x+1<br /> \end{equation}<br /> \end{minipage}

Thank you all guys.

Regards
 
Oh you wanted the equations numbered seperately. Well glad you found it.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 4 ·
Replies
4
Views
13K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 11 ·
Replies
11
Views
8K
  • · Replies 9 ·
Replies
9
Views
6K
  • · Replies 4 ·
Replies
4
Views
3K