Register to reply 
Latex question, new line 
Share this thread: 
#1
Oct3108, 11:54 PM

Mentor
P: 12,071

I can't seem to generate multiple lines within a single [ tex ][ /tex ] block. It's supposed to happen if I type \\ but it just never works for me.
Example: [tex] f_1(x) = x \\ f_2(x) = 1x^2 [/tex] The "f_{2}(x)" is supposed to start on a new line. What am I doing wrong? 


#2
Nov108, 12:05 AM

P: 362




#3
Nov108, 05:25 AM

Emeritus
Sci Advisor
PF Gold
P: 9,772

I don't think that the \\ has ever worked on the forums, it must be some kind of bug in the software. However, one can start new lines using the flalign environment.
[tex] \begin{flalign*} f_1\left(x\right) & = & & x\\ f_2\left(x\right) & = & & 1x^2\\ f_3\left(x\right) & = & & \frac{f_1}{f_2} \\ & = & & \frac{x}{1x^2} \end{flalign*} [/tex] And the code:



#4
Nov108, 08:50 AM

Mentor
P: 12,071

Latex question, new line
Thanks Hoot. So the &'s help line up the equal signs. And if I just wanted to leftjustify each line, each line would start with a &.
http://www.physicsforums.com/showthr...x+line&page=19 However, in chroot's examples the code uses TWO begin and TWO end statements, eg. \begin{equation*} \begin{split} So the single begin statement \begin{flalign*} is an improvement over that. Thanks again! RB 


#5
Nov108, 08:52 AM

Emeritus
Sci Advisor
PF Gold
P: 16,091




#6
Nov108, 09:00 AM

Emeritus
Sci Advisor
PF Gold
P: 9,772




#7
Nov108, 10:20 AM

Sci Advisor
HW Helper
PF Gold
P: 4,137

[tex]
\] This is the first line.\\ This is the second line.\\ This is the third line. \[ E=mc^2 \] This is another line. \[ [/tex] Click on the rendered image to see what I did. Maybe some [tex]\LaTeX[/tex] expert can explain what is going on. I suspect that the forum software already places us in a [tex]\LaTeX[/tex] environment... and these \[ \] break us out of it somehow. 


#8
Nov108, 04:54 PM

Mentor
P: 8,317




#9
May3011, 11:11 AM

Mentor
P: 12,071

Now that we are using MathJax, I am revisiting how to generate multiple lines within a single LaTeX code block.
EDIT: Nevermind, I found out how to do this: http://www.physicsforums.com/showthread.php?p=261329 Also, scroll down post #1 here for multiline examples: http://www.physicsforums.com/showthread.php?t=8997 Please disregard the following... I just now noticed a problem with these old posts (for example Post #'s 1 and 3 above). Right now I see the LaTeX code, without the [_tex_] tags, enclosed in a box and leftright centered in the page. I have FireFox 4 and Windows 7. Apparently MathJax doesn't like the doublebackslash newline indicator, and that is preventing the code from being processed properly. Testing: Using same code from Post #1 again: [tex] f_1(x) = x \\ f_2(x) = 1x^2 [/tex] Same code, with doublebackslash removed: [tex] f_1(x) = x f_2(x) = 1x^2 [/tex] So the question is, is it possible anymore to generate a new line within the same [_tex_] code block? Hootenanny's trick in Post #3 used to work  not that I am advocating going back to the old LaTeX system. 


Register to reply 
Related Discussions  
Latex question  Forum Feedback & Announcements  16  
Latex Question  Calculus & Beyond Homework  1  
LaTeX Question  Forum Feedback & Announcements  3  
LaTeX Question  Introductory Physics Homework  2  
Latex question  Math & Science Software  4 