我正在尝试实现一个新命令,类似于哈维·谢泼德但我得到了错误
! LaTeX Error: Command \@ already defined. Or name \end... illegal, ...
你能告诉我为什么我会收到这个错误吗?
以下是我的代码片段:
\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}
答案1
@
不允许使用 is 命令名称,除非您将其作为 或 的一部分编写.cls
。如果您在常规文档中.sty
使用内部宏,请使用@
\makeatletter
% Your macros containing @ here
\makeatother