1

I'm trying to change the maketitle command in order to add a logo over the title. When importing the package graphicx I'm getting the following error :

! Misplaced \crcr.
\endarray ->\crcr 
              \egroup \egroup \@arrayright \gdef \@preamble {}
l.29     \maketitle

Here is my code :

\documentclass[a4paper, 12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage{diagbox}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{graphicx}

\title{CatCatch\\Cahier des charges}
\author{Several Authors}
\date{19 janvier 2018}

\makeatletter
\def\@maketitle{
\begin{titlepage}
    \begin{center}
        \includegraphics[width=120mm]{logo.png}\\[8ex]
        {\Huge \@title }\\[4ex] 
        {\Large \@author}\\[4ex] 
        \@date\\[8ex]
    \end{center}
\end{titlepage}}
\makeatother

\begin{document}
    \maketitle
\end{document}

Thanks in advance

  • 1
    Welcome to TeX.SX! Please, make a minimal example that produces the error (probably you have more than one author with \and between them). – egreg Jan 15 '18 at 10:16
2

The error only appears if you separate author names by \and.

You should redefine \and to do something meaningful with your redefinition of \@maketitle: the default definition doesn't.

Note the small changes I made: the \\ should be inside the scope of the font size changing commands, or the spacing would be wrong.

\documentclass[a4paper, 12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage{diagbox}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{graphicx}

\title{CatCatch\\Cahier des charges}
\author{A. Uthor \and W. Riter}
\date{19 janvier 2018}

\makeatletter
\renewcommand{\and}{\\}
\def\@maketitle{%
\begin{titlepage}
    \begin{center}
        \includegraphics[width=120mm]{example-image}\\[8ex]
        {\Huge \@title\\[4ex]}
        {\Large \@author\\[4ex]}
        \@date\\[8ex]
    \end{center}
\end{titlepage}}
\makeatother

\begin{document}
    \maketitle
\end{document}

I used example-image instead of logo, just in order to typeset something visible.

enter image description here

  • I did what you said, but the logo doesn't show up anyway. Is it because I use \bsc in the author tag ? Also, I'm using the argument titlepagein \documentclass – Marc Schmitt Jan 15 '18 at 10:31
  • @MarcSchmitt Sorry, but it’s impossible to give advice about code you don’t show. – egreg Jan 15 '18 at 11:32
  • Sorry I'm having a huge headache. When I get back at my computer, I'll upload the whole thing – Marc Schmitt Jan 15 '18 at 11:37
  • Here, I modified my question with the new code – Marc Schmitt Jan 15 '18 at 13:00
  • @MarcSchmitt You shouldn't change the question so as to invalidate the answer, so I rolled back the change. Anyway, I have no problem with the image. Please, open a new question for the different problem. – egreg Jan 15 '18 at 13:07

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.