3

I have a the following command in a resume.cls file

\newcommand{\name}[1][]{\newcommand{\@name}{#1}}

I try to use it in my tex file with

\documentclass{resume}
\name{My Name}
% use \@name in fancyhdr
\begin{document}
% body
\end{document}

But I get

LaTeX Error: Missing \begin{document}

l.5 \name{M
            y Name}

Can you not issue custom commands in the preamble?

  • Where is this class file coming from? – Johannes_B Sep 8 '15 at 16:49
3
\newcommand{\name}[1][]{\newcommand{\@name}{#1}}

defines \name to have an optional argument so the syntax for use is

\name[My Name]

with square brackets.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.