3

I am in the process of writing my own class for CV/Resume purposes, with the help of this website. However, when I compile cv.tex I get an error of undefined control sequence and also a missing \begin{document error}. Below I have included the code for cv.tex and my_cv.cls (the class file I am writing). I am unable to figure out what exactly has been causing these errors, but when I build into PDF, I get the desired output but with a blank page preceding it (the error messages do not go away).

cv.tex:

\documentclass{my_cv}

\begin{document}

\section{Education}
\datedsubsection{University of Blah}{2016--}

\section{Employment}
\subsection{Blah Blah}

\end{document}

my_cv.cls:

\NeedsTexFormat{LaTeX2e}
\ProvidesClass{my_cv}[2016/07/23]
\LoadClass{article}
\RequirePackage{titlesec}

\titleformat{\section}
    {\Large\scshape\raggedright}
    {}{0em}
    {}
    [\titlerule]

\titleformat{\subsection}
    {\large\raggedright}
    {}{0em}
    {}

\newcommand{\datedsection}[2]{
    \section[#1]{#1 \hfill #2}
}

\newcommand{\datedsubsection}[2]{
    \subsection[#1]{#1 \hfill #2}
}
4

You have a typo in the first line of your class file. If you compile interactively, LaTeX tells you this.

! Undefined control sequence.
l.5 \NeedsTexFormat
                   {LaTeX2e}

The macro should be

\NeedsTeXFormat{LaTeX2e}
  • 2
    (the difference is the X in TeXFormat that must be written with upper case. Took me a while to find it!) – ebosi Jul 24 '16 at 8:05

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.