Working in overleaf, I get the error Misplaced \noalign but I can't seem to figure out why. Here's my code           \begin{table}[H]             \centering             \begin{tabular}{|c|c|c|} \cline{2-3}                  \multicolumn{1}{c|}{}   &amp; \rowcolor{Gray} SEL0  &amp; SEL1  \\ \hline                 \cellcolor{Gray} UART   &amp; OFF                   &amp; OFF   \\ \hline                 \cellcolor{Gray} SPI    &amp; OFF                   &amp; ON    \\ \hline                 \cellcolor{Gray} I2C    &amp; ON                    &amp; ON    \\ \hline             \end{tabular}             \caption{Communication module selection PN532 Breakout Board}             \label{table:comModulePn532}         \end{table}   The error comes from the line \multicolumn{1}{c|}{}   &amp; \rowcolor{Gray} SEL0  &amp; SEL1  \\ \hline
5149
I want to use row coloring with \multicolumn. The MWE below works, but if I change  to the commented, colored line, I receive a "misplaced \noalign". What do I wrong?  \documentclass{article} \usepackage{booktabs,colortbl,xcolor} \begin{document}  \begin{tabular}{p{1.7cm}p{1.3cm}p{1.3cm}p{1.35cm}p{1.35cm}p{1.35cm}p{1.35cm}p{1.7cm}} % \toprule % \multicolumn{1}{&gt;{\rowcolor{lightgray}}c}{}  &amp;\multicolumn{7}{&gt;{\rowcolor{lightgray}}c}{String length}\\  \multicolumn{1}{c}{}  &amp;\multicolumn{7}{c}{String length}\\ \rowcolor{lightgray} Function &amp; 16,384 &amp; 32,768&amp; 65,536 &amp; 130,072 &amp; 262,144 &amp; 524,288&amp; 1,048,576\\ \midrule lower1  &amp; 0.19 &amp; 0.77 &amp; 3.08 &amp; 12.24 &amp; 49.39 &amp; 198.42 &amp; 791.22\\ lower2&amp; 0.0000 &amp;  0.0000 &amp; 0.0001 &amp; 0.0002 &amp; 0.0004 &amp; 0.0008 &amp; 0.0015\\ \bottomrule \end{tabular}  \end{document}   I was experimenting with a solution like this, because I receive strange table heading, like below. The code you suggested works fine in MWE, but in my real text, with copy&amp;paste from the answer, it produces the strange heading. Any idea, what can change the behavior?
51429
The following example has two normal LaTeX \newcommand macros and two xparse \NewDocumentCommand for specifying multicolumn text. The only difference between each pair of commands is one has the alignment character as part of the macro and one does not.  However, the xparse version that requires the alignment character to be outside of the macro does NOT work and results in Misplaced \omit. error.  \documentclass{article} \usepackage{xparse}  \newcommand{\MulticolumnA}[3]{&amp;\multicolumn{#1}{#2}{#3}} \newcommand{\MulticolumnB}[3]{ \multicolumn{#1}{#2}{#3}}  \NewDocumentCommand{\MulticolumnX}{m m m}{&amp;\multicolumn{#1}{#2}{#3}} \NewDocumentCommand{\MulticolumnY}{m m m}{ \multicolumn{#1}{#2}{#3}}  \begin{document} \[ \begin{tabular}{lllllll}     {a} \MulticolumnA{4}{l}{A-abcdefghijkli}\\     {a}&amp;\MulticolumnB{4}{l}{B-abcdefghijkli}\\     {a} \MulticolumnX{4}{l}{X-abcdefghijkli}\\     %{a}&amp;\MulticolumnY{4}{l}{Y-abcdefghijkli}\\     {col1}&amp;col2&amp;{col3}&amp;{col4}&amp;{col5}\\ \end{tabular} \] \end{document}   Above compiles as is, but does not compile if the one line is uncommented.
108644
I'm writing my thesis with latex and I have a problem with this table setting. I would like to have all the equations aligned on the left and also the first and the last rows less height. Here is my code  \begin{table}\centering \begin{tabular}{ m{3cm} m{10cm} }\hline Continuity &amp; {\begin{equation} \frac{\partial \rho}{\partial t}+\nabla\cdot\left ( \rho\mathbf{V}\right )   =0\label{continuity_1}\end{equation}}\\ x-momentum\newline\newline y-momentum\newline\newline z-momentum &amp; {\begin{subequations}\begin{align} &amp;\frac{\left ( \partial \rho u\right ) }{\partial t}+\nabla\cdot\left ( \rho u\mathbf{V}\right ) = -\frac{\partial p}{\partial x}+\nabla\cdot\left ( \mu\nabla u\right ) +S_{Mx}\\ &amp;\frac{\left ( \partial \rho v\right ) }{\partial t}+\nabla\cdot\left ( \rho v\mathbf{V}\right ) = -\frac{\partial p}{\partial y}+\nabla\cdot\left ( \mu\nabla v\right ) +S_{My}\\ &amp;\frac{\left ( \partial \rho w\right ) }{\partial t}+\nabla\cdot\left ( \rho w\mathbf{V}\right ) = -\frac{\partial p}{\partial z}+\nabla\cdot\left ( \mu\nabla w\right ) +S_{Mz} \end{align}\label{NS_eq1}\end{subequations}}\\ Energy &amp; {\begin{equation} \frac{\left ( \partial \rho e\right ) }{\partial t}+\nabla\cdot\left ( \rho e\mathbf{V}\right ) =-p\nabla\cdot\mathbf{V}+\nabla\left ( k\nabla T \right ) + \Phi + S_{i} \label{energy_1}\end{equation}}\\ \hline\end{tabular}\caption{Governing equations of flow for a Newtonian fluid}\label{NS_eqt}\end{table}   This is the result
100054
How to adapt this table to break across page boundaries?  Original question here:      \documentclass{article}     \usepackage{tabularx}     \usepackage{amsmath}     \usepackage[table]{xcolor}     \usepackage{tabularx, multirow, makecell, rotating} %     \usepackage{enumitem}          \begin{document}         \begin{center}     \bfseries \settowidth\rotheadsize{List of Abbreviation/accronym} \begin{tabularx}{\linewidth}{|c|&gt;{\centering\arraybackslash}X|}     \hline \cellcolor{gray!30} Abbreviation &amp; \cellcolor{gray!30} Explanation     \\     \hline \multirow[b]{2}{*}{USA}                &amp; \cellcolor{blue!30}  United state of america  \rule[-1em]{0pt}{2.5em} \\     \cline{2-2} %   &amp;  %   \rule[-1em]{0pt}{2.5em} \\ %    \cline{2-2}     &amp;    \rule[-1em]{0pt}{2.5em} \\     \hline         \multirow[b]{2}{*}{NY}                &amp;  \cellcolor{blue!30} New york   \rule[-1em]{0pt}{2.5em} \\     \cline{2-2} %   &amp;  %   \rule[-1em]{0pt}{2.5em} \\ %    \cline{2-2}     &amp;     \rule[-1em]{0pt}{2.5em} \\     \hline \end{tabularx}     \end{center}     \end{document}
60813
I'm trying to write up a table but I'm missing the vertical rows in the last few columns. Anyone have any clues as to how to fix this?   \setlength\tabcolsep{4pt}  \begin{tabular}{|l|l|l|l|l|}  \cline{2-5}   \multicolumn{1}{l|}{} &amp; Autumn &amp; Pre-requisites &amp; Spring &amp; Pre-requisites \\\hline   \multirow{4}{*}{\textbf{Year 1}} &amp; MATH187 &amp; Either a mark of at least 80 in \\ &amp; &amp; MATH151 OR (in the NSW HSC \\ &amp; &amp; Examination) Mathematics Band \\ &amp; &amp; 4; or Mathematics Ext 1. &amp; MATH188 &amp; MATH187 \\\cline{2-5}                                &amp; MATH100 &amp; None &amp; MATH123 &amp; MATH187 or MATH141 with \\ &amp; &amp; &amp; &amp; co-requisites of MATH188 \\ &amp; &amp; &amp; &amp; or MATH142 \\\cline{2-5}                               &amp; CSIT110 &amp; None &amp; STAT101 &amp; None \\\cline{2-5}                                                                       &amp; ACCY111 &amp; None &amp; ACCY112 &amp; ACCY112 \\\hline \hline       \multirow{4}{*}{\textbf{Year 2}} &amp; MATH201 &amp; One of MATH110, MATH188 or \\ &amp; &amp; MATH283, or a mark of at least \\ &amp; &amp; 75 in MATH142 or MATH162, or \\ &amp; &amp; enrolment in course code 762A. &amp; MATH202 &amp; MATH201 \\\cline{2-5}                               &amp; MATH203 &amp; One of MATH101, MATH188 or \\ &amp; &amp; MATH283 or enrolment in course \\ &amp; &amp; code 762A. &amp; MATH204 &amp; MATH201 \\\cline{2-5}                               &amp; MATH222 &amp; One of MATH101, MATH188 or \\ &amp; &amp; enrolment in course code 762A &amp; MATH212 &amp; One of MATH101, MATH188, \\ &amp; &amp; &amp; &amp; MATH283 or enrolment in \\ &amp; &amp; &amp; &amp; course code 762A \\\cline{2-5}                                   &amp; STAT231 &amp; MATH188 or enrolment in \\ &amp; &amp; course code 762A. &amp; STAT232 &amp; STAT231 \\\cline{2-5}  \hline \end{tabular}   The output I get for the code above is:
48092
I want to typeset a tabular with alterning row colors, containing matrices. Somehow, when adding \rowcolors{1}{}{black!5} the left bracket of some matrices is just omited. What am I doing wrong and how can I avoid this?   \documentclass[ border=2pt]{standalone}  \usepackage{amsmath} \usepackage[natural,table]{xcolor}  \begin{document}     \rowcolors{1}{}{black!5}     \begin{tabular}[t]{ll}         \rowcolor{gray!50}{\bfseries SKP} &amp; \\ \hline         $A$ &amp; $\begin{bmatrix}-0.25 &amp; 1 \\ 0 &amp; 0.5  \end{bmatrix}$\\         $b=g$ &amp; $\begin{bmatrix}0 \\ 1\end{bmatrix}$         \end{tabular} \end{document}
51550
The following code does not align the contents of the two columns do not align properly; in particular, the content of the left column is a bit lower on the page than the content of the right column.   \documentclass [11pt]{article} \usepackage{amsmath} \usepackage{multicol}  \begin{document} \noindent So why do the two colums not align vertically? \begin{multicols}{2} \begin{align*} &amp; \text{\underline{function} } f_a(x): \\ &amp; \quad \text{\underline{begin}} \\ &amp; \quad \quad i \leftarrow 1; \\ &amp; \quad \quad \text{\underline{while}} (g(i) \neq x) \text{ \underline{do} }         i \leftarrow i +1; \\ &amp; \quad \quad f_a \leftarrow 0; \\ &amp; \quad \text{\underline{end}} \end{align*} \begin{align*} &amp; \text{\underline{function} } f_a(x): \\ &amp; \quad \text{\underline{begin}} \\ &amp; \quad \quad i \leftarrow 1; \\ &amp; \quad \quad \text{\underline{while}} (g(i) \neq x) \text{ \underline{do} }     i \leftarrow i +1; \\ &amp; \quad \quad f_a \leftarrow 0; \\ &amp; \quad \text{\underline{end}} \end{align*} \end{multicols} \end{document}   Why? And how can I fix this?  Note: I tried using \Columnbreak, to no avail. Curiously, if I add a blank line between the two align* environments, the content of the right column is a bit lower than the one on the left...
79301
Consider the following code example:  \setuppapersize[A8,landscape][A8,landscape] \starttext \startformula     \startalign         \NC 1 \NC= 1\NR         \NC 2 \NC= 1\NR         \NC 3 \NC= 1\NR         \NC 4 \NC= 1\NR         \NC 5 \NC= 1\NR         \NC 6 \NC= 1\NR         \NC 7 \NC= 1\NR         \NC 8 \NC= 1\NR     \stopalign \stopformula \stoptext   Coming from a LaTeX background I would expect align to break over pages and  tells me     Somewhere between March and Arpril, \startalign lost the ability to break equations across pages. Hopefully, it will be added back soon.   So basically it is intended to have page breaks, isn't it? Question: How to enable them for align?
32602
I am facing some problem in aligning (top-aligned) image and text in a table.  \documentclass[11pt,table,a4paper]{article} \usepackage{array,ragged2e} \usepackage{graphicx} \usepackage[top=2cm, bottom=3cm,right=1cm, left=1cm, headsep=26pt]{geometry} \usepackage[T1]{fontenc} \usepackage{fancyhdr} \usepackage[table]{xcolor} \usepackage{sidecap} \usepackage{longtable} \usepackage{helvet} \renewcommand{\familydefault}{\sfdefault} \begin{document}                          % End of preamble and beginning of  text. \arrayrulecolor{gray} \begin{center} \newcolumntype{M}[1]{&gt;{\arraybackslash}p{#1}}  \renewcommand{\arraystretch}{2.0}\begin{longtable}{M{5cm}|M{6cm}|M{6cm}} \hline \rowcolor{gray}    \textbf{ Col1} &amp;  \textbf{Col2} &amp;  \textbf{Col3} \\ \hline  \vspace{0pt} \large{ABC} &amp; \includegraphics[width=0.15\textheight, width=0.15\textwidth]{Europe_regions.png} \hspace{.1cm}    \includegraphics[width=0.15\textwidth]{male-female.png} &amp;  \vspace{0pt} XYZ.   \\ \hline    \end{longtable} \end{center} \end{document}             % End of document.     How can i top-align image and text?
18037
Below is a MWE with a tabu table that compiled perfectly fine up until I updated packages today (Dec. 16, 2018) with TeX Live Utility.  \documentclass[11pt]{article}  \usepackage{amsmath} \usepackage{xcolor} \usepackage{tabu}  \title{Example} \author{Andrew Turner}  \begin{document} \maketitle  \begin{table}[h!]     \centering      \tabulinesep = 3pt      \begin{tabu} spread 0pt {X[c$$]X[c$$]} \hline         a &amp; b \\ \hline     \end{tabu}      \caption{test} \end{table}  \end{document}   After the update, trying to compile gives a whole bunch of errors like this:  ! Missing \cr inserted. &lt;inserted text&gt;                  \cr  l.19 \end{tabu}  I'm guessing that you meant to end an alignment here.  ! Misplaced \cr. &lt;inserted text&gt; \cr   l.19 \end{tabu}  I can't figure out why you would want to use a tab mark or \cr or \span just now. If something like a right brace up above has ended a previous alignment prematurely, you're probably due for more error messages, and you might try typing `S' now just to see what is salvageable.   If I comment out the xcolor package, this fixes the issue, or if I get rid of the spread 0pt and keep the xcolor package this also fixes the issue. I looked at what just updated in TeX Live Utility, and I wonder if it has to do with the recent update of colortbl.  Any help would be greatly appreciated.    Here is a further example. This is actually exact same, as recent version(s) of fancyvrb require package xcolor.     this is obsolete since release 3.2 (2019/01/08) of fancyvrb which does not load xcolor anymore.   \documentclass{article} \usepackage{fancyvrb} \usepackage{tabu} \begin{document} \begin{tabu}spread 0pt {XX} A &amp; B \end{tabu} \end{document}   breaks with  ! Missing } inserted. &lt;inserted text&gt;                  } l.10 \end{tabu}  ?    Simply commenting out loading of fancyvrb it compiles, or using TL2017 (my TL2018 is already fully updated...) it compiles also.
68567
\begin{table}     \begin{tabular}{|c|c|c|c|c|}     \hline     \multicolumn{5}{|c|}{\textbf{Table 1:}Unfiltered Water}\\     Concentration of analyte in sample   &amp; Avg &amp; Std Dev &amp;  RSD &amp; 90\% CI \\      \hline     Total hardness (ppm $CaCo_3$ equiv)  &amp; 97  &amp;    2   &amp;  2\%  &amp; \pm 5   \\     Calcium hardness (ppm $Ca^{2+}$)     &amp; 57  &amp;    3   &amp;  5\%  &amp;  \pm 5   \\     Magnesium hardness( ppm $Mg^{2+}$)   &amp; 40  &amp;    3   &amp; 7.5\% &amp;  \pm 5 \\     \hline     \end{tabular}   This table is giving me an error. That says   ! Missing $ inserted. &lt;inserted text&gt; $ l.41 ...Co_3 equiv\) &amp; 97 &amp; 2 &amp; 2\% &amp; \pm 5 \I've inserted a begin-math/end-math symbol since I think   you left one out. Proceed, with fingers crossed.  What is the cause of this error?  I can't seem to find any thing that is mismatched.
45593
The code  \documentclass[a4paper]{article} \usepackage{multirow} \begin{document}  \begin{tabular}{|l|l|l|l|l|l|l|}   \hline   \multirow{2}{*}{Color Type} &amp; \multirow{2}{*}{Channels} &amp; \multicolumn{5}{c}{Bits per     channel} \\       \cline{3-7}   &amp; &amp; 1 &amp; 2 &amp; 4 &amp; 8 &amp; 16 \\       \hline \end{tabular}  \end{document}   Results in the table    How may I fix this code so that a vertical line is also added after "Bits per channel"?
121259
I have the following table:  \begin{tabular}{|p{3cm}|p{1.5cm}|p{1.5cm}|p{1.5cm}|p{1.5cm}|} \hline \centerline {image}  &amp;    \multicolumn{2}{c|}{ABC} &amp; \multicolumn{2}{c|}{DEF} \\ \hline  &amp; \centering A&amp;\centering B&amp;\centering C&amp;\centering D  \\ \hline \centerline 1&amp;&amp;&amp;&amp; \\ \hline \centerline 1&amp;&amp;&amp;&amp; \\ \hline \centerline 1&amp;&amp;&amp;&amp; \\ \hline \centerline 1&amp;&amp;&amp;&amp; \\ \hline \end{tabular}   When I try centering D, I have a problem in the shape of the table. Why is that? How can I center it appropriately?  Thanks.
36955
Consider the following m(non-)we:  \documentclass{standalone} \begin{document} Foo &amp; Bar \end{document}   The build will fail with  ! Misplaced alignment tab character &amp;.   while it will generate a perfectly fine PDF when removing the &amp; character from the code.  Even plain TeX behaves like that and  Foo &amp; Bar \bye   yields the same error.  I have only ever seen &amp; used in tabular and array environments, never outside of it. Why is that?  Couldn't one define e.g. \tabular and \endtabular so that &amp; is only special inside the environment, and just a normal character outside of these environments?  Why does &amp; outside of tabular and array environments have to break the document?  To rephrase the question: WTF is an alignment tab character and where do we usually put it?
40040
I'm trying to create the following table. This is the code which I wrote.   \begin{table}[!htb] \centering \caption{"table1"} \begin{tabular}{|c|c|c|c|c|c|c|c|} System &amp; \multicolumn{2}{c}{Interaction} &amp; \multicolumn{2}{c}{Commit} &amp; Ver &amp; LOC &amp; terms \\\hline \multirow{3}{c}{System1} &amp; \multicolumn{2}{c}{3272 traces} &amp; \multicolumn{2}{c}{5093 revisions} &amp; \multirow{3}{c}{3.4} &amp; \multirow{3}{c}{1700} &amp; \multirow{3}{c}{2400} \\\hline &amp; File &amp; Method &amp; File &amp; Method &amp; &amp; &amp; \\\hline &amp; 12 &amp; 13 &amp; 14 &amp; 15 &amp; &amp; &amp; \\\hline  \end{tabular} \end{table}   and this the error that Latex shows:! Missing number, treated as zero.!
90390
So I have this code:  \begin{center} \footnotesize \begin{tabular}{| c | c  c  c |}       \hline       \multirow{3}{*}{Equipment acquired at start of year} &amp; \multicolumn{3}{c|}{Replacement cost (\$) for given years}\\       \cline{2-4}       &amp; 1 &amp; 2 &amp; 3\\       \hline       1 &amp; 4000 &amp; \multicolumn{1}{|c|}{5400} &amp; 9800\\       2 &amp; 4300 &amp; \multicolumn{1}{|c|}{6200} &amp; 8700\\       3 &amp; 4800 &amp; \multicolumn{1}{|c|}{7100} &amp; -\\       4 &amp; 4900 &amp; \multicolumn{1}{|c|}{-} &amp; -\\       \hline \end{tabular} \end{center}     What I want is that the column 3 is evenly width like column under 1 and 2. Also I want "Equipment acquired at start of year" to be centered between the two multirows.  Any ideas? xD
67778
I'm using the following code. What should I do if I don't want the fixed indent from the left margin of my page? ‎  \documentclass[‎fleqn,oneside‎]{article}‎ ‎\usepackage{amsmath}‎ .... \begin{align} a_1&amp; =b_1+c_1\\ a_2&amp; =b_2+c_2-d_2+e_2 \end{align}