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?
Thanks!!
Best Answer
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
: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
: