LyXmoderncv | Undefined Control Sequence Errors

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
msl
Posts: 9
Joined: Sun Mar 04, 2012 9:33 pm

moderncv | Undefined Control Sequence Errors

Post by msl »

Hello All,

I recently downloaded LyX 2.0 (having used LyX 1.x a long time ago) and I was trying to make my CV in it. However, for document class curriculum vitae (modern) I cannot even view a blank page of pdf-output without getting five "Undefined control sequence" errors with the following short log text:

\begin{document}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

I'm relatively new to the new LyX. What do I do?

Thank you.
MSL

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10334
Joined: Mon Mar 10, 2008 9:44 pm

Re: moderncv | Undefined Control Sequence Errors

Post by Stefan Kottwitz »

Hi,

welcome to the board!

Perhaps post the .log file here as attachment. For this, click the "Upload attachment" below the edit text field when writing.

Generally, it's good to post the document code itself which causes the problem.

Stefan
LaTeX.org admin
msl
Posts: 9
Joined: Sun Mar 04, 2012 9:33 pm

moderncv | Undefined Control Sequence Errors

Post by msl »

Thank you for the advice. The Log file is attached. According to LyX 2.0.2, the LaTeX source is the following:

Code: Select all

% Preview source code

%% LyX 2.0.2 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{moderncv}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setcounter{secnumdepth}{2}
\setcounter{tocdepth}{2}
\usepackage{babel}
\begin{document}

\section{}
\end{document}
Thanks for anything you could tell me.
Attachments
Logfile.txt
(20.91 KiB) Downloaded 425 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10334
Joined: Mon Mar 10, 2008 9:44 pm

moderncv | Undefined Control Sequence Errors

Post by Stefan Kottwitz »

In the .log file I can see:

Code: Select all

! Undefined control sequence.
<argument> \@firstname 
                       ~\@familyname
This shows the problem: you did not set a name, and at least the name is required for the CV. The error would go away and the document is compilable when the name is added, I tested it in the preamble:

Code: Select all

\firstname{John}
\familyname{Doe}
Stefan
LaTeX.org admin
msl
Posts: 9
Joined: Sun Mar 04, 2012 9:33 pm

moderncv | Undefined Control Sequence Errors

Post by msl »

Thanks,

How do I set a name in the LyX?
How do I access the preamble of the document from LyX 2.0.2?

Simply writing:

Code: Select all

\firstname{John}
\familyname{Doe}
into the body after selecting TeX Code doesn't work as expected.

Once again, thanks!
Last edited by Stefan Kottwitz on Tue Mar 13, 2012 12:52 pm, edited 1 time in total.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10334
Joined: Mon Mar 10, 2008 9:44 pm

Re: moderncv | Undefined Control Sequence Errors

Post by Stefan Kottwitz »

It doesn't work in the body text, it has to be in the preamble. There's a menu item "Document settings" in LyX, where you can find a text field where you can put such preamble settings.

Stefan
LaTeX.org admin
msl
Posts: 9
Joined: Sun Mar 04, 2012 9:33 pm

Re: moderncv | Undefined Control Sequence Errors

Post by msl »

Ok, I can get it to work with text in the document. However, if I leave no text in the document I get the following error:

Adobe Reader could not open 'CV.2012.14.3.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded).

This is in Adobe X. What is going on here?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10334
Joined: Mon Mar 10, 2008 9:44 pm

Re: moderncv | Undefined Control Sequence Errors

Post by Stefan Kottwitz »

Check if the file exists and if it has a file size greater than zero.

If it exists, you could try a different viewer instead of the Adobe Reader X. You could also post it as attachment here to a post.

Stefan
LaTeX.org admin
msl
Posts: 9
Joined: Sun Mar 04, 2012 9:33 pm

Re: moderncv | Undefined Control Sequence Errors

Post by msl »

Ok, here is the attached file. According to Windows explorer is 1.37 kb and not size-zero. I have no idea why it will not work without any words in the body of the document.
Attachments
CV.2012.4.3.lyx
(1.37 KiB) Downloaded 437 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10334
Joined: Mon Mar 10, 2008 9:44 pm

Re: moderncv | Undefined Control Sequence Errors

Post by Stefan Kottwitz »

If there are no pages (because of no text in the document body), LaTeX doesn't produce a PDF. So it cannot be opened.

I don't see a problem here. Just write text into the document body. For sure it's not the intention to work with a LaTeX file without text. Or why should there be a problem?

Stefan
LaTeX.org admin
Post Reply