0

The following code returns the error message in the title

\usepackage{amsmath,amssymb}
    \usepackage{setspace}
    \begin{document}
      \begin{titlepage}%
            \noindent
            \includegraphics[viewport=8 8 185 55]{picture} \hfill
             \vspace{-6pt}
    \vspace{3cm}

    \let\footnotesize\small
    \let\footnoterule\relax
    \let \footnote \thanks

    \begin{center}
        \begin{spacing}{1.8}
          {\huge \bfseries \@title}
        \end{spacing}

        \large \@thesistype
    \end{center}

    \vspace{0.4cm}

    \begin{center}
        \large
        \@author

        \texttt{\small \@email}
    \end{center}%

    \vspace{0.4cm}

    \begin{center}
        \@institute
    \end{center}

    \vspace{1cm}

    \ifx \@logo \@empty
        \relax
    \else
    \begin{center}
        \@logo
    \end{center}
    \fi

    \vfill
    \begin{center}
        \textbf{Supervisors:} \\[2pt] \@supervisors
    \end{center}

    \vspace{0.2cm}

    \begin{center}
        \@date
    \end{center}

\end{titlepage}% \end{document}

A very similar problem is discussed here: \@ title and You can't use `\spacefactor' in vertical mode However, I am too inexperienced to figure out what to do exactly. For example, I don't understand what command I am redefining that is so problematic. The incriminated line is {\huge \bfseries \@title}. Any easy fixes for this?

Alex
  • 63
  • 2
    you need to surround code using @ with \makeatletter ... \makeatother (or put it in a .sty package file) – David Carlisle Jan 22 '24 at 11:22
  • Thank you @DavidCarlisle. It worked on the incriminated line. However when I do this around \large @thesistype. I define it in the preamble as \newcommand\thesistype[1]{\gdef @thesistype{#1}} but it still does not work: "undefined control sequence" – Alex Jan 22 '24 at 11:49
  • 1
    \makeatletter\newcommand\thesistype[1]{\gdef\@thesistype{#1}}\makeatother, you have to put the \makeatletter around the definition, not inside it. – Skillmon Jan 22 '24 at 11:50
  • Thanks a lot @Skillmon. It works everywhere now, and I get no error message, however the logo is not actually loaded and does not appear in the front page although it is in the overleaf folder. I load it with \logo{filename.png} – Alex Jan 22 '24 at 12:05
  • Instead of the logo itself, the filename gets printed on the page. – Alex Jan 22 '24 at 12:11
  • @Alex most likely because \logo only stores the file name inside \@logo, but we can't really reproduce because that's missing in your question. My bet is use \includegraphics{\@logo} in your titlepage instead of just \@logo (but don't change the \@logo in the \ifx line). – Skillmon Jan 22 '24 at 12:13

0 Answers0