Results 1 to 10 of 10

Math Help - New line in latex

  1. #1
    Junior Member
    Joined
    Jul 2008
    Posts
    40

    New line in latex

    Hello
    Im trying to write something using TeXnicCenter, and I want these to come on a new line. How do I do it?

    Code:
            \[
                f(x) = \tan(x^2) \\
                f'(x) = \left(\tan(x^2)\right)' \cdot (x^2)'
                f'(x) = 2x\left(\tan^2(x^2)+1\right)
            \]
    Thanks.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Bar0n janvdl's Avatar
    Joined
    Apr 2007
    From
    South Africa
    Posts
    1,630
    Thanks
    6
    Quote Originally Posted by MatteNoob View Post
    Hello
    Im trying to write something using TeXnicCenter, and I want these to come on a new line. How do I do it?

    Code:
            \[
                f(x) = \tan(x^2) \\
                f'(x) = \left(\tan(x^2)\right)' \cdot (x^2)'
                f'(x) = 2x\left(\tan^2(x^2)+1\right)
            \]
    Thanks.
    I may be wrong, but I think it was a double backslash ( \\ )
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by MatteNoob View Post
    Hello
    Im trying to write something using TeXnicCenter, and I want these to come on a new line. How do I do it?

    Code:
            \[
                f(x) = \tan(x^2) \\
                f'(x) = \left(\tan(x^2)\right)' \cdot (x^2)'
                f'(x) = 2x\left(\tan^2(x^2)+1\right)
            \]
    Thanks.
    See attachment:

    RonL
    Attached Thumbnails Attached Thumbnails New line in latex-gash2.png  
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Junior Member
    Joined
    Jul 2008
    Posts
    40
    Thank you both for the replies, but I've tried:

    Code:
    \documentclass[11pt,norsk,a4paper]{article}
    \usepackage[latin1]{inputenc}
    \usepackage[T1]{fontenc}
    
    \title{test}
    \author{testauthor}
    
    \tolerance = 5000                                                                             % LaTeX er normalt streng når det gjelder linjebrytingen.
    \hbadness = \tolerance                                                                     % Vi vil være litt mildere, særlig fordi norsk har så
    \pretolerance = 2000                                                                         % mange lange sammensatte ord.
    \begin{document}
    \maketitle{}
    
            \[
                f(x) = \tan(x^2) \\
                f'(x) = \left(\tan(x^2)\right)' \cdot (x^2)' \\
                f'(x) = 2x\left(\tan^2(x^2)+1\right) \\
            \]
            
    \end{document}
    But this produces the following in the pdf document (see attachment picture)

    Any ideas?
    Attached Thumbnails Attached Thumbnails New line in latex-test_latex.png  
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Senior Member bkarpuz's Avatar
    Joined
    Sep 2008
    From
    Posts
    481
    Thanks
    2

    Exclamation

    Quote Originally Posted by MatteNoob View Post
    Hello
    Im trying to write something using TeXnicCenter, and I want these to come on a new line. How do I do it?

    Code:
            \[
                f(x) = \tan(x^2) \\
                f'(x) = \left(\tan(x^2)\right)' \cdot (x^2)'
                f'(x) = 2x\left(\tan^2(x^2)+1\right)
            \]
    Thanks.
    try replacing \[ with \begin{equation} and \] with \end{equation}.
    and for better view u may use the following codes:

    Code:
    \documentclass[12pt,reqno]{article}
    
    \usepackage{amsmath}
    
    \begin{document}
    
    \begin{equation}
    \begin{aligned}
    f(x)=&\tan(x^{2}) \\
    f^{\prime}(x)=&(\tan(x^{2}))^{\prime}\cdot(x^{2})^{\prime}\\
    f^{\prime}(x)=&2x(\tan^{2}(x^{2})+1)
    \end{aligned}\notag
    \end{equation}
    
    \end{document}
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Junior Member
    Joined
    Jul 2008
    Posts
    40
    Unfortunately, that didn't help much either.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Senior Member bkarpuz's Avatar
    Joined
    Sep 2008
    From
    Posts
    481
    Thanks
    2

    Talking

    Quote Originally Posted by MatteNoob View Post
    Unfortunately, that didn't help much either.
    The code I gave works fine with me in Texnic Center.
    Why don't you install WinEdt?
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Junior Member
    Joined
    Jul 2008
    Posts
    40
    Weird that it doesn't work for me :\

    However, I can do them individually by nesting each line within \[ and \] or \begin{equation} \end{equation} those lead to a (#) at the right of the equations though, which is a bit annoing.

    Do you know if it is possible to make the math symbols align to the left by any chance? The centered math seems a bit undordered, hehe.

    I've never heard about WinEdt before, so I'll check it out. Thank you for the tip.
    Follow Math Help Forum on Facebook and Google+

  9. #9
    Math Engineering Student
    Krizalid's Avatar
    Joined
    Mar 2007
    From
    Santiago, Chile
    Posts
    3,654
    Thanks
    12
    There're many alignment environments which you can use.

    Following up on bkarpuz's suggestion, we gotta a point here:

    Code:
    \begin{equation}
    \begin{aligned}
    f(x)=&\tan(x^{2}) \\
    f^{\prime}(x)=&(\tan(x^{2}))^{\prime}\cdot(x^{2})^{\prime}\\
    f^{\prime}(x)=&2x(\tan^{2}(x^{2})+1)
    \end{aligned}\notag
    \end{equation}
    that should be,

    Code:
    \begin{equation}
    \begin{aligned}
    f(x)&=\tan(x^{2}) \\
    f^{\prime}(x)&=(\tan(x^{2}))^{\prime}\cdot(x^{2})^{\prime}\\
    f^{\prime}(x)&=2x(\tan^{2}(x^{2})+1)
    \end{aligned}\notag
    \end{equation}
    or even easier, you can just use \begin{align*}\end{align*} (* avoids the enumeration in each line), or use \begin{eqnarray*}\end{eqnarray*}. (This last requires a double & in the equal sign, this is, put &=&.)
    Follow Math Help Forum on Facebook and Google+

  10. #10
    Senior Member bkarpuz's Avatar
    Joined
    Sep 2008
    From
    Posts
    481
    Thanks
    2

    Arrow

    Quote Originally Posted by Krizalid View Post
    There're many alignment environments which you can use.

    Following up on bkarpuz's suggestion, we gotta a point here:

    Code:
    \begin{equation}
    \begin{aligned}
    f(x)=&\tan(x^{2}) \\
    f^{\prime}(x)=&(\tan(x^{2}))^{\prime}\cdot(x^{2})^{\prime}\\
    f^{\prime}(x)=&2x(\tan^{2}(x^{2})+1)
    \end{aligned}\notag
    \end{equation}
    that should be,

    Code:
    \begin{equation}
    \begin{aligned}
    f(x)&=\tan(x^{2}) \\
    f^{\prime}(x)&=(\tan(x^{2}))^{\prime}\cdot(x^{2})^{\prime}\\
    f^{\prime}(x)&=2x(\tan^{2}(x^{2})+1)
    \end{aligned}\notag
    \end{equation}
    or even easier, you can just use \begin{align*}\end{align*} (* avoids the enumeration in each line), or use \begin{eqnarray*}\end{eqnarray*}. (This last requires a double & in the equal sign, this is, put &=&.)
    However it does not effect much if you use &= or =&.
    You should put the sign & where you want the terms to be in vertical que.
    I prefer =& because when some formulas are very long you have to split them into two or more parts, and the second part should start the line with +,-,\times or sth like these, but this should be after = sign.
    Let me clear it with a figure:

    Code:
    a=&aaaaaaaaaaaaaa
    &\times aaaaaaaaa
    yields the one I prefer as follows:

    a=aaaaaaaaaaaaaa
    ...... \times aaaaaaaaa


    But if you use the way, Krizalid suggested, you get

    a=aaaaaaaaaaaaaa
    ... \times aaaaaaaaa

    from

    Code:
    a&=aaaaaaaaaaaaaa
    &\times aaaaaaaaa
    or

    a=aaaaaaaaaaaaaa
    \times aaaaaaaaa

    from

    Code:
    a&=aaaaaaaaaaaaaa
    \times&aaaaaaaaa
    However, it is better you know all, because u may sometimes need them.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 1
    Last Post: December 10th 2011, 06:40 PM
  2. Replies: 3
    Last Post: November 4th 2011, 06:42 PM
  3. Replies: 1
    Last Post: March 18th 2011, 10:36 AM
  4. LaTex inside of LaTex
    Posted in the LaTeX Help Forum
    Replies: 2
    Last Post: November 12th 2009, 11:07 AM
  5. Replies: 0
    Last Post: October 22nd 2009, 11:04 AM

Search Tags


/mathhelpforum @mathhelpforum