This question already has an answer here:

I've been using the same format and setup of a front page in my homework's e.t.c and I've always wanted to just create an template file. (*.cls) I think? I.e. I don't want to see all my packages in the top of my file. In the front page there are some details I need to be able to change as seen in comments in the code.

I hope you understand my question. Thanks.

% Template info starts



% This I would like to change outside the template.
\newcommand{\student}{My name here}
\newcommand{\school}{My school's name here}
\newcommand{\course}{My course name}
\newcommand{\assignment}{Assignment 4}
\newcommand{\instructor}{My instructor's name}


        \textsc{\LARGE \school}\\[1cm]
        \textsc{\Large \course}\\[1.5cm]

        % Title
        \HRule \\[0.4cm]
        { \huge \bfseries \assignment \\[0.4cm] }
        \HRule \\[1.5cm]

        % Author and supervisor
            \begin{flushleft} \large
            \begin{flushright} \large
                \emph{Instructor:} \\


        % Bottom of the page
        {\large \today}


% % % % % % % % % % %  Template Info ends.

\section{Section 1}

\section{Appendix A}


marked as duplicate by Johannes_B, Gonzalo Medina, user13907, Sean Allred, egreg Jul 4 '15 at 23:11

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • In other words: We should make a .sty or .cls file from your 'template' for you ? ;-) – user31729 Mar 30 '15 at 8:08
  • 1
    Take a look at the discussion here: tex.stackexchange.com/questions/528/style-class-tutorials – roffe Mar 30 '15 at 8:08
  • 1
    You can simply put that stuff in a file template.tex and then in your documents add the line \input{template} – karlkoeller Mar 30 '15 at 8:08
  • The front/titlepage can be wrapped in to a configurable macro of course and kept in the template too, using a keyvalue interface, for example – user31729 Mar 30 '15 at 8:11