I followed the advice on the question What do \makeatletter and \makeatother do? to try to make a custom command that displays a custom title page, but it is not working.
./article.tex:17: You can't use `\spacefactor' in vertical mode.\@ ->\spacefactor
\@m
l.17 \makecustomtitle
Sorry, but I'm not programmed to handle this case;
I'll just pretend that you didn't ask for it.
If you're in the wrong mode, you might be able to
return to the right one by typing `I}' or `I$' or `I\par'.
./article.tex:17: Missing $ inserted.<inserted text>
$
l.17 \makecustomtitle
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
./example.tex:17: You can't use `\spacefactor' in math mode.\@ ->\spacefactor
\@m
l.17 \makecustomtitle
Sorry, but I'm not programmed to handle this case;
I'll just pretend that you didn't ask for it.
If you're in the wrong mode, you might be able to
return to the right one by typing `I}' or `I$' or `I\par'.
./example.tex:17: Missing $ inserted.<inserted text>
$
l.17 \makecustomtitle
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
What follows is the simplified code:
\documentclass[12pt]{article}
\newcommand{\makecustomtitle}{
\begin{titlepage}
\makeatletter
\@title by \@author
\makeatother
\end{titlepage}
}
\begin{document}
\title{Please, be my title}
\author{Andres Riofrio}
\makecustomtitle
Take on me.
\end{document}