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? - 2017

  1. Apr 21, 2017 #1

    Stephen Tashi

    User Avatar
    Science Advisor

    Is there a way to do tables in the forum implementation of Latex?

    ( I asked this question in 2012 and the "tabular" environment wasn't implemented.)
     
  2. jcsd
  3. Apr 21, 2017 #2
    I think there are a few ways and I'll let the gurus explain. Just to be clear, since 2011 or so we moved to MathJax which focuses on pure math and does not have explicit "tabular" functionality.
     
  4. Apr 21, 2017 #3

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    We have matrices. Like tables without lines.

    \begin{matrix}
    1 & 2 & 3 & 4 \\
    a & b & c & d \\
    x & y & z & w
    \end{m
    atrix}

    (Why does MathJax parse the table even without $ delimiters if you don't play ugly tricks?)

    $$\begin{matrix}
    1 & 2 & 3 & 4 \\
    a & b & c & d \\
    x & y & z & w
    \end{matrix}$$

    Vertical lines with vmatrix:

    $$\begin{vmatrix}
    1 \\
    a \\
    x
    \end{vmatrix}
    \begin{matrix}
    2\\
    b\\
    y
    \end{matrix}
    \begin{vmatrix}
    3 \\
    c \\
    z
    \end{vmatrix} $$

    With \hline added:

    $$\begin{vmatrix}
    1 \\ \hline
    a \\ \hline
    x
    \end{vmatrix}
    \begin{matrix}
    2\\ \hline
    b\\ \hline
    y
    \end{matrix}
    \begin{vmatrix}
    3 \\ \hline
    c \\ \hline
    z
    \end{vmatrix} $$

    Not perfect, but it looks table-like.
     
  5. Apr 22, 2017 #4

    Mark44

    Staff: Mentor

    I think it's because matrix is an environment, and for some reason you don't need to include the $ or # start/end tags.
    It works the same way with other environments such as cases (I think environment is the correct terminology):
    f(x) = \begin{cases} 1 & x > 0 \\ 0 & x < 0 \end{cases}
     
  6. Apr 23, 2017 #5

    LCKurtz

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

  7. Apr 24, 2017 #6

    jtbell

    User Avatar

    Staff: Mentor

    Thanks! I've added it to our LaTeX Primer, in the section that has examples of matrices.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Tables in LaTex? - 2017
  1. Tables in LaTex (Replies: 4)

  2. Latex Templates (Replies: 3)

  3. Jan 2017 Mentor Change (Replies: 24)

Loading...