Tabular Why wouldn't this work?

  • Context: MHB 
  • Thread starter Thread starter Dustinsfl
  • Start date Start date
  • Tags Tags
    Work
Click For Summary
SUMMARY

The discussion centers on the use of the LaTeX tabular environment for creating tables. Users encountered issues with rendering tables correctly, specifically questioning whether a special preamble package is required. It was clarified that the tabular environment is typically used in a text context rather than a math context. A simple example from "Math Into LaTeX" by George Gratzer was provided to demonstrate proper usage, leading to a successful rendering when the LaTeX data was enclosed in dollar signs.

PREREQUISITES
  • Understanding of LaTeX syntax and environments
  • Familiarity with the tabular environment in LaTeX
  • Knowledge of how to include packages in LaTeX documents
  • Basic experience with rendering LaTeX code
NEXT STEPS
  • Learn about LaTeX preamble requirements for different environments
  • Explore advanced table formatting options in LaTeX
  • Investigate the use of additional packages like 'booktabs' for enhanced table aesthetics
  • Practice creating complex tables using nested tabular environments
USEFUL FOR

LaTeX users, academic writers, and anyone looking to create professional-quality tables in their documents.

Dustinsfl
Messages
2,217
Reaction score
5
Code:
\begin{tabular}{|c|c|c|c|c|c|}
\hline
\ell & m = -2 & m = -1 & m = 0 & m = 1 & m = 2\\
\hline
0 & - & - & 50\sqrt{\pi} & - & -\\
\hline
1 & - & 25\sqrt{3\pi} & 0 & 25\sqrt{3\pi} & -\\
\hline
2 & 100\sqrt{\frac{5}{6\pi}} & 0 & 0 & 0 & 100\sqrt{\frac{5}{6\pi}}
\hline
\end{tabular}
 
Physics news on Phys.org
Code:
\begin{tabular}{|c|c|c|c|c|c|}
\hline
\ell & m = -2 & m = -1 & m = 0 & m = 1 & m = 2\\
\hline
0 & - & - & 50\sqrt{\pi} & - & -\\
\hline
1 & - & 25\sqrt{3\pi} & 0 & 25\sqrt{3\pi} & -\\
\hline
2 & 100\sqrt{\frac{5}{6\pi}} & 0 & 0 & 0 & 100\sqrt{\frac{5}{6\pi}}\\
\hline
\end{tabular}

Try the above.
 
Ackbach said:
Code:
\begin{tabular}{|c|c|c|c|c|c|}
\hline
\ell & m = -2 & m = -1 & m = 0 & m = 1 & m = 2\\
\hline
0 & - & - & 50\sqrt{\pi} & - & -\\
\hline
1 & - & 25\sqrt{3\pi} & 0 & 25\sqrt{3\pi} & -\\
\hline
2 & 100\sqrt{\frac{5}{6\pi}} & 0 & 0 & 0 & 100\sqrt{\frac{5}{6\pi}}\\
\hline
\end{tabular}

Try the above.

This didn't work as well. Is there a special preamble package needed for tabular?
 
dwsmith said:
This didn't work as well. Is there a special preamble package needed for tabular?

Not usually. Are you trying to use tabular in a math or text environment? The tabular is a text environment. Can you try a really simple tabular instance like this:

Code:
\begin{tabular}{|l|r|r|r|}
\hline
Name &1 &2 &3 \\ \hline
Peter &2.45 &34.12 &1.00 \\ \hline
John &0.00 &12.89 &3.71 \\ \hline
David &2.00 &1.85 &0.71 \\ \hline
\end{tabular}

This example is straight out of Math Into $\LaTeX$, by George Gratzer, on page 146. It http://quicklatex.com/cache3/ql_0bd7f0ac3264265cc9e963e6fbd12d5a_l3.png.
 
Ackbach said:
Not usually. Are you trying to use tabular in a math or text environment? The tabular is a text environment. Can you try a really simple tabular instance like this:

Code:
\begin{tabular}{|l|r|r|r|}
\hline
Name &1 &2 &3 \\ \hline
Peter &2.45 &34.12 &1.00 \\ \hline
John &0.00 &12.89 &3.71 \\ \hline
David &2.00 &1.85 &0.71 \\ \hline
\end{tabular}

This example is straight out of Math Into $\LaTeX$, by George Gratzer, on page 146. It http://quicklatex.com/cache3/ql_0bd7f0ac3264265cc9e963e6fbd12d5a_l3.png.

From this information, I just tried dollar signing all the tex data and that worked.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 0 ·
Replies
0
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
Replies
10
Views
3K