Trying to display an equation spanning multiple columns in table

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 5K views
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:
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