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

  • Topic: LaTeX 
  • Thread starter Thread starter benorin
  • Start date Start date
  • Tags Tags
    latex
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
5 replies · 1K views
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