Trying to display an equation spanning multiple columns in table

Click For Summary
SUMMARY

The discussion focuses on displaying equations spanning multiple columns in a LaTeX table using the packages amsmath, amsfonts, and multirow. The user encountered "missing $ inserted" errors and a LaTeX error related to tabular environments when attempting to use the \multicolumn command with displayed equations. The solution provided involved using the inline math mode with the command \multicolumn{2}{|c|}{$\displaystyle eqn$}, which successfully resolved the issue.

PREREQUISITES
  • Familiarity with LaTeX document preparation system
  • Understanding of tabular environments in LaTeX
  • Knowledge of mathematical typesetting in LaTeX using amsmath
  • Experience with the multicolumn command in LaTeX tables
NEXT STEPS
  • Explore advanced LaTeX table formatting techniques
  • Learn about the differences between inline and displayed math modes in LaTeX
  • Investigate the use of the amsmath package for complex equations
  • Review common LaTeX error messages and their resolutions
USEFUL FOR

LaTeX users, mathematicians, educators, and anyone involved in typesetting documents that require complex mathematical equations in tables.

Pencilvester
Messages
214
Reaction score
52
TL;DR
I’m trying to make an equation spanning multiple columns in displayed mode, not inline, but I’m getting an error I don’t know how to deal with.
I’ll just paste in all of the packages I’m using and the relevant code. The line in this sample that is giving me errors is line 24. (Errors below)
Code:
\documentclass[10pt]{article}
\pagenumbering{gobble}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{bm}
\usepackage{physics}
\usepackage{array}
\usepackage{multirow}
\usepackage[margin=0.5in]{geometry}
\newcommand\Tstrut{\rule{0pt}{2.0ex}}
\newcommand\Bstrut{\rule[-0.7ex]{0pt}{0pt}}
\begin{document}
\phantom{~}\noindent
\renewcommand{\arraystretch}{0}
\begin{table}[t!]
\centering
    \begin{tabular}{|b{3.5in}<{\centering}b{3.5in}<{\centering}|}
    \hline \\
    \multicolumn{2}{|c|}{\textbf{Trigonometric and Exponential}} \Tstrut \Bstrut\\
    \hline \\
% here I have a bunch of displayed equations—2 in each row—using “\[...\] & \[...\] \\” with no issues
% and now I’m trying to use \multicolumn{2}{|c|}{\[eqn\]} \\
    \hline
\end{tabular}
\end{table}
I am getting 2 “missing $ inserted” errors (telling me that for some reason, it wants an inline equation), as well as an error that says “LaTeX error: \begin{tabular} on input line 19 ended by \end{equation*}.” Although this error references line 19, it assigned it to line 24, and I can’t figure out what it is talking about when it says line 19 ended by \end{equation*}.

Can someone tell me what I need to fix in order to get this equation in displayed mode?
 
Last edited by a moderator:
Physics news on Phys.org
I'm surprised that it is accepting \[ \] inside a table at all. In the multicolumn, try
\multicolumn{2}{|c|}{$\displaystyle eqn$}
 
  • Like
Likes   Reactions: berkeman
DrClaude said:
I'm surprised that it is accepting \[ \] inside a table at all. In the multicolumn, try
\multicolumn{2}{|c|}{$\displaystyle eqn$}
That worked, thanks!
 
  • Like
Likes   Reactions: berkeman

Similar threads

  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 0 ·
Replies
0
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 8 ·
Replies
8
Views
13K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
6K