A normal TeX file looks something like this (MWE):
\documentclass{article}
\begin{document}
Contents
\end{document}
In this case, one must have two files in order for the document to be compiled : the document itself and the documentclass file (here, article.cls).
Is it possible to include (in some way or another) the information of the documentclass (article.cls) file inside the .tex file in order to have only one file compilable by itself ?
So far, I have tried copy-pasting the contents of the documentclass in lieu of \documentclass{article}
, but I got the error
! LaTeX Error: Command \@ already defined.
Or name \end... illegal, see p.192 of the manual.
when compiling.
Someone else has asked a somewhat similar question here but it consisted of not having any documentclass information at all, instead of having it stored inside the same file as the TeX document.
Thanks in advance if anyone has a solution or a workaround.
\makeatletter
but the simplest way is to put the class file as:\begin{filecontents}{temp.cls}...\end{filecontents} \documentclass{temp}