Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Tables in LaTex

  1. Aug 24, 2012 #1

    Stephen Tashi

    User Avatar
    Science Advisor

    Do LaTex tables work in forum posts? I've never used them before. Today I tried copying several examples from pages on the web such as:

    [tex]
    \begin{tabular}{ l c r }
    1 & 2 & 3 \\
    4 & 5 & 6 \\
    7 & 8 & 9 \\
    \end{tabular}
    [/tex]

    which on my browser doesn't show up as a table. I tried using math renderers HTML-CSS and SVG.
    I don't see any syntax error in that example, but, as I said, I've never tried to write tables in LaTex before.
     
  2. jcsd
  3. Aug 24, 2012 #2

    LCKurtz

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    That syntax is fine for a LaTeX document. I'm no expert on this, but I think "tabular" is an environment variable, and they aren't generally supported here.

    Disclaimer: Someone who knows what they are talking about may correct me.
     
  4. Aug 24, 2012 #3
    We use MathJax which accepts most LaTeX commands, but it does not accept the tabular environment. Some here have used Arrays to fake a table.
     
  5. Aug 24, 2012 #4

    AlephZero

    User Avatar
    Science Advisor
    Homework Helper

    On PF (and presumably any MathJax application) your input is interpreted in LaTex "math mode", as if it were between ##\$ \dots \$## or ##\$\$ \dots \$\$## in "standard" LaTeX.

    So you can't use environments like "tabular" that are meant to be used outside of math mode.
     
  6. Aug 24, 2012 #5

    DrGreg

    User Avatar
    Science Advisor
    Gold Member

    Consulting our LaTeX FAQ, you can get the effect you want via
    Code (Text):

    \begin{array}{| l | c | r |}
    \hline
      1 & 2 & 3 \\
    \hline
      4 & 5 & 6 \\
    \hline
      7 & 8 & 9 \\
    \hline
    \end{array}
    [tex]
    \begin{array}{| l | c | r |}
    \hline
    1 & 2 & 3 \\
    \hline
    4 & 5 & 6 \\
    \hline
    7 & 8 & 9 \\
    \hline
    \end{array}[/tex]
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Tables in LaTex
  1. Posting a Table (Replies: 3)

  2. Latex test (Replies: 2)

  3. Facebook and Latex (Replies: 3)

  4. LaTeX incomplete (Replies: 2)

  5. Latex broken? (Replies: 2)

Loading...