在 .cls 文件中不需要 \makeatletter 和 makeatother`

把这 4 个东西注释了就ok了
我整理了一个最小工作示例
\begin{filecontents}{test.cls}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{test}
\LoadClassWithOptions{article}
\makeatother
\newcommand{\test}{\makeatletter \@title \makeatother}
\end{filecontents}
\documentclass{test}
\title{test}
\begin{document}
\test
\end{document}原因为 \makeatletter 在 \newcommand 环境中无效,参见问题:https://tex.stackexchange.com/questions/201348/why-doesnt-makeatletter-work-inside-newcommand