Results 1 to 14 of 14

Math Help - How to...

  1. #1
    MHF Contributor arbolis's Avatar
    Joined
    Apr 2008
    From
    Teyateyaneng
    Posts
    1,000
    Awards
    1

    How to...

    How to create a horizontal table of value using Latex? I want to put values of x and y.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Moo
    Moo is offline
    A Cute Angle Moo's Avatar
    Joined
    Mar 2008
    From
    P(I'm here)=1/3, P(I'm there)=t+1/3
    Posts
    5,618
    Thanks
    6
    \begin{tabular}{|*{2}{c|}l r| l}<br />
  \hline<br />
  centre & centre & gauche & droite \\<br />
  case centree & encore centrée & a gauche & a droite \\<br />
  % On trace 2 lignes<br />
  \hline<br />
  \hline<br />
  case centree & encore centree & a gauche & a droite \\<br />
  \end{tabular}

    LaTeX - Gestion des tableaux

    I'm sorry for other people than arbolis, but it's in French



    \hline is for horizontal line. The first command gives the table format, with columns or vertical lines, etc...
    Follow Math Help Forum on Facebook and Google+

  3. #3
    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 arbolis View Post
    How to create a horizontal table of value using Latex? I want to put values of x and y.
    like this? \begin{array}{c|c} x & y \\ \hline 1 & 1 \\ 2 & 2 \\ 3 & 3 \end{array}

    if this is what you want, you can steal my code and modify it
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor arbolis's Avatar
    Joined
    Apr 2008
    From
    Teyateyaneng
    Posts
    1,000
    Awards
    1
    Thanks a lot!
    Follow Math Help Forum on Facebook and Google+

  5. #5
    MHF Contributor arbolis's Avatar
    Joined
    Apr 2008
    From
    Teyateyaneng
    Posts
    1,000
    Awards
    1
    like this?
    I like it, but for me it's a vertical one. Anyway I'll use your code for a thread now.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    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 arbolis View Post
    I like it, but for me it's a vertical one. Anyway I'll use your code for a thread now.
    what do you mean a vertical one? that table is kind of vertical. did you mean horizontal? like:

    \begin{array}{c|ccc} x & 1 & 2 & 3 \\ \hline y & 1 & 2 & 3 \end{array}

    and of course, we can add more vertical or horizontal lines if we want. even an outline...
    Follow Math Help Forum on Facebook and Google+

  7. #7
    MHF Contributor arbolis's Avatar
    Joined
    Apr 2008
    From
    Teyateyaneng
    Posts
    1,000
    Awards
    1
    did you mean horizontal? like:

    Exactly! Thanks again.
    Follow Math Help Forum on Facebook and Google+

  8. #8
    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 arbolis View Post
    Exactly! Thanks again.
    this code will be slightly harder to modify. you need to add more "c"'s to get more columns. and you fill in all the x's before the y's underneath them
    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
    13
    Pick google and write "latable." Download it.
    Follow Math Help Forum on Facebook and Google+

  10. #10
    MHF Contributor arbolis's Avatar
    Joined
    Apr 2008
    From
    Teyateyaneng
    Posts
    1,000
    Awards
    1
    this code will be slightly harder to modify. you need to add more "c"'s to get more columns. and you fill in all the x's before the y's underneath them
    Yeah, I realized it when I was trying to understand the syntax.
    Pick google and write "latable." Download it.
    Thanks, I'll check it out.
    Follow Math Help Forum on Facebook and Google+

  11. #11
    MHF Contributor arbolis's Avatar
    Joined
    Apr 2008
    From
    Teyateyaneng
    Posts
    1,000
    Awards
    1
    I've found "Latable" on your forum. Seems an easy an nice maker of tables. When I enter some data and I copy them as Latex, I got
    \begin{tabular}{llll}
    x & y & z & a \\
    1 & 0 & 0 & 1 \\
    2 & 0 & 1 & 1 \\
    3 & 10^{\frac{1}{9}} & 1 & 1 \\
    \end{tabular}
    but here it says there is an error of Latex...
    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 arbolis View Post

    but here it says there is an error of Latex...
    This happens here, but not in other forums. Are you makin' a PDF?
    Follow Math Help Forum on Facebook and Google+

  13. #13
    MHF Contributor arbolis's Avatar
    Joined
    Apr 2008
    From
    Teyateyaneng
    Posts
    1,000
    Awards
    1
    This happens here, but not in other forums. Are you makin' a PDF?
    No, I'm not making a PDF. I just wanted to use a table for a thread on here. I wonder why it doesn't work here, maybe because a little error of syntax? If yes, then it would be nice to check it out, because the program is nice.
    Follow Math Help Forum on Facebook and Google+

  14. #14
    MHF Contributor
    Opalg's Avatar
    Joined
    Aug 2007
    From
    Leeds, UK
    Posts
    4,041
    Thanks
    7
    Quote Originally Posted by arbolis View Post
    I've found "Latable" on your forum. Seems an easy an nice maker of tables. When I enter some data and I copy them as Latex, I got

    \begin{tabular}{llll}
    x & y & z & a \\
    1 & 0 & 0 & 1 \\
    2 & 0 & 1 & 1 \\
    3 & 10^{\frac{1}{9}} & 1 & 1 \\
    \end{tabular}

    but here it says there is an error of Latex...
    Table entries in the tabular environment are treated as text, not mathematics. If you wrap the item 10^{\frac{1}{9}} with dollar signs, to get

    \begin{tabular}{llll}
    x & y & z & a \\
    1 & 0 & 0 & 1 \\
    2 & 0 & 1 & 1 \\
    3 & $10^{\frac{1}{9}}$ & 1 & 1 \\
    \end{tabular}

    then it will typeset as                               \begin{tabular}{llll}<br />
  x & y & z & a \\ <br />
  1 & 0 & 0 & 1 \\ <br />
  2 & 0 & 1 & 1 \\ <br />
  3 & $10^{\frac{1}{9}}$ & 1 & 1 \\ <br />
  \end{tabular}.

    But it will still look wrong, because the symbols x, y, z, a in the top row have the wrong font shape. You should really replace the tabular environment by the array environment, which is similar except that the matrix entries will will treated as mathematical. So

    \begin{array}{llll}
    x & y & z & a \\
    1 & 0 & 0 & 1 \\
    2 & 0 & 1 & 1 \\
    3 & 10^{\frac{1}{9}} & 1 & 1 \\
    \end{array}

    produces \begin{array}{llll}<br />
x & y & z & a \\<br />
1 & 0 & 0 & 1 \\<br />
2 & 0 & 1 & 1 \\<br />
3 & 10^{\frac{1}{9}} & 1 & 1 \\<br />
\end{array}.
    Follow Math Help Forum on Facebook and Google+


/mathhelpforum @mathhelpforum