LaTeX Do LaTeX Tables Display Correctly in Forum Posts?

  • Thread starter Thread starter Stephen Tashi
  • Start date Start date
  • Tags Tags
    Forum Latex
AI Thread Summary
LaTeX tables do not work in forum posts due to the limitations of MathJax, which is commonly used for rendering LaTeX in these environments. The "tabular" environment, which is typically used for creating tables in LaTeX documents, is not supported in MathJax as it operates in "math mode." Instead, users can utilize the "array" environment to simulate a table format. The correct syntax for creating a table-like structure involves using the "array" command with appropriate formatting, such as including horizontal lines for separation. This approach allows for the desired table effect within the constraints of forum post formatting.
Stephen Tashi
Science Advisor
Homework Helper
Education Advisor
Messages
7,864
Reaction score
1,602
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:

<br /> \begin{tabular}{ l c r }<br /> 1 &amp; 2 &amp; 3 \\<br /> 4 &amp; 5 &amp; 6 \\<br /> 7 &amp; 8 &amp; 9 \\<br /> \end{tabular}<br />

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.
 
Physics news on Phys.org
Stephen Tashi said:
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:

<br /> \begin{tabular}{ l c r }<br /> 1 &amp; 2 &amp; 3 \\<br /> 4 &amp; 5 &amp; 6 \\<br /> 7 &amp; 8 &amp; 9 \\<br /> \end{tabular}<br />

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.

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.
 
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.
 
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.
 
Stephen Tashi said:
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:

<br /> \begin{tabular}{ l c r }<br /> 1 &amp; 2 &amp; 3 \\<br /> 4 &amp; 5 &amp; 6 \\<br /> 7 &amp; 8 &amp; 9 \\<br /> \end{tabular}<br />

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.
Consulting our LaTeX FAQ, you can get the effect you want via
Code:
\begin{array}{| l | c | r |}
\hline
  1 & 2 & 3 \\
\hline
  4 & 5 & 6 \\
\hline
  7 & 8 & 9 \\
\hline
\end{array}
<br /> \begin{array}{| l | c | r |}<br /> \hline<br /> 1 &amp; 2 &amp; 3 \\<br /> \hline<br /> 4 &amp; 5 &amp; 6 \\<br /> \hline<br /> 7 &amp; 8 &amp; 9 \\<br /> \hline<br /> \end{array}
 

Similar threads

Back
Top