I need to create a really simple document template for other people to fill in and compile (e.g., they need to provide a name and email address). I could distribute it as a .cls file and a template .tex file, but I think it might be easier to just distribute it as a single file.

It appears that one can compile a document without a \documentclass without any warnings. For example, despite not having a \documentclass line, the following is a complete MWE:

Hello world

Where the entire "class" is \renewcommand\normalsize{\fontsize{10pt}{12pt}\selectfont}. What are the drawbacks of defining the entire "class" within the .tex file and not using a \documentclass line?


To add a little more about what I am doing. I created a custom class that was not based on any other class. I then took David Carlisle idea

and changed



%  your definitions

but this caused conflicts of things that were defined in both myclass and the article class. It probably would have been better to use the minimal class, but I realized that I didn't need the \documentclass{article} before I thought about the minimal class.

  • 2
    For one, inability to use \usepackage. Jan 21, 2013 at 14:49
  • 1
    I thought \documentclass was mandatory :P Jan 21, 2013 at 15:00
  • It might not be good LaTeX style, but Daniel's code actually works ;) Jan 21, 2013 at 15:01
  • Me too, which is why I asked.
    – StrongBad
    Jan 21, 2013 at 15:13
  • texdoc source2e and search for \normalsize is used to produce an error, so if you define it you can run a classless document. Jan 21, 2013 at 15:15

3 Answers 3


If you look at minimal.cls you will see it does a bit more than just set the normal font size:

\ProvidesClass{minimal}[2001/05/25 Standard LaTeX minimal class]



\pagenumbering{arabic}  % but no page numbers are printed because:
\pagestyle{empty}       % this is actually already in the kernel

In particular things are likely to go very wrong if you don't set \textheight and \textwidth.

However there is no advantage to not using a real class such as article and many disadvantages.

If you just want to distribute a single template file and no class file use a format like



 %  your definitions




Looking at the edited question, if your custom code does set up everything then you could just stick it at the top as you said, the problems with minimal then don't apply. Perhaps better though would be to use a form

% your definitions

That way the file can easily be switched between assuming myclass is already installed and including it inline. Such ad-hoc distribution of local class and package files was one of the main motivations for adding filecontents to LaTeX2e.

  • I tried exactly this before asking. The problem I ran into was conflicts with the article class and my class defining the same macros. I would have needed to change many \newcommand's to \renewcommand's. I therefore think the minimal class is probably better in this situation.
    – StrongBad
    Jan 21, 2013 at 15:23
  • 4
    No, I promise you, it isn't. minimal is the smallest class I could make that would let you test the new (at the time) package loading mechanism but if you use it for actual documents things will go wrong. Math isn't set up, font size commands are not set up, figures/tables are not set up, more or less anything that any package that you load expects has not been set up. Jan 21, 2013 at 16:25
  • see edited answer. Jan 21, 2013 at 16:57
  • If you look at mininmal.cls... Should be minimal. Jan 21, 2013 at 17:33

I need to create a really simple document template for other people to fill in and compile.

I am not sure what you after, as to why the user needs to compile. The minimal check that LaTeX does to see if a class is defined is to produce an error if \normalsize has not been redefined see source2e, ltfntcmd.dtx.

If you really want to go minimalistic go pure TeX.

 J. Smith, [email protected]

As I've tested some quite basic environments that came in my mind, there is pretty much no functionality at all. All environments and commands that are not included in plain TeX won't work. So you have no possibilities to produce tables or lists with LaTeX. If this works for your special purpose, it's fine.

As you've mentioned, there is not even an \usepackage available, one could not do very much. It's just up to you if the functionallity you get by this very reduced code is working.

Maybe you try some pretty small document classes like minimal or standalone. With your code it's just one extra line, to load it, but you earn much more functionallity

  • I thought macros like \renewcommand were part of LaTeX and not plain TeX?
    – StrongBad
    Jan 21, 2013 at 15:13
  • Daniel, you are right. But some plain TeX stuff works, if you try e.g. $\alpha$ ;-) Jan 21, 2013 at 15:18
  • 5
    @StephanLukasczyk That isn't plain TeX stuff, it is LaTeX stuff that has similar name/definition to the definition in plain. \alpha is defined in LaTeX by \DeclareMathSymbol{\alpha}{\mathord}{letters}{"0B} and in plain by \mathchardef\alpha="010B Actually with the default latex font setup these come to the same thing, but the actual sources of plain tex are not used at all in latex. Jan 21, 2013 at 16:32
  • Thank you @DavidCarlisle, I didn't realize that yet, again I've learned something. Jan 21, 2013 at 22:24

You must log in to answer this question.

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