3

I am trying to implement a new command like that implemented by Harvey Sheppard but I get the error

! LaTeX Error: Command \@ already defined. Or name \end... illegal, ...

Can you tell me why I am getting this error?

Here is a snippet of the code that I have:

\documentclass[a4paper]{book}

\usepackage{microtype}
\usepackage{graphicx}
\usepackage{calc}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{mdframed}
\usepackage{listings}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%       Package Commands
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\picturespath}{pictures/}

% Title content
\newcommand{\@titleContent}[2]{
    \begin{minipage}{.75cm}
        \@afterindentfalse\@afterheading
        \raisebox{2mm}{\includegraphics[width=\linewidth]{\picturespath #1}}
    \end{minipage}\hspace*{1mm}\begin{minipage}{\textwidth-1.05cm}
            {\Large #2}
    \end{minipage}
}

\begin{document}

This is just a test of the code

\end{document} 
Joe
  • 9,080

1 Answers1

5

@ is command names are not allowed unless you're writing it as part of a .cls or .sty. If you're using @ inside macros within your regular document, use

\makeatletter
% Your macros containing @ here
\makeatother

Reference: What do \makeatletter and \makeatother do?

Werner
  • 603,163