LaTeX/Title Creation

From Wikibooks, open books for an open world
Jump to: navigation, search
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 classes. 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 Titles[edit]

Many document classes will form a title or 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, 2014}
\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 omitted in the source file.

To form a title, use

\maketitle

This should go after the preceding commands. For most document classes, this will form a separate page, while the article document class will place the title on the top of the first page. If you want to have a separate title page for articles as well, use the documentclass option titlepage.


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 generated by \maketitle. Referring to the documentation will lead to trusted information.

Custom Title Pages[edit]

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.

The title page of a book or a report is the first a reader will see. Keep that in mind when preparing your title page.

Create the title for a report or book[edit]

A title page for reports to get a university degree is quite static, it doesn't really change over time. You can prepare the titlepage in its own little document and prepare a one page pdf that you later include into your real document. This is really useful, if the title page is required to have completelyy different margins as the rest of the document. It also saves compile time, though it is not much.

You need to know very basic LaTeX layout commands in order to get your own title page perfect. Usually a custom titlepage does not contain any semantic markup, everything is hand crafted. Here are some of the most often needed things:

Alignment 

if you want to center some text just use \centering. If you want to align it differently you can use the environment \raggedleft for right-alignment and \raggedright for left-alignment.

Images 

the command for including images (a logo for example) is the following : \includegraphics[width=0.15\textwidth]{./logo}. There is no \begin{figure} as you would usually use since you don't want it to be floating, you just want it exactly where want it to be. 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 braces, {like this}, and you can use the following commands (in order of size): \Huge, \huge, \LARGE, \Large, \large, \normalsize, \small, \footnotesize, \tiny. So for example:

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

Remember, if you have a block of text in a different size, even if it is a bit of text on a single line, end it with \par.

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 example[edit]

All these tips might have made you confused. Here is a practical and compilable example. The picture in use comes with package mwe and should be available with every complete LaTeX installation. You can start testing right away.

\documentclass[12pt,a4paper]{report}
\usepackage{graphicx}
\begin{document}
\begin{titlepage}
	\centering
	\includegraphics[width=0.15\textwidth]{example-image-1x1}\par\vspace{1cm}
	{\scshape\LARGE Columbidae University \par}
	\vspace{1cm}
	{\scshape\Large Final year project\par}
	\vspace{1.5cm}
	{\huge\bfseries Pigeons love doves\par}
	\vspace{2cm}
	{\Large\itshape John Birdwatch\par}
	\vfill
	supervised by\par
	Dr.~Mark \textsc{Brown}

	\vfill

% Bottom of the page
	{\large \today\par}
\end{titlepage}
\end{document}


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 fonts it gets even more complicated, 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.

Integrating the title page[edit]

Assuming you have done the title page of your report in an extra document, let's pretend it is called reportTitlepage2015.pdf, you can include it quite simply. Here is a short document setup.

\documentclass{report}
\usepackage{pdfpages}
\begin{document}
\includepdf{reportTitlepage2015}
\tableofcontents
\chapter{Introducing birds}
\end{document}

A title to be re-used multiple times[edit]

Some universities, departments and companies have strict rules how a title page of a report should look like. To ensure the very same output for all reports, a redefiniton of the \maketitle command is recommended.

This is best done by an experienced LaTeX user. A simple example follows, as usual there is no real limit with respect to complexity.


As a starting point, a LaTeX package called columbidaeTitle.sty is generated that defines the complete title matter. It will later be hidden from the end user. Ideally, the person creating the package should maintain it for a long time, create an accompanying documentation and ensure user support.

% Copyright note: This package defines how titles should
% be typeset at the columbidae University
% Please check for updates
\ProvidesPackage{columbidaeTitle}[2015/08/10 v.01 an
example package^^J for wikibooks]
\RequirePackage{graphicx}
\newcommand*{\project}[1]{\gdef\@project{#1}%
}
\newcommand*{\@project}{Final Year Project}
\newcommand*{\supervisor}[1]{\gdef\@supervisor{#1}%
}
\newcommand*{\@supervisor}{\texttt{\string\supervisor} currently
not set. Please fix this.}
\renewcommand*{\maketitle}{%
\begin{titlepage}
{\raggedleft%
	\includegraphics[width=3cm]{example-image-16x9}\par
}\vspace{1cm}
	\centering
{\scshape\LARGE Columbidae University \par}
\vspace{1cm}
{\scshape\Large\@project\unskip\strut\par}
\vspace{1.5cm}
{\huge\bfseries\@title\unskip\strut\par}
\vspace{2cm}
{\Large\itshape\@author\unskip\strut\par}
\vfill
supervised by\par
\@supervisor\unskip\strut\par

\vfill

{\large \@date\par}
\end{titlepage}
}
\endinput


This package can be loaded within a usual document. The user can set the variables for title and the like. Which commands are actually available, and which might be omissible should be written in a documentation that is bundled with the package.

Look around what happens if you leave one or the other command out.


\documentclass{book}
\usepackage{columbidaeTitle}
%\supervisor{Dr. James Miller}
\project{Bachelor Thesis}
\author{A LaTeX enthusiast}
\title{Why i want to be a duck}
\begin{document}
\maketitle
\tableofcontents
\chapter{Ducks are awesome}
\end{document}
}

Packages for custom titles[edit]

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 References[edit]


Previous: Tables Index Next: Page Layout