Suppose you have a title page layout that you like and want to use it for many different projects.

Thus the only change you will make to it will be the project name, subtitle, date, author, ... etc

How would I create a function that generates a title page layout from some variables and then inputs it into my project file?



1 Answer 1


One possibility is to write a little package, say titlepage.sty; in this package you can define some commands to provide the information that you will use for the titlepage and define a command to effectively produce the titlepage.

A little example: since standard LaTeX provides \author, \title, and \date, in the folowing example I only defined \subtitle and \institute in a way completley analogous to the definition of \author.

Once all the preparations have been done, you define your command to produce the titlepage, using the desired formatting for the elements that will be used.

Here's a very simple version of mytitlepage.sty:


\def\@subtitle{\@latex@warning@no@line{No \noexpand\subtitle given}}
\def\@institute{\@latex@warning@no@line{No \noexpand\institute given}}



You can save this file in your local tree and then all you have to do is to load the package in the preamble of your document, use the commands to provide the fields and invoke \mytitlepage:


\title{The Title}
\subtitle{The Subtitle}
\author{The Author}
\institute{The Institute}
\date{The date}



  • That's exactly what i wanted. Thank you so much.
    – Fawkes5
    Sep 6, 2012 at 22:49

You must log in to answer this question.

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