1

I am new in LaTeX. I have seen similar problem around here but I cannot find a particular solution for my case (or I don't understand the solution). I use Texmaker 5.0.2. I would appreciate any help. Thanks.

The issue came up when I generated a standard table like this:

\begin{tabular}{ c c}
\hline 
H & G \\ 
\hline 
2 & 3 \\ 
\hline 
\end{tabular} 

enter image description here

Giving the error message:

! Missing # inserted in alignment preamble. \cr l.15 \begin{tabular}{ c c} There should be exactly one # between &'s, when an \halign or \valign is being set up. In this case you had none, so I've put one in; maybe that will work. ! Extra alignment tab has been changed to \cr. \endtemplate l.17 H & G \ You have given more \span or & marks than there were in the preamble to the \halign or \valign now in progress. So I'll assume that you meant to type \cr instead. ! Extra alignment tab has been changed to \cr. \endtemplate l.19 2 & 3 \ You have given more \span or & marks than there were in the preamble to the \halign or \valign now in progress. So I'll assume that you meant to type \cr instead.

I have used this setup:

\documentclass[12pt]{report}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\usepackage{xparse,nameref}
\NewDocumentCommand{\chapref}{s m}{Chapter~\ref{#2}\IfBooleanF{#1}{ \nameref{#2}}}
\usepackage[super,numbers,sort&compress]{natbib}
\usepackage{palatino}
\usepackage{amssymb,amsfonts,amsmath,amsthm}
\usepackage{multicol}
\usepackage{array}
\usepackage{latexsym}
\usepackage{mathdots,mathtools}
\usepackage{ftnxtra}
\usepackage{graphicx}
\usepackage{bibunits}
\usepackage[colorlinks,allcolors=blue]{hyperref}%citation links
\newtheorem{theorem}{Theorem}
\usepackage{blindtext}
\usepackage[raggedright]{titlesec}
\usepackage{fancyhdr}
\usepackage[Bjornstrup]{fncychap}
\pagestyle{fancy}
\fancyhead{}
  • Because your example it seems you have been forgotten to use the double backslash for finish the row of the table. – Aradnix Nov 1 '17 at 21:47
  • 2
    @Aradnix: The example seems to be correct, but array should be loaded after ftnxtra, apparently, since it redefines \@tabular and \@endtabular, conflicting with previous versions of that command – user31729 Nov 1 '17 at 21:53
  • 1
    Of course, this preamble is quite messy! – user31729 Nov 1 '17 at 21:55
  • 1
    The package latexsym has been deprecated since ca. 1995. Why are you loading it -- especially since you're also loading amssymb, the package that succeeded latexsym? – Mico Nov 1 '17 at 23:46
  • Thank you all. I could solve it by moving array package before ftnxtra as @Aradnix pointed out. – Wud Nov 3 '17 at 2:25
1

The ftnxtra package redefines \@tabular and \@endtabular, which conflicts with the extensions for tabular provided by array, leading to errors.

Just load ftnxtra (if really needed) before array in order to compile this document.

%\documentclass{article}


\documentclass[12pt]{report}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\usepackage{xparse,nameref}
\NewDocumentCommand{\chapref}{s m}{Chapter~\ref{#2}\IfBooleanF{#1}{ \nameref{#2}}}
\usepackage[super,numbers,sort&compress]{natbib}
\usepackage{palatino}
\usepackage{amssymb,amsfonts,amsmath,amsthm}
\usepackage{multicol}
%\usepackage{latexsym}
\usepackage{mathdots,mathtools}
\usepackage{ftnxtra}
\usepackage{array}
\usepackage{graphicx}
\usepackage{bibunits}

\newtheorem{theorem}{Theorem}

\usepackage{blindtext}
\usepackage[raggedright]{titlesec}
\usepackage{fancyhdr}
\usepackage[Bjornstrup]{fncychap}
\pagestyle{fancy}
\fancyhead{}

\usepackage[colorlinks,allcolors=blue]{hyperref}%citation links


\begin{document}

\begin{tabular}{cc}
\hline 
H & G \\ 
\hline 
2 & 3 \\ 
\hline 
\end{tabular} 
\end{document}
| improve this answer | |
  • Thank you @Christian Hupfer. I meant to say I loaded 'array' after 'ftnxtra'. – Wud Nov 8 '17 at 0:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.