1

Below is the LaTeX code for which I am getting the LaTeX error "missing \begin {document}. How can I resolve this error?

\documentclass[a4paper]{MY CV}

\begin{document}
    Hello!
\end{document}

And this is the error:

Error

1

Do not create your own class file with spaces in them. That is, instead of MY CV.cls, create MYCV.cls and use

\documentclass[..]{MYCV}
2
  • I haven't created any class file. That's why I'm getting another error .cls not found. – Mehul Bhatt Sep 1 '16 at 11:33
  • @MehulBhatt: You don't have to create a class file for every document you want to create. There are a number of default classes available (article, book and report, for example) and some people have written classes for specific purposes. If you're interested in creating a CV, consider using something like moderncv. Perhaps you can start with an online template first. Also of interest would be reading Classes and packages – what's the difference? – Werner Sep 1 '16 at 15:23
0
\documentclass[a4paper]{MY CV}

This is not ment to specify your file "MY CV". Instead it should contain something like:

\documentclass[a4paper]{article}

to specify, what type of document you are writing.

Have closer look at some tutorials/instructions :)

Edit: You can actually specify a class like "MY CV" (or "MYCV"), but this does not seem to be the issue...

Edit2: As mentioned by Werner, the "MY CV"-part IS the issue. Changing it to "MYCV" will solve this, if a "MYCV.cls" exists.

5
  • What does \documentclass{article article} \begin{document} test \end{document} yield when you compile it? – Werner Aug 31 '16 at 20:38
  • I get the same error-message, as shown in the question above. But I have not tried to write a class file, with a name separated by spaces. – dudakl Aug 31 '16 at 21:08
  • So why would you say "this does not seem to be the issue..." if a space introduced in the name of a document class replicates the error (even if the class does not exist)? – Werner Aug 31 '16 at 21:09
  • The class name "MY CV" looked somewhat like a beginners try on a first latex-document, so i assumed, he needed a more general help. Maybe I should not read that much between the lines, but I still have to learn many things on forums, as I am very new too. – dudakl Aug 31 '16 at 21:13
  • Thank you both. Yes this was my first attempt at LaTeX and as a matter of fact I didnt know that I also have to create a class file – Mehul Bhatt Sep 1 '16 at 11:32

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.