1

I'm trying to create a table, but I ran into a problem with

Misplaced \omit. \sp@n ->\span \omit \advance @multicnt \m@ne`

This is my code:

    \documentclass[11pt]{article}
    \usepackage{multirow}
    \def\Sl{\sum\limits}
    \def\Pl{\prod\limits}
    \begin{document}
    \begin{table}[h]
      \begin{tabular}{c|c|c|c|c|c|c}\hline
       a&b&c&d&e&f&g\\\hline
$m_1$&$b_1$&\multirow{4}{*}{$m=\Pl_{i=1}^k$}&$M_1$&$M_1'$&$M_1M_1'b_1$&\multirow{4}{*}{$x\equiv\Sl_{i=1}^kM_i'M_ib_i\pmod{m}$}\\
\cline{1-2}\cline{4-6}
$m_2$&$b_2$& &$M_2$&$M_2'$&$M_2M_2'b_2$& &\\
\cline{1-2}\cline{4-6}
$\vdots$&$\vdots$& &$\vdots$&$\vdots$&$\vdots$& &\\
\cline{1-2}\cline{4-6}
$m_k$&$b_k$& &$M_k$&$M_k'$&$M_kM_k'b_k$& &\\
      \end{tabular}
    \end{table}
    \end{document}

The contents before the table has no problem.

2
  • 4
    your code is incomplete. There is no \begin{document} and e.g. \Pl is undefined. Make a real example that shows your error. Aug 14, 2022 at 16:01
  • Welcome. // Please Edit your question and add the document environment, see previous comment.
    – MS-SPO
    Aug 14, 2022 at 16:18

1 Answer 1

1
  • consider comments below question.
  • in last two table rows you have one ampersand more than are defined columns in table
  • after deleting last ampersands in last three rows, defining \Pl I get the following result:

enter image description here

    \documentclass[11pt]{article}
    \usepackage{multirow}
    \def\Sl{\sum\limits}
    \def\Pl{\prod\limits}
\begin{document}
    \begin{table}[h]
      \begin{tabular}{c|c|c|c|c|c|c}\hline
a   & b & c & d & e & f & g        \\
    \hline
$m_1$   & $b_1$ & \multirow{4}{*}{$m=\Pl_{i=1}^k$} & $M_1$ & $M_1'$ & $M_1M_1'b_1$ & \multirow{4}{*}{$x\equiv\Sl_{i=1}^kM_i'M_ib_i\pmod{m}$} \\
    \cline{1-2}\cline{4-6}
$m_2$   & $b_2$ & & $M_2$&$M_2'$ & $M_2M_2'b_2$ &     \\
    \cline{1-2}\cline{4-6}
$\vdots$ &$ \vdots$ & & $\vdots$ & $\vdots$ & $\vdots$ &    \\
    \cline{1-2}\cline{4-6}
$m_k$ & $b_k$ & & $M_k$ & $M_k'$ & $M_kM_k'b_k$ &   \\
      \end{tabular}
    \end{table}
\end{document}

Does your table should look as is shown above? BTW, the table, according to my taste, is not very pretty ...

Addendum: By use of teh tabularray package for writing code you can get much shorter and clear table vode as well abit nicer table:

\documentclass[11pt]{article}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\usepackage{tabularray}

    
\begin{document}
    \begin{table}[ht]
    \centering
\begin{tblr}{hlines, vlines,
             colspec = {*{7}{Q[c, mode=dmath]}},
             row{2-Z}= {5ex}
            }
a       & b         & c & d         & e         & f             & g \\
m_1     & b_1       &   \SetCell[r=4]{c}  m=\prod_{i=1}^{k} 
                        & M_1       & M_1'      & M_1M_1'b_1    &   \SetCell[r=4]{c}  x\equiv \sum_{i=1}^{k} M_{i}' M_{i} b_{i} \pmod{m}  \\
m_2     & b_2       &   & M_2       & M_2'      & M_2M_2'b_2    &   \\
\vdots  & \vdots    &   & \vdots    & \vdots    & \vdots        &   \\
m_k     & b_k       &   & M_k       & M_k'      & M_kM_k'b_k    &   \\
\end{tblr}
    \end{table}
\end{document}

enter image description here

(red lines indicate text area borders)

2
  • Thanks friend, I have successfully solved this problem.
    – luvtsubasa
    Aug 15, 2022 at 9:35
  • @luvtsubasa. if answer solve your problem, than you may consider to accept it (by clicking on check mark at top left side of answer).
    – Zarko
    Aug 15, 2022 at 11:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .