I'm making a custom Latex class which I am basing on the article class. When compiling a document I get ! LaTeX Error: No \title given., even though I use \title in the document.

How can I solve this problem?

  • 5
    We need to know your custom code for the class. Add a MWE and attach the .cls. – osjerick Dec 1 '13 at 23:00
  • Do you, by any chance, use \maketitle before using \title in your document? – jub0bs Dec 1 '13 at 23:15

The error means \@title hadn't been defined by the time \maketitle is used.

So either you haven't used \title or used it in a local group, or redefined it not to define \@title.

  • I use \@title in the class to define a header for my class: how should I get at that information in a better way? – adamse Dec 2 '13 at 12:24
  • @adamse hard to say as you have not shown any code. But you can't use a command before it has been defined... – David Carlisle Dec 5 '13 at 9:22
  • My solution: supply a command \makeheadfoot that creates the header. – adamse Dec 23 '13 at 12:42

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.