Making Tables in LaTeX - 2017 Update

  • Context: LaTeX 
  • Thread starter Thread starter Stephen Tashi
  • Start date Start date
  • Tags Tags
    2017 Latex
Click For Summary

Discussion Overview

The discussion revolves around the implementation of tables in LaTeX within the forum, specifically focusing on the capabilities of MathJax since its transition in 2011. Participants explore alternative methods for creating table-like structures using matrices and other environments.

Discussion Character

  • Exploratory, Technical explanation, Debate/contested

Main Points Raised

  • Some participants inquire about the ability to create tables using the "tabular" environment in the forum's LaTeX implementation, noting its absence since 2012.
  • Others mention that MathJax, which is used for rendering LaTeX, does not support the "tabular" functionality but allows for matrices as a workaround.
  • One participant provides examples of matrices formatted to resemble tables, including the use of vertical lines with the vmatrix environment.
  • A participant questions the parsing behavior of MathJax regarding matrices and the necessity of delimiters, suggesting that matrix is treated as an environment that does not require them.
  • Another participant shares a link to a post that presumably contains further information or examples related to the topic.
  • A later reply indicates that the information has been added to a LaTeX Primer, specifically in the section on matrices.

Areas of Agreement / Disagreement

Participants generally agree that the "tabular" environment is not available and that matrices can be used as an alternative, but there is no consensus on the best methods or limitations of these approaches.

Contextual Notes

Limitations include the lack of explicit "tabular" functionality in MathJax and the potential confusion regarding the parsing of matrix environments without delimiters.

Stephen Tashi
Science Advisor
Homework Helper
Education Advisor
Messages
7,864
Reaction score
1,605
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.)
 
Physics news on Phys.org
Stephen Tashi said:
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.)
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.
 
We have matrices. Like tables without lines.

\begin{matrix}
1 & 2 & 3 & 4 \\
a & b & c & d \\
x & y & z & w
\end{m[/color]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.
 
  • Like
Likes   Reactions: Greg Bernhardt
mfb said:
(Why does MathJax parse the table even without $ delimiters if you don't play ugly tricks?)
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}
 
Thanks! I've added it to our LaTeX Primer, in the section that has examples of matrices.
 
  • Like
Likes   Reactions: Greg Bernhardt

Similar threads

  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 0 ·
Replies
0
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K