Page 1 of 2 12 LastLast
Results 1 to 15 of 22

Math Help - Some Tips

  1. #1
    Math Engineering Student
    Krizalid's Avatar
    Joined
    Mar 2007
    From
    Santiago, Chile
    Posts
    3,654
    Thanks
    13

    Some Tips

    Okay, let's start with the Alignment

    We're gonna use the following environment

    \begin{array}

    \end{array}

    Here's an example

    \begin{aligned}
    a&=b\\
    a^2&=ab\\
    a^2-b^2&=ab-b^2\\
    (a+b)(a-b)&=b(a-b)\\
    a+b&=b\\
    2b&=b\\
    2&=1
    \end{aligned}

    As you can see, in each line, we put one "&" at the left side of the equal symbol.

    At the end of each line, we put "\\" to start a new one.

    Once done this, let's put the LaTeX's Tags and yields

     <br />
\begin{aligned}<br />
a&=b\\<br />
a^2&=ab\\<br />
a^2-b^2&=ab-b^2\\<br />
(a+b)(a-b)&=b(a-b)\\<br />
a+b&=b\\<br />
2b&=b\\<br />
2&=1<br />
\end{aligned}<br />


    Implies & Iff


    We all know that we can type \Longrightarrow to generate \Longrightarrow & \Longleftrightarrow to generate \Longleftrightarrow. We can short this, replacing that commands by \implies & \iff, which both of them generate the same.


    \frac

    Sometimes, we wanna write \frac{1}{2} to generate \frac12, we can also short this, writing the following: \frac12. Which generates the same. Be careful, for letters we must leave one space, so for example to write \frac ab, it writes \frac ab.

    Another thing about fractions are examples like this

    \frac{\dfrac{a+b}{a-b}}{x+y}

    When we write another \frac, it should be \dfrac, otherwise, we're gonna get \frac{\frac{a+b}{a-b}}{x+y}, which definitely is not nice.

    --

    To write limits, just put \lim_{x\to1}, or with letters \lim_{x\to a}.


    Cases

    To generate things like

    f(x)=|x|=\left\{\begin{array}{rr}x&\text{if }x\ge0\\<br />
-x&\text{if }x<0\end{array}\right.

    was used the following environment

    f(x)=|x|=\left\{\begin{array}{rr}x&\text{if }x\ge0\\
    -x&\text{if }x<0\end{array}\right.

    After the {array}, we have the {rr}, which means "right, right", this says how we want to align, we can also use {cr} which is "center, right", and many others.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Super Member Rebesques's Avatar
    Joined
    Jul 2005
    From
    At my house.
    Posts
    538
    Thanks
    11
    Just a quick note for the "Cases" ...case: If there are more than two instances, I find the following command useful:

    \begin{cases} (this and that), (if this and that) // (this and that), (if this and that) //... \end{cases}

    We end up with something like:

    <br />
f(x)=|x|=\begin{cases} x, \ \mbox{if } \ x>0 \\<br />
-x, \ \mbox{if } \ x<0 \\ 0,  \ \mbox{if } \ x=0\end{cases}<br />
    Last edited by Rebesques; September 17th 2007 at 12:08 PM. Reason: old age
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Math Engineering Student
    Krizalid's Avatar
    Joined
    Mar 2007
    From
    Santiago, Chile
    Posts
    3,654
    Thanks
    13
    Quote Originally Posted by Rebesques View Post
    <br />
f(x)=|x|=\begin{cases} x, \ \mbox{if } \ x>0 \\<br />
-x, \ \mbox{if } \ x<0 \\ 0, \ \mbox{if } \ x=0\end{cases}<br />
    Yep.

    But if someone wants a little bit of "make-up", we can set

    f(x)=|x|=\left\{\begin{array}{rr}x,\text{ if }x>0\\<br />
-x,\text{ if }x<0\\<br />
0,\text{ if }x=0\end{array}\right.

    generated by

    f(x)=|x|=\left\{\begin{array}{rr}x,\text{ if }x>0\\
    -x,\text{ if }x<0\\
    0,\text{ if }x=0\end{array}\right.

    which in my opinion looks definitely better
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Super Member Rebesques's Avatar
    Joined
    Jul 2005
    From
    At my house.
    Posts
    538
    Thanks
    11
    If u like 'em with make-up on I am more of a naturalist myself.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Super Member

    Joined
    May 2006
    From
    Lexington, MA (USA)
    Posts
    11,707
    Thanks
    625

    An array can be enclosed with a number of symbols.


    \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} . . \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}


    \begin{bmatrix}1 & 0 \\ 0 & 1 \end{bmatrix} . . \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}


    \begin{Bmatrix}1 & 0 \\ 0 & 1 \end{Bmatrix} . . \begin{Bmatrix} 1 & 0 \\ 0 & 1 \end{Bmatrix}


    \begin{vmatrix}1 & 0 \\ 0 & 1 \end{vmatrix} . . \begin{vmatrix} 1 & 0 \\ 0 & 1 \end{vmatrix}


    \begin{Vmatrix}1 & 0 \\ 0 & 1 \end{Vmatrix} . . \begin{Vmatrix} 1 & 0 \\ 0 & 1 \end{Vmatrix}


    For an augmented matrix, use:
    \left( \begin{array}{cc|c} 1 & 0 & a \\ 0 & 1 & b \end{array} \right)

    \left( \begin{array}{cc|c}1 & 0 & a \\ 0 & 1 & b \end{array}\right)



    A binomial coefficient \begin{pmatrix}9 \\ 3\end{pmatrix} can be constructed with: .\begin{pmatrix} 9 \\ 3 \end{pmatrix}
    . . but it can be done with: .9 \choose 3 .or: .\binom {9}{3}


    A partition 9\choose2,3,4 can be constructed with: .9 \choose 2,3,4 .or: .\binom {9}(2,3,4}


    Note: Those spaces are not required in the code; they're used here for clarity.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Super Member

    Joined
    May 2006
    From
    Lexington, MA (USA)
    Posts
    11,707
    Thanks
    625
    Some odds and ends . . .


    \begin{array}{ccccc}\rightarrow & \backslash\text{rightarrow} & \quad & \Rightarrow & \backslash\text{Rightarrow} \\<br />
\leftarrow & \backslash\text{leftarrow} & \quad & \Leftarrow & \backslash\text{Leftarrow} \\<br />
\uparrow & \backslash\text{uparrow} & \quad & \Uparrow & \backslash\text{Uparrow} \\<br />
\downarrow & \backslash\text{downarrow} & \quad & \Downarrow & \backslash\text{Downarrow}<br />
\end{array}


    \begin{array}{ccccc}\nearrow & \backslash\text{nearrow} & \quad & <br />
\searrow & \backslash\text{searrow} \\ <br />
\swarrow & \backslash\text{swarrow} & \quad & \nwarrow & \backslash\text{nwarrow} \end{array}


    \begin{array}{ccccc}\circlearrowleft & \backslash\text{circlearrowleft} & \quad & \circlearrowright & \backslash\text{circlearrowright} \\<br />
\curvearrowleft & \backslash\text{curvearrowleft} & \quad & \curvearrowright & \backslash\text{curvearrowright}<br />
\end{array}


    \begin{array}{cccccccc}\cdots & \backslash\text{cdots} & \quad & \vdots & \backslash\text{vdots} & \quad & \ddots & \backslash\text{ddots}\end{array}


    \begin{array}{cccccccc}\bullet & \backslash\text{bullet} & \quad & \circ & \backslash\text{circ} & \quad & \bigcirc & \backslash\text{bigcirc}\end{array}


    \begin{array}{cccccccc}<br />
\star & \backslash\text{star} & \quad & \bigstar & \backslash\text{bigstar} & \quad & \divideontimes  & \backslash\text{divideontimes}\\ \\<br />
\between & \backslash\text{between} & \quad & \blacksquare & \backslash\text{blacksquare} & \quad & \blacktriangle & \backslash\text{blacktriangle} \end{array}


    \begin{array}{cccccccc}\spadesuit & \backslash\text{spadesuit} & \quad & \clubsuit & \backslash\text{clubsuit} \end{array}
    . . . (But there is no \heartsuit nor \diamondsuit . . . why?)

    My error ... somehow.
    I tried many times, but \heartsuit and \diamondsuit gave me a "Latex error" message.
    Of course, now that I've publically embarrassed myself, it works fine.


    Last edited by Soroban; September 30th 2007 at 12:56 PM.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Super Member
    earboth's Avatar
    Joined
    Jan 2006
    From
    Germany
    Posts
    5,829
    Thanks
    123
    Quote Originally Posted by Soroban View Post
    ...(But there is no \heartsuit nor \diamondsuit . . . why?)

    hello:

    \diamondsuit

    \heartsuit

    (but they are not black )
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Forum Admin topsquark's Avatar
    Joined
    Jan 2006
    From
    Wellsville, NY
    Posts
    9,887
    Thanks
    325
    Awards
    1
    Quote Originally Posted by Soroban View Post
    (But there is no \heartsuit nor \diamondsuit . . . why?)

    Quote Originally Posted by earboth View Post
    hello:

    \diamondsuit

    \heartsuit

    (but they are not black )
    Perhaps because these suits are red and there is no red font in LaTeX?

    -Dan
    Follow Math Help Forum on Facebook and Google+

  9. #9
    is up to his old tricks again! Jhevon's Avatar
    Joined
    Feb 2007
    From
    New York, USA
    Posts
    11,663
    Thanks
    3
    Quote Originally Posted by topsquark View Post
    Perhaps because these suits are red and there is no red font in LaTeX?

    -Dan
    i guess the best we can do is to make the outline red: \color {red} \heartsuit \mbox { } \diamondsuit

    ...isn't there a code to shade things in LaTex?
    Follow Math Help Forum on Facebook and Google+

  10. #10
    Super Member

    Joined
    May 2006
    From
    Lexington, MA (USA)
    Posts
    11,707
    Thanks
    625
    When forming matrices or determinants, I find that the minus-signs
    . . are quite large and are rather distracting.

    For example: . \begin{bmatrix}-17 & 0 & -29 \\ -29 & -17 & 0 \\ 0 & -29 & -17 \end{bmatrix}

    \begin{bmatrix} -17 & 0 & -29 \\ -29 & -17 & 0 \\ 0 & -29 & -17 \end{bmatrix}



    If it's too annoying, I insert .\text{ } around each minus-sign.

    Then we have: . \begin{bmatrix}\text{-}17 & 0 & \text{-}29 \\ \text{-}29 & \text{-}17 & 0 \\ 0 & \text{-}29 & \text{-}17 \end{bmatrix}



    I also find that the grouping symbols for arrays
    . . tend to "squeeze" the array: . \begin{vmatrix}1 & 0 \\ 0 & 1\end{vmatrix}

    \begin{vmatrix}1 & 0 \\ 0 & 1\end{vmatrix}


    So I insert a space \; at the ends of each row: . \begin{vmatrix}\; 1 & 0 \; \\ \; 0 & 1 \; \end{vmatrix}

    \begin{vmatrix} \; 1 & 0 \; \\ \; 0 & 1 \; \end{vmatrix}



    Yes, it means extra work, but I think the final result is worth the effort.

    Obviously, I enjoy creating orderly layouts
    . . and I delight in finding such improvements.

    I've kept these tips to myself up to now
    . . (lest someone snickers and says, "Wow, he's got OCB!")
    but then I figured: someone might appreciate these . . .

    Follow Math Help Forum on Facebook and Google+

  11. #11
    Forum Admin topsquark's Avatar
    Joined
    Jan 2006
    From
    Wellsville, NY
    Posts
    9,887
    Thanks
    325
    Awards
    1
    Quote Originally Posted by Soroban View Post

    So I insert a space \;
    I find that the ~ is slightly easier to type. This also inserts a space.

    -Dan
    Follow Math Help Forum on Facebook and Google+

  12. #12
    Math Engineering Student
    Krizalid's Avatar
    Joined
    Mar 2007
    From
    Santiago, Chile
    Posts
    3,654
    Thanks
    13
    Quote Originally Posted by Soroban View Post
    For example: . \begin{bmatrix}-17 & 0 & -29 \\ -29 & -17 & 0 \\ 0 & -29 & -17 \end{bmatrix}
    We may also use the array environment as follows

    \left[\begin{array}{rrr}-17&0&-29\\<br />
-29&-17&0\\<br />
0&-29&-17\end{array}\right]

    This works for digits alignment.

    The following code was applied here

    \left[\begin{array}{rrr}-17&0&-29\\
    -29&-17&0\\
    0&-29&-17\end{array}\right]

    not hard to write. Personally, looks better.
    Follow Math Help Forum on Facebook and Google+

  13. #13
    Math Engineering Student
    Krizalid's Avatar
    Joined
    Mar 2007
    From
    Santiago, Chile
    Posts
    3,654
    Thanks
    13
    Quote Originally Posted by Soroban View Post
    \begin{vmatrix}1 & 0 \\ 0 & 1\end{vmatrix}
    If you use the array environment, yields the following

    \left|\begin{array}{cc}1&0\\<br />
0&1\end{array}\right|

    made it with

    \left|\begin{array}{cc}1&0\\
    0&1\end{array}\right|.

    And we're done

    --

    One can choose the {r}{c}{l}, all depends of the make-up.
    Follow Math Help Forum on Facebook and Google+

  14. #14
    is up to his old tricks again! Jhevon's Avatar
    Joined
    Feb 2007
    From
    New York, USA
    Posts
    11,663
    Thanks
    3
    Quote Originally Posted by topsquark View Post
    I find that the ~ is slightly easier to type. This also inserts a space.

    -Dan
    I agree. in addition, when you have \, all over the place (i have seen people use it between every term) makes for such unaesthetic code.


    Can someone show me how to make tables? Like a truth table

    i want to know how to make tables that have an outline, as well as tables with just an inner skeleton but no outline around the edges

    i also want to know how to create the type of skeleton that just separates headings and columns, and those that bar off each cell to itself
    Follow Math Help Forum on Facebook and Google+

  15. #15
    Math Engineering Student
    Krizalid's Avatar
    Joined
    Mar 2007
    From
    Santiago, Chile
    Posts
    3,654
    Thanks
    13
    You can use the LaTable.
    Follow Math Help Forum on Facebook and Google+

Page 1 of 2 12 LastLast

Similar Math Help Forum Discussions

  1. Study tips??
    Posted in the Calculus Forum
    Replies: 5
    Last Post: January 1st 2011, 02:24 PM
  2. Study tips for the Final
    Posted in the Differential Equations Forum
    Replies: 2
    Last Post: May 10th 2010, 10:42 AM
  3. Integration tips
    Posted in the Differential Geometry Forum
    Replies: 8
    Last Post: February 9th 2010, 10:21 AM
  4. Pro Tips Required
    Posted in the Discrete Math Forum
    Replies: 1
    Last Post: October 4th 2009, 02:10 PM
  5. 2 questions i need tips with
    Posted in the Algebra Forum
    Replies: 13
    Last Post: December 11th 2007, 02:21 PM

Search Tags


/mathhelpforum @mathhelpforum