Last modified on 27 October 2013, at 02:01

LaTeX/Title Creation

LaTeX logo.svg

LaTeX

Getting Started
  1. Introduction
  2. Installation
  3. Installing Extra Packages
  4. Basics

Common Elements

  1. Document Structure
  2. Text Formatting
  3. Paragraph Formatting
  4. Colors
  5. Fonts
  6. List Structures
  7. Special Characters
  8. Internationalization
  9. Rotations
  10. Tables
  11. Title creation
  12. Page Layout
  13. Importing Graphics
  14. Floats, Figures and Captions
  15. Footnotes and Margin Notes
  16. Hyperlinks
  17. Labels and Cross-referencing

Mechanics

  1. Errors and Warnings
  2. Lengths
  3. Counters
  4. Boxes
  5. Rules and Struts

Technical Texts

  1. Mathematics
  2. Advanced Mathematics
  3. Theorems
  4. Chemical Graphics
  5. Algorithms
  6. Source Code Listings
  7. Linguistics

Special Pages

  1. Indexing
  2. Glossary
  3. Bibliography Management
  4. More Bibliographies

Special Documents

  1. Letters
  2. Presentations
  3. Teacher's Corner
  4. Curriculum Vitae

Creating Graphics

  1. Introducing Procedural Graphics
  2. MetaPost
  3. Picture
  4. PGF/TikZ
  5. PSTricks
  6. Xy-pic
  7. Creating 3D graphics

Programming

  1. Macros
  2. Plain TeX
  3. Creating Packages
  4. Themes

Miscellaneous

  1. Modular Documents
  2. Collaborative Writing of LaTeX Documents
  3. Export To Other Formats

Help and Recommendations

  1. FAQ
  2. Tips and Tricks

Appendices

  1. Authors
  2. Links
  3. Package Reference
  4. Sample LaTeX documents
  5. Index
  6. Command Glossary

edit this boxedit the TOC

For documents such as basic articles, the output of \maketitle is often adequate, but longer documents (such as books and reports) often require more involved formatting. We will detail the process here.

There are several situations where you might want to create a title in a custom format, rather than in the format natively supported by LaTeX. While it is possible to change the output of \maketitle, it can be complicated even with minor changes to the title. In such cases it is often better to create the title from scratch, and this section will show you how to accomplish this.

Standard Title PagesEdit

Many document classes will form a title page for you. One must specify what to fill it with using these commands placed in the top matter:

\title{The Triangulation of Titling Data in
       Non-Linear Gaussian Fashion via $\rho$ Series}
\date{October 31, 475}
\author{John Doe\\ Magic Department, Richard Miles University
        \and Richard Row, \LaTeX\ Academy
}

Commonly the date is excluded from the title page by using \date{}. It defaults to \today if not in the source file.

To form a title page, use

\maketitle

This should go after the preceding commands. For most document styles, this will form a separate page, while the article document style will place the title on the top of the first page. Note that the abstract environment should precede the \maketitle command in AMS documents.

Footnotes within the title page can be specified with the \thanks command. For example, one may add

\author{John Doe\thanks{Funded by NASA Grant \#42}}

The \thanks command can also be used in the \title.

It is dependent on the document class which commands are used in the title page generated by \maketitle. For example, the amsart uses commands such as \address, \dedicatory, \email and more in the title page while other classes may only use \title.

Custom Title PagesEdit

Create the titleEdit

Normally, the benefit of using LaTeX instead of traditional word processing programs is that LaTeX frees you to concentrate on content by handling margins, justification, and other typesetting concerns. On the other hand, if you want to write your own title format, it is exactly the opposite: you have to take care of everything--this time LaTeX will do nothing to help you. It can be challenging to create your own title format since LaTeX was not designed to be graphically interactive in the adjustment of layout. The process is similar to working with raw HTML with the added step that each time you want to see how your changes look, you have to re-compile the source. While this may seem like a major inconvenience, the benefit is that once the customized title format has been written, it serves as a template for all other documents that would use the title format you have just made. In other words, once you have a layout you like, you can use it for any other documents where you would like the same layout without any additional fiddling with layout.

First step: since you'll be working only on the first page of your document and you'll have to compile very often, you don't have to compile the whole document each time, you only need to take a look at the first page. That is why we'll first create a dummy document for preparing the title and then we'll simply include it within the existing big document we are writing. Call the dummy document test_title.tex and put the following code in it:

\documentclass[pdftex,12pt,a4paper]{report}

\usepackage[pdftex]{graphicx}

\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}

\begin{document}

\input{./title.tex}
\end{document
}

It is meant to be compiled with pdflatex to create a PDF as its output. It is a very basic document, but take care that it has the same settings of the document you are writing, so the output won't change when you include the title in your document. In this case (see the first line) the font size is set to 12pt and the paper size is an A4. The package graphicx is included to insert an image in the title. Then a command is defined called \HRule; it will just insert a horizontal line whose length is equal to a line of text and whose thickness is 0.5 mm. (Note that you will need to precede the command \HRule with \noindent, otherwise it will be indented and you will get an overfull hbox warning equal to the normal indent of a paragraph's first line.) If you want you can change its settings in the definition. Finally the document starts and it simply includes the title.tex file, that must be placed in the same directory of our dummy file test_title.tex.

