LaTeX Trying to display an equation spanning multiple columns in table

Click For Summary
The discussion revolves around a LaTeX code issue related to displaying equations within a table. The user encounters errors, specifically "missing $ inserted" and a LaTeX error indicating a mismatch with the tabular environment. The problem arises from attempting to use the display math mode \[...\] within a multicolumn command in a table, which is not supported. A solution is proposed to replace the display math mode with inline math mode using $\displaystyle eqn$, which resolves the errors and allows the equation to be displayed correctly.
Pencilvester
Messages
213
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 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 berkeman

Similar threads

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