I want to redefine \maketitle the way it contains my custom command. I have a home assignment and I'd like to put \@variant command or something to be able to set it later as with \@author and \@title.
Here is my redefinition
\makeatletter
\renewcommand{\maketitle}{
\begin{center}
\vspace{2ex}
\textbf{\huge \textsc{\@title}}
\vspace{3ex}\\
\Large \@author\\
\hrulefill\\
\vspace{1ex}
\end{center}
}
\makeatother
Then in preambule I have such commands:
\title{My beautiful title}
\author{My Name}
And I want to write \varian{number} after \author and get it right under my name.
Here is the definition of the \variant:
\newcommand{\variant}[1]{Variant №\:#1}
And it should be something like that:
\makeatletter
\renewcommand{\maketitle}{
\begin{center}
\vspace{2ex}
\textbf{\huge \textsc{\@title}}
\vspace{3ex}\\
\Large \@author\\
\small \@variant\\
\hrulefill\\
\vspace{1ex}
\end{center}
}
\makeatother
\title{My beautiful title}
\author{My Name}
\variant{number}
Important: I don't want to hard code it straight away in the redefinition, I want to make everything fancy. And I don't want to use any additional packages.