Now create the title.tex and write in it:

\begin{titlepage}


\end{titlepage
}

all the things you want to put in the title must be inside the titlepage environment. Now if you compile test_title.tex you will see a preview of your title in the test_title.pdf file. Here is what you need to know to write your title:

Alignment 
if you want to center some text just use \begin{center} ... \end{center}. If you want to align it differently you can use the environment flushright for right-alignment and flushleft for left-alignment.
Images 
the command for including images is the following (the example is for a small logo, but you can introduce any image of any size): \includegraphics[width=0.15\textwidth]{./logo}. There is no \begin{figure} as you usually do because you don't want it to be floating, you just want it there where you placed it. When handling it, remember that it is considered like a big box by the TeX engine.
Text size 
If you want to change the size of some text just place it within brackets, {like this}, and you can use the following commands (in order of size): \Huge, \huge, \LARGE, \Large, \large, \small, \footnotesize, \tiny. So for example:

{\large this text is slightly bigger than normal}, this one is not.

\normalsize is used to create text at the default size for the document.
New lines 
you can force the start of a new line by \\. If you want to add more vertical space, do so by adding the desired space in square brackets after the \\ command. For example, \\[1cm] will insert 1 cm of empty space before the new line (which will not be indented). Using multiple \\ commands will produce Underfull hbox messages.
Date
you can insert the date of the current day with the command \today. If you do not wish to insert any date, keep it blank e.g.\date{}
Filling the page 
the command \vfill as the last item of your content will add empty space until the page is full. If you put it within the page, you will ensure that all the following text will be placed at the bottom of the page.

A practical exampleEdit

All these tips might have made you confused. Then, here is a practical example. Get the test_title.tex described above and here is an example of a title.tex. On the right you can see the output after you compile test_title.tex in PDF:

\begin{titlepage}
\begin{center
}

% Upper part of the page. The '~' is needed because \\
% only works if a paragraph has started.
\includegraphics[width=0.15\textwidth]{./logo}~\\[1cm]

\textsc{\LARGE University of Beer}\\[1.5cm]

\textsc{\Large Final year project
}\\[0.5cm]

% Title
\HRule \\[0.4cm]
{ \huge \bfseries Lager brewing techniques \\[0.4cm] }

\HRule \\[1.5cm]

% Author and supervisor
\begin{minipage}{0.4\textwidth}
\begin{flushleft} \large
\emph{Author:}\\
John \textsc{Smith}
\end{flushleft}
\end{minipage}
\begin{minipage}{0.4\textwidth}
\begin{flushright} \large
\emph{Supervisor:} \\
Dr.~Mark \textsc{Brown}
\end{flushright}
\end{minipage
}

\vfill

% Bottom of the page
{\large \today}

\end{center}
\end{titlepage
}

Latex wikibook test title.svg

The picture is from a file called logo.png that is in the same directory of both title.tex and test_title.tex. Since I wanted to insert both the author and supervisor names properly aligned I used a trick: I created two small minipages, one on left and one on the right. Their width is a bit less than half of page width (as you can see, they are exactly 40% of the text width). Within the minipages I have used different alignments. Using \vfill I could write the date exactly at the bottom of the page.

As you can see, the code looks "dirtier" than standard LaTeX source because you have to take care of the output as well. If you start changing font's output it will get more confused, but you can do it: it's only for the title and your complicated code will be isolated from all the rest within its own file title.tex.

Integrating the title pageEdit

Assuming that your title page is now contained in a file named title.tex, it must be placed in the same directory as the main document. In order to integrate it, the input command must be used by placing \input{./title.tex} at the top of the document. Don't forget to add the commands \usepackage[pdftex]{graphicx} and \newcommand{\HRule}{\rule{\linewidth}{0.5mm}} in the preamble section as well.

For example, the top section of your document would look like:

...
\usepackage[pdftex]{graphicx}

\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}

\begin{document}

\input{./title.tex
}
\tableofcontents
...

Packages for custom titlesEdit

The titling package[1] provides control over the typesetting of the \maketitle and \thanks commands. The titlepages package presents many styles of designs for title pages. Italian users may also want to use the frontespizio package[2].

Notes and ReferencesEdit


Previous: Tables Index Next: Page Layout