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} 
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?

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.