| 1 |
% Manual, as well as usage example, for the titlepic.sty package. |
| 2 |
% Run this through latex to see the output. |
| 3 |
|
| 4 |
\documentclass[titlepage]{article} |
| 5 |
|
| 6 |
\usepackage[cc]{titlepic} % Include the titlepic package. |
| 7 |
|
| 8 |
% Creates a placeholder for the picture (no real picture is included in the package to keep it small). |
| 9 |
% The syntax is \placeholder{width}{height}. |
| 10 |
\newcommand\placeholder[2]{% |
| 11 |
\noindent% |
| 12 |
{\setlength{\fboxsep}{0pt}% |
| 13 |
\framebox[#1]{% |
| 14 |
\parbox{0pt}{\rule{0pt}{#2}}% |
| 15 |
\parbox{#1}{\centering The picture goes here.}% |
| 16 |
}% |
| 17 |
}% |
| 18 |
} |
| 19 |
|
| 20 |
\title{\LaTeX{} \texttt{titlepic} Manual} |
| 21 |
\author{ |
| 22 |
Thomas ten Cate\thanks{\texttt{<[email protected]>}} \\ |
| 23 |
with contributions from \\ |
| 24 |
Denis Bitouz\'e} |
| 25 |
\date{March 14, 2017} |
| 26 |
\titlepic{\placeholder{\textwidth}{0.75\textwidth}} % This is the magic command! |
| 27 |
|
| 28 |
\begin{document} |
| 29 |
|
| 30 |
\maketitle |
| 31 |
|
| 32 |
\section{Introduction} |
| 33 |
|
| 34 |
In \LaTeX, there is by default no way to put a picture on the title page or cover page that is produced by \verb$\maketitle$. Surprisingly, no package seemed to exist for this either, which is why I put together this very simple package named \verb$titlepic$. |
| 35 |
|
| 36 |
\textbf{Note:} \verb$titlepic$ only works with the default document classes \verb$article$, \verb$report$ and \verb$book$. However, it works both with the \verb$titlepage$ and \verb$notitlepage$ document class options. |
| 37 |
|
| 38 |
\section{Installation} |
| 39 |
|
| 40 |
There are several ways to install the package: |
| 41 |
\begin{itemize} |
| 42 |
\item Simply drop \verb$titlepic.sty$ in the same directory as your \verb$.tex$ source document. This is the easiest option for casual use. |
| 43 |
\item Put \verb$titlepic.sty$ somewhere in your \verb$texmf$ tree and rehash. The details depend on your \TeX{} distribution. This gives you a system-wide installation. |
| 44 |
\item Install it from \TeX{} Live or MiK\TeX. |
| 45 |
\end{itemize} |
| 46 |
|
| 47 |
\section{Usage} |
| 48 |
|
| 49 |
Include the package as normal, with: |
| 50 |
|
| 51 |
\begin{quote} |
| 52 |
\verb$\usepackage{titlepic}$ |
| 53 |
\end{quote} |
| 54 |
|
| 55 |
\noindent If you want to be able to include a picture, then you also need |
| 56 |
|
| 57 |
\begin{quote} |
| 58 |
\verb$\usepackage{graphicx}$ |
| 59 |
\end{quote} |
| 60 |
|
| 61 |
Then, along with the usual \verb$\title$, \verb$\author$ and \verb$\date$, put a command like the following: |
| 62 |
|
| 63 |
\begin{quote} |
| 64 |
\verb$\titlepic{\includegraphics[width=\textwidth]{cover.png}}$ |
| 65 |
\end{quote} |
| 66 |
|
| 67 |
The argument to \verb$\titlepic$ will usually be an \verb$\includegraphics$ command, which produces a picture. You can change the size using the optional argument to \verb$\includegraphics$, for example, \verb$width=0.7\textwidth$. This will make the picture be 70\% as wide as the text, and scales the height accordingly. |
| 68 |
|
| 69 |
In fact, the argument to \verb$\titlepic$ can actually be pretty much anything. The output produced by this argument will be typeset centred on the title page when you invoke \verb$\maketitle$. |
| 70 |
|
| 71 |
\section{Package options} |
| 72 |
|
| 73 |
There are three optional arguments that control the vertical layout of the title page: |
| 74 |
|
| 75 |
\begin{description} |
| 76 |
\item[\tt{tt}] |
| 77 |
Put both the title (and author, and date) and the picture at the top of the page, separated by a fixed amount of space. |
| 78 |
\item[\tt{tc}] |
| 79 |
Put the title at the top of the page as with tt, but centre the picture vertically on the page. |
| 80 |
\item[\tt{cc}] |
| 81 |
Separate the title and the picture by a fixed amount of space, and centre both together vertically on the page. |
| 82 |
\end{description} |
| 83 |
|
| 84 |
\section{Example} |
| 85 |
|
| 86 |
Here is a full example of what your document could look like. |
| 87 |
|
| 88 |
\begin{verbatim} |
| 89 |
% Pass titlepage to the article class |
| 90 |
\documentclass[titlepage]{article} |
| 91 |
|
| 92 |
% Centre the picture and the title vertically with cc (only works with titlepage mode) |
| 93 |
\usepackage[cc]{titlepic} |
| 94 |
|
| 95 |
% For \includegraphics |
| 96 |
\usepackage{graphicx} |
| 97 |
|
| 98 |
\title{Example} |
| 99 |
\author{John Doe} |
| 100 |
\date{\today} |
| 101 |
|
| 102 |
% Now, put a picture on the title page! |
| 103 |
\titlepic{\includegraphics[width=\textwidth]{picture.png}} |
| 104 |
|
| 105 |
\begin{document} |
| 106 |
|
| 107 |
\maketitle |
| 108 |
|
| 109 |
... |
| 110 |
|
| 111 |
\end{document} |
| 112 |
\end{verbatim} |
| 113 |
|
| 114 |
\section{Contributing} |
| 115 |
|
| 116 |
Contributions are welcome! Send a pull request on GitHub here:\\ |
| 117 |
\verb$https://github.com/ttencate/titlepic$ |
| 118 |
|
| 119 |
\end{document} |