Need LaTeX commands for tables, I've looked up some but not working

  • Context: LaTeX 
  • Thread starter Thread starter benorin
  • Start date Start date
  • Tags Tags
    latex
Click For Summary

Discussion Overview

The discussion revolves around the challenges of using LaTeX commands for creating tables, specifically in the context of formatting mathematical expressions and ensuring proper rendering in an online platform. Participants explore issues related to syntax and formatting that affect the display of LaTeX code.

Discussion Character

  • Technical explanation
  • Homework-related
  • Meta-discussion

Main Points Raised

  • One participant reports that their LaTeX table commands do not render correctly, displaying commands instead of the intended table or mathematical symbols.
  • Another participant suggests that replacing HTML tags with dollar signs resolves the rendering issue, indicating that the LaTeX code itself is correct.
  • A participant proposes that the newline after the \begin{array} command may be causing issues in the Insights editor, which could be breaking MathJax rendering.
  • One participant mentions their intention to create an Insight based on the table as a memory aid for students, indicating a pedagogical context.
  • A participant expresses uncertainty about the submission process for their article and seeks guidance from others.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the best method for ensuring LaTeX tables render correctly, as different approaches are suggested and issues remain unresolved.

Contextual Notes

There are limitations regarding the handling of newlines in the Insights editor, which may affect how LaTeX code is processed. The discussion does not resolve the underlying technical issues related to LaTeX rendering.

benorin
Science Advisor
Insights Author
Messages
1,442
Reaction score
191
I've looked up two different LaTeX references for Table commands and have been lead to believe that this might work but not only does it not appear as a table it doesn't even display greek letters or fractions just spits out commands. Help please?

Code:
|render=<math>
\begin{array}{ l| |c|c|c|c|c }

\theta & 0 & \tfrac{\pi}{6} & \tfrac{\pi}{4} & \tfrac{\pi}{3} & \tfrac{\pi}{2} \\ \sin\theta & 1  & 2  &  3 & 4  & 5   \\ \cos\theta & 6  & 7   & 8   & 9   & 10   \\ \tan\theta & 11   & 12   & 13   & 14  & 15   \\ \end{array} </math>
 
Physics news on Phys.org
$$\begin{array}{ l| |c|c|c|c|c }

\theta & 0 & \tfrac{\pi}{6} & \tfrac{\pi}{4} & \tfrac{\pi}{3} & \tfrac{\pi}{2} \\ \sin\theta & 1 & 2 & 3 & 4 & 5 \\ \cos\theta & 6 & 7 & 8 & 9 & 10 \\ \tan\theta & 11 & 12 & 13 & 14 & 15 \\ \end{array}$$

Copied and pasted, only replacing the HTML <math> tags with two dollars, and it seems to work ok here. So your LaTeX is fine. I take it this is an Insight you are writing?
 
  • Like
Likes   Reactions: berkeman and vanhees71
I thought it might be appropriate to make it an insight, was just a memory trick for the trig table. My students in Calc always loved it
 
  • Love
Likes   Reactions: Greg Bernhardt
So I just tried creating a new Insight and pasting your code in, and sure enough it doesn't work. The problem seems to be the newline after the begin{array} line. The Insights editor treats a newline as a paragraph end and inserts a </p><p>, and that's breaking MathJax, I think. So simply putting the whole table code on to one line fixes it.
 
  • Like
Likes   Reactions: vanhees71, Greg Bernhardt and benorin
@Ibix I submitted my article for review but don't see the Request for review post in insight and Blog Development sub forum, I submitted it twice, my bad

edit: it's called "A Trick to Memorizing Trig Special Angle Values Table"
 
  • Like
Likes   Reactions: vanhees71 and Greg Bernhardt
Can't help with that, I'm afraid - I'm just a normal user, but was at a bit of a loose end today so played around with your code. See what @Greg Bernhardt says.
 
  • Like
Likes   Reactions: benorin and Greg Bernhardt

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 36 ·
2
Replies
36
Views
2K
  • · Replies 0 ·
Replies
0
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 15 ·
Replies
15
Views
25K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 9 ·
Replies
9
Views
3K