I'm creating a resume and have create my own custom resume class (doesn't everybody?). I have multiple positions that I want to typeset so I have something like this:
\documentclass{mcv}
\begin{document}
\positiontitle{Manager}
\begin{position}
...
\end{position}
\positiontitle{Pee-on}
\begin{position}
...
\end{position}
\end{document}
This works well until I add the second position title (i.e., Pee-on). Then I get an error like LaTeX Error: Command \@positiontitle already defined. Of course it is I defined it earlier, but now I need re-define it and I'm not sure how to do this.
Using this answer I found some help so I tried to implement my command in this way:
\newcommand{\positiontitle}{\newcommand\@positiontitle{#1}}
\newcommand{\@positiontitle}[1]{%
\provide@command{#1}{}%
\renew@command{#1}%
}
Unfortunately, that didn't do the trick and I'm still getting the same "already defined" error. I must be doing something wrong, but I don't know what it is.
\positiontitlebe the one with the argument (and why would the initial definition of\@positiontitlehave one)? Does changing the first command to\newcommand{\positiontitle}[1]{\renewcommand\@positiontitle{#1}}and the second to something like\newcommand{\@positiontitle}{Default Position}solve your problem? If not, explain further what the use of these commands is supposed to be. – frabjous May 10 '22 at 01:59renewcommandas you suggested. – jlconlin May 10 '22 at 02:35\@positiontitleis not already defined, then use\definstead of\renewcommand. – Ulrich Diez May 10 '22 at 20:44