0

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.

jlconlin
  • 10,172
  • Code we can't compile isn't of much use for testing, and it's pretty unclear what you're trying to do. Shouldn't \positiontitle be the one with the argument (and why would the initial definition of \@positiontitle have 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:59
  • Thank you @frabjous for interpreting my gibberish. I apologize it wasn't more clear. The problem was that I file to have renewcommand as you suggested. – jlconlin May 10 '22 at 02:35
  • If you don't need an error-message in case \@positiontitle is not already defined, then use \def instead of \renewcommand. – Ulrich Diez May 10 '22 at 20:44

0 Answers0