2

I've created a very simple class file as follows:

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{cv}
\LoadClass{article}
\RequirePackage{titlesec}

\titleformat{\section}{\Large}{}{0pt}{}

When compiling the simple script:

\documentclass{cv}

\begin{document}

\section{Education}
\subsection{University of Blah}
\section{Work Experience}

\end{document}

I am met with the following error message:

This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./CV.tex
LaTeX2e <2016/02/01>
Babel <3.9q> and hyphenation patterns for 81 language(s) loaded.
(./cv.cls
Document Class: cv 
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texlive/texmf-dist/tex/latex/titlesec/titlesec.sty)
! Undefined control sequence.
l.6 \titleformat
                {\section}{\Large}{}{0pt}{}

I have the package titlesec, and can use general other commands from it, so I can't fathom what the problem is here.

1
  • your document runs without error in tl 2018, I note you are using texlive 2015 perhaps it's not in the old version of titlesec (I don't have tl 2015 easily available to check) Commented Jul 4, 2018 at 22:15

1 Answer 1

0

No problem here with a fully updated TeX Live 2018. Add \listfiles to the top of your document and compare it to my output:

  *File List*
       cv.cls    
  article.cls    2014/09/29 v1.4h Standard LaTeX document class
   size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
 titlesec.sty    2016/03/21 v2.10.2 Sectioning titles
  ***********
2
  • This was the problem - it turned out that the package hadn't actually been installed with texlive-full or texlive-latex-extra (tlmgr info titlesec said it was not installed). Used the workaround here to get my tlmgr to work on ubuntu properly I then used tlmgr install titlesec and now it works.
    – BHC
    Commented Jul 4, 2018 at 23:10
  • @BHC something strange about your setup though as the log you showed has (/usr/share/texlive/texmf-dist/tex/latex/titlesec/titlesec.sty) which showed that you did have a titlesec.sty installed. Commented Jul 5, 2018 at 6:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .