where [tex]g(x)[/tex] is a very long term, and I have to split it into two halfs, but I want the second half be exactly under the '+' sign, not under the '=' sign. How can I do that?
I think there is some information on this in "The Not So Short Guide to [tex]\LaTeXe[/tex]." You should be able to google it. I don't remember exactly, but I think you need to use some & to create something like tabs?
Anyway, I'm pretty sure it's in there (Chapter 4?).
where [tex]g(x)[/tex] is a very long term, and I have to split it into two halfs, but I want the second half be exactly under the '+' sign, not under the '=' sign. How can I do that?
Thanks in advance
There are quite a number of ways to do things like this, but the "align*" environment makes it easy to do exactly what you describe. Click the following to see code:
Even better, use the AMSLaTex macros, which are part of the standard LaTeX distribution.
A Short Math Guide for LaTeX: ftp://ftp.ams.org/pub/tex/doc/amsmath/short-math-guide.pdf
amsmath user's guide: ftp://ftp.ams.org/pub/tex/doc/amsmath/amsldoc.pdf
Yes, but I need this inside a split environment. When I use split alone it is ok, but when I use split inside split, or align inside split environment, the equation inside the inner environment becomes above and under the '+' sign, and not in the same line. This is exactly my problem.
Yes, but I need this inside a split enviroment. When I use split alone it is ok, but when I use split inside split, or align inside split enviroment, the equation inside the inner environment becomes above and under the '+' sign, and not in the same line. This is exactly my problem.
Regards
When I write equations, I like to use a split environment nested within an align environment. To do multiline equations, I do stuff like this:
The spacing can be adjusted by putting spacing after the & character. If you need to put a new line inside a parenthesis block ( eg. \left( \right) ), I have another command, \parenthnewln
I think I got you. In certain math packages, more than one alignment character "&" is allowed, as long as the same amount are used each line. In this case, you could put one at the equals sign and one at the plus sign . I'm not sure how its treated here, but you could do something like
After preview, its apparent that it is not allowed with the physics forums packages. So, try the other posters suggestion of the align environment, or just break it up into two equations.
Edit: Wait so just to clarify, this isn't what you want?
[tex]
\begin{equation}<br />
\begin{split}<br />
f(x) = 1 +& g(x) \\<br />
=1 +& sin(x) + cos(x) + \cdots \\<br />
+&tan(x)<br />
\end{split}<br />
\end{equation}[/tex]
Thank you both Fenn and minger. Both codes are working well. But I want to ask: in the code that minger gave, the '&' character was not used to align the '=' characters. How is that?
That alignment example looks very nice in the forums, minger. Which math package allows you to do that? When I use only amsmath in my document, my compiler complains about the multiple alignment tabs per line.
That alignment example looks very nice in the forums, minger. Which math package allows you to do that? When I use only amsmath in my document, my compiler complains about the multiple alignment tabs per line.
It's because I got lucky. Now, there are math packages which allow multiple alignement tabs (I think they're called) per line, as I mentioned, as long as they are the same number per line.
In this case, I simply got lucky because on each line before the + sign, there is only a 1 and an equals sign. It lines up by default really.
Ooh, pretty. Yes, that looks very nice. With my suggestion earlier of defining new commands, it is fairly straightforward to split the equation when it is within parenthesis:
One thing I'd like to learn is how to number multiline equations with subindices like (a) (b) (c).
Something like
[tex]
\begin{align}<br />
I = \begin{pmatrix} 1 & 0 \\ 0 & 1\end{pmatrix}<br />
\end{align}<br />
<br />
\end{align}<br />
\begin{align}<br />
f &= ma\\<br />
E &= mc^2\\<br />
\pi &\text{ is exactly three!}<br />
\end{align}[/tex]
What I would like to see in this example, is the first line numbered (1), as it is now, and then the group of three numbered (2a), (2b), (2c).
Does anyone have any suggestions that would accomplish this? I've noticed that the split environment clusters the equations together into one equation number, but that really only helps if I am defining a multi-line equation like where this topic started.
Could you please post an example of what you are trying to do? These forums will parse LaTeX formatting if you enclose it within the a set of [ tex ] and [ /tex ] delimiters (remove the spaces to get them to work.)
Here's a quick tweaking of your markup, where I have used a modified version of these \newln and \parenthnewln commands that I suggested in an earlier post:
I have put new lines within an equation using the \newln command. If the new line is within a set of parenthesis (the \left[ and \right]), then I use \parenthnewln.
Remember that you can always add white space (blank lines need the % comment in equation environments) to make your work more legible.
Fenn, I labeled the code \end{split}\label{eq:eu}\end{eqnarray} but the equation number disappears. I want it to be on the second formula.why is this so? the referencing works fine as the equation number shows
Hi Fenn, I have tried on other LONG equations that I have. Unfortunately, not all worked out fine. Some were indented to half of the page and gone missing for the second half. I realize that this happens with multi equations where for example
Hope you can help me with this problem. I have tons of equations to adjust. TQ so much
Fenn said:
Here's a quick tweaking of your markup, where I have used a modified version of these \newln and \parenthnewln commands that I suggested in an earlier post:
I have put new lines within an equation using the \newln command. If the new line is within a set of parenthesis (the \left[ and \right]), then I use \parenthnewln.
Remember that you can always add white space (blank lines need the % comment in equation environments) to make your work more legible.
Working with equation formatting and layout in LaTeX can get very tedious if the equation is very long. I suggest you start with smaller equations and practice using the markup to do what you want.
A very useful technique is to comment (%) out sections of equations while you're setting it up, and slowly removing the comment markers as you build it. When I posted my suggestion to your problem, I commented out all but the first line, checked to see what it looked like, and slowly introduced more of the equation as I became more familiar with its content, and the overall formatting use.