I'm editing my CV with LyX 2.1.3 in Ubuntu 15.04. The following code produces an error ! Argument of \@firstoftwo has an extra }. The error appears in LyX and also when exporting to LaTeX and running with TeXmaker.



%%%%%%%%% User specified LaTeX commands. %%%%%%%%%

\firstname{John}                                     % required
\familyname{Smith}                                   % required
\title{Curriculum Vitae}                             % optional
\address{23 Main St. \#1}{12345 city, ST\\ U.S.A.} % optional
                                    % '\\' adds a line break
\mobile{+1(123)456 7890}   % optional
\email{myemail@email.com}  % optional
\quote{ }                  % optional




% Contents of the CV that are commented out. 


The first question is how to fix this error in LaTeX? The second question is if I can avoid LaTeX and fix this from within LyX?

I'd like to get into LyX with any tools or documentation. However, I can't seem to find the appropriate one. Thanks.

  • The code you posted is incomplete as far as LaTeX is concerned, you will get Missing \begin{document}. It will not produce the code you say.
    – Johannes_B
    Sep 23 '15 at 16:05
  • You cannot avoid LaTeX. LaTeX is the base, LyX needs it. LyX is an interface for experienced LaTeX users, as far as one developer once stated.
    – Johannes_B
    Sep 23 '15 at 16:06
  • Thanks for the response. I have included the whole ModernCV settings that I'm using. The error happens in the \vspace*{-10 mm}.
    – Diego-MX
    Sep 23 '15 at 16:18
  • 1
    You cannot use a linebreak there for up-to-date versions of moderncv, use an additional argument: \address{Walzing Wombat}{samba snake}{USA}.
    – Johannes_B
    Sep 23 '15 at 16:45
  • 1
    Looking at the parts of a model airplane, can you tell that parts won't fit in advance? LaTeX noticed the mistake when assembling the document, i.e. expanding macros and buildung blocks of text.
    – Johannes_B
    Sep 23 '15 at 16:56

After careful examination with the help of @Johannes_B, we found the issue to be LaTeX related and didn't have anything to do with LyX.

The template moderncv changed the arguments for the address field, and no longer allows for \\ as was suggested in the comments. Instead one should use curly braces for each new line.

\address{23 Main St. \#1}{12345 City, State}{Country}

For its identification, it was helpful to export the LyX file into LaTeX and run it there and see that it's the same error.

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.