LyXNew line in equation

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
luc4
Posts: 13
Joined: Thu Apr 09, 2009 12:43 pm

New line in equation

Post by luc4 »

Hi! I would like to have an equation written on two lines (one is not sufficient), but boxed as a whole. This is what I have now:

Code: Select all

\[
\boxed{\iint_{\Omega}\left(a_{1}\nabla\upsilon\cdot\nabla\varphi+a_{0}\upsilon\varphi\right)d\boldsymbol{z}=}\]
\begin{equation}
\boxed{\iint_{\Omega}\left(f\varphi-a_{1}\nabla\gamma\cdot\nabla\varphi-a_{0}\gamma\varphi\right)d\boldsymbol{z}+\int_{\Gamma_{N}}\left(a_{1}g_{N}\varphi\right)d\boldsymbol{S},\;\forall\varphi\in H^{1}\left(\Omega\right)}.\label{eq:General-weak-formulation-explicit}\end{equation}
The problem is that this way I have two different boxes for the two different lines.
I tried using one equation only, but I'm not able to make a new line. I tried with C-Enter, but I got two lines with two different reference numbers... but I would like to have only one... its an equation only...
Is there any other way to have a single equation, with one single reference number, on two lines with a single box?
Thanks!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10320
Joined: Mon Mar 10, 2008 9:44 pm

New line in equation

Post by Stefan Kottwitz »

Hi,

you could use a multiline environment of amsmath, for instance aligned:

Code: Select all

\begin{equation}
\boxed{\begin{aligned}
&\iint_{\Omega}\left(a_{1}\nabla\upsilon\cdot\nabla\varphi+a_{0}\upsilon\varphi\right)d\boldsymbol{z}=\\
&\iint_{\Omega}\left(f\varphi-a_{1}\nabla\gamma\cdot\nabla\varphi-a_{0}\gamma\varphi\right)d\boldsymbol{z}
+\int_{\Gamma_{N}}\left(a_{1}g_{N}\varphi\right)d\boldsymbol{S},\;\forall\varphi\in H^{1}\left(\Omega\right).\label{eq:General-weak-formulation-explicit}
\end{aligned}}
\end{equation}
Stefan
LaTeX.org admin
luc4
Posts: 13
Joined: Thu Apr 09, 2009 12:43 pm

Re: New line in equation

Post by luc4 »

I'm trying to do this... but I'm not able to write the & symbol and the double backslash. If I write it with Lyx I get \& and \backslash... Maybe that's why I am not getting what I want...
Thanks for your answer!
User avatar
Stefan Kottwitz
Site Admin
Posts: 10320
Joined: Mon Mar 10, 2008 9:44 pm

Re: New line in equation

Post by Stefan Kottwitz »

At least it should work if you put that complete code into a TeX environment (ERT).

Stefan
LaTeX.org admin
luc4
Posts: 13
Joined: Thu Apr 09, 2009 12:43 pm

Re: New line in equation

Post by luc4 »

Yes, sure it works! Except I would like those lines to be aligned center.

The problem is that I would like to know if it is possible to do it using the equation editor of Lyx as it would be useful to have the equations written in the good looking format instead of the inline format. Simpler to see the mistakes and edit them.

Thanks again!
Post Reply