LyXHelp with aligning math formula and numbering

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
maxiv
Posts: 11
Joined: Thu Apr 28, 2011 4:43 pm

Help with aligning math formula and numbering

Post by maxiv »

I hope you guys can help me with this.

I have a rather lengthy formula that i would like to type in LyX. Since it stretches over multiple lines i would like to align it beneath the equal-sign of the first line. also i would like to number the formula with (1) and align that number to the very right. A screenshot of what it should look like is attached.

Can you guys please help me and tell me how to make it happen?
Attachments
The desired result.
The desired result.
formula-alignment.jpg (16.08 KiB) Viewed 11154 times
Last edited by localghost on Mon May 02, 2011 11:52 am, edited 1 time in total.
Reason: Preferably no external links. Attachments go onto the forum server where possible.

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Help with aligning math formula and numbering

Post by meho_r »

Hi. Try LyX's Math manual (Help > Math), section 18.
maxiv
Posts: 11
Joined: Thu Apr 28, 2011 4:43 pm

Re: Help with aligning math formula and numbering

Post by maxiv »

Thank you very much, i will try that right now.

I have another question regarding the math:

when i want to preview the document i'm working on and i press the DVI button, the following errors occur:

Display math should end with $$.
Description:

Ebene.\begin{equation}$\log
M_{sdt}=\alpha_{sd}+\beta_{0}\log W_{st}+\...
The `$' that I just saw supposedly matches a previous `$$'.
So I shall assume that you typed `$$' both times.


And the other error:
Missing $ inserted.
Description:

Ebene.\begin{equation}$\log
M_{sdt}=\alpha_{sd}+\beta_{0}\log W_{st}+\...
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.



But that doesn't really help me..can someone please tell me what I'm doing wrong? I simply used the math editor for my formula and typed the greek letters by using \alpha \beta and so on.


thanks!
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Re: Help with aligning math formula and numbering

Post by meho_r »

Could you create an example .lyx file which shows the issue, put it in a ZIP archive and attach it to your next post, please?
maxiv
Posts: 11
Joined: Thu Apr 28, 2011 4:43 pm

Re: Help with aligning math formula and numbering

Post by maxiv »

well now i got it to work!

i created the formula and the moment i leave \begin{equation} and \end{equation} away it works. but as soon as i put those commands back the errors comes back.

is there any other way to number the formulas?

also when exporting the file to DVI with MiKTeX Yap, i get the error that not all fonts could be loaded. alpha, beta etc. are then displayed as regular letters a, b and so on.
maxiv
Posts: 11
Joined: Thu Apr 28, 2011 4:43 pm

Re: Help with aligning math formula and numbering

Post by maxiv »

could it be that I'm simply missing a package for miktex that i have to install with the package installer? there are so many packages, i just don't know which one i should install.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Help with aligning math formula and numbering

Post by Stefan Kottwitz »

Hi maxiv,
maxiv wrote:the following errors occur:

Display math should end with $$.
Description:

Ebene.\begin{equation}$\log
...
And the other error:
Missing $ inserted.
Description:
$ is for math in text, don't use it within an equation environment. Just write:

Code: Select all

\begin{equation}
\log ...
Stefan
LaTeX.org admin
maxiv
Posts: 11
Joined: Thu Apr 28, 2011 4:43 pm

Help with aligning math formula and numbering

Post by maxiv »

Stefan_K wrote:Hi maxiv,
maxiv wrote:the following errors occur:

Display math should end with $$.
Description:

Ebene.\begin{equation}$\log
...
And the other error:
Missing $ inserted.
Description:
$ is for math in text, don't use it within an equation environment. Just write:

Code: Select all

\begin{equation}
\log ...
Stefan
thank you, i solved that problem by leaving the {equation} commands out and just clicking the math symbol in LyX. But I still need my equations to be numerized.

And how to i export it to DVI and display it properly? Are there any further packages for MiKTeX I need to install?!
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Help with aligning math formula and numbering

Post by meho_r »

Please, take a look at LyX's Math manual (Help > Math), section 19. Basically, you can get a numbered formula simply by using menus: Insert > Math > Numbered formula (or by pressing Ctrl+Alt+N shortcut). There is no need to enter \begin{equation} manually.
maxiv
Posts: 11
Joined: Thu Apr 28, 2011 4:43 pm

Help with aligning math formula and numbering

Post by maxiv »

meho_r wrote:Please, take a look at LyX's Math manual (Help > Math), section 19. Basically, you can get a numbered formula simply by using menus: Insert > Math > Numbered formula (or by pressing Ctrl+Alt+N shortcut). There is no need to enter \begin{equation} manually.
yes but then i don't have a formula that stretches over multiple lines with all lines subsequent to the first one being aligned to the right. or am i missing something?
Post Reply