From 61d228804ad353fb8002d4f42e1b72727640ba8e Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 18 Aug 2009 17:27:43 +0000 Subject: new latex package titlepic (3aug09) git-svn-id: svn://tug.org/texlive/trunk@14750 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/titlepic/README | 13 +++ .../doc/latex/titlepic/titlepic-manual.pdf | Bin 0 -> 60128 bytes .../doc/latex/titlepic/titlepic-manual.tex | 112 +++++++++++++++++++++ Master/texmf-dist/tex/latex/titlepic/titlepic.sty | 68 +++++++++++++ Master/tlpkg/bin/tlpkg-ctan-check | 3 +- Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc | 1 + Master/tlpkg/tlpsrc/titlepic.tlpsrc | 0 7 files changed, 196 insertions(+), 1 deletion(-) create mode 100644 Master/texmf-dist/doc/latex/titlepic/README create mode 100644 Master/texmf-dist/doc/latex/titlepic/titlepic-manual.pdf create mode 100644 Master/texmf-dist/doc/latex/titlepic/titlepic-manual.tex create mode 100644 Master/texmf-dist/tex/latex/titlepic/titlepic.sty create mode 100644 Master/tlpkg/tlpsrc/titlepic.tlpsrc diff --git a/Master/texmf-dist/doc/latex/titlepic/README b/Master/texmf-dist/doc/latex/titlepic/README new file mode 100644 index 00000000000..dbe4c98b89d --- /dev/null +++ b/Master/texmf-dist/doc/latex/titlepic/README @@ -0,0 +1,13 @@ +The titlepic package allows you to place a picture on the +title page (cover page) of a LaTeX document. + +Example of usage: +\usepackage[cc]{titlepic} +\usepackage{graphicx} +\titlepic{\includegraphics[width=\textwidth]{picture.png}} + +Note: the package currently only works with the document +classes article, report and book. + +Author: Thomas ten Cate +License: Public Domain \ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/titlepic/titlepic-manual.pdf b/Master/texmf-dist/doc/latex/titlepic/titlepic-manual.pdf new file mode 100644 index 00000000000..63a02124aba Binary files /dev/null and b/Master/texmf-dist/doc/latex/titlepic/titlepic-manual.pdf differ diff --git a/Master/texmf-dist/doc/latex/titlepic/titlepic-manual.tex b/Master/texmf-dist/doc/latex/titlepic/titlepic-manual.tex new file mode 100644 index 00000000000..dec9ff4100e --- /dev/null +++ b/Master/texmf-dist/doc/latex/titlepic/titlepic-manual.tex @@ -0,0 +1,112 @@ +% Manual, as well as usage example, for the titlepic.sty package. +% Run this through latex to see the output. + +\documentclass[titlepage]{article} + +\usepackage[cc]{titlepic} % Include the titlepic package. + +% Creates a placeholder for the picture (no real picture is included in the package to keep it small). +% The syntax is \placeholder{width}{height}. +\newcommand\placeholder[2]{% + \noindent% + {\setlength{\fboxsep}{0pt}% + \framebox[#1]{% + \parbox{0pt}{\rule{0pt}{#2}}% + \parbox{#1}{\centering The picture goes here.}% + }% + }% +} + +\title{\LaTeX{} \texttt{titlepic} Manual} +\author{Thomas ten Cate\thanks{\texttt{}}} +\date{August 5, 2008} +\titlepic{\placeholder{\textwidth}{0.75\textwidth}} % This is the magic command! + +\begin{document} + +\maketitle + +\section{Introduction} + +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$. + +\textbf{Note:} \verb$titlepic$ only works with the default document classes \verb$article$, \verb$report$ and \verb$book$. + +\section{Installation} + +There are two ways to install the package: +\begin{itemize} + \item Simply drop \verb$titlepic.sty$ in the same directory as your \verb$.tex$ source document. This is the easiest option for casual use. + \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. +\end{itemize} + +\section{Usage} + +Include the package as normal, with: + +\begin{quote} + \verb$\usepackage{titlepic}$ +\end{quote} + +\noindent If you want to be able to include a picture, then you also need + +\begin{quote} + \verb$\usepackage{graphicx}$ +\end{quote} + +\textbf{Note:} when you use the \verb$article$ document class, be sure to pass it the \verb$titlepage$ option (\verb$\documentclass[titlepage]{article}$), because articles do not have a title page by default. + +Then, along with the usual \verb$\title$, \verb$\author$ and \verb$\date$, put a command like the following: + +\begin{quote} + \verb$\titlepic{\includegraphics[width=\textwidth]{cover.png}}$ +\end{quote} + +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. + +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$. + +\section{Package options} + +There are three optional arguments that control the vertical layout of the title page: + +\begin{description} +\item[\tt{tt}] + Put both the title (and author, and date) and the picture at the top of the page, separated by a fixed amount of space. +\item[\tt{tc}] + Put the title at the top of the page as with tt, but centre the picture vertically on the page. +\item[\tt{cc}] + Separate the title and the picture by a fixed amount of space, and centre both together vertically on the page. +\end{description} + +\section{Example} + +Here is a full example of what your document could look like. + +\begin{verbatim} +% Be sure to pass titlepage to the article class +\documentclass[titlepage]{article} + +% Centre the picture and the title vertically with cc +\usepackage[cc]{titlepic} + +% For \includegraphics +\usepackage{graphicx} + +\title{Example} +\author{John Doe} +\date{\today} + +% Now, put a picture on the title page! +\titlepic{\includegraphics[width=\textwidth]{picture.png}} + +\begin{document} + +\maketitle + +... + +\end{document} +\end{verbatim} + +\end{document} diff --git a/Master/texmf-dist/tex/latex/titlepic/titlepic.sty b/Master/texmf-dist/tex/latex/titlepic/titlepic.sty new file mode 100644 index 00000000000..974885c8998 --- /dev/null +++ b/Master/texmf-dist/tex/latex/titlepic/titlepic.sty @@ -0,0 +1,68 @@ +% titlepic.sty is a LaTeX package to show a picture on the cover produced by \maketitle. +% By Thomas ten Cate . Free software, no warranty of any kind. +% +% Version history: +% 1.1: now more self-contained, comes with a PDF manual +% 1.0: first release +% +% ----------------------------------------------------------------------------- + +% No idea whether it works on older LaTeXes. +\NeedsTeXFormat{LaTeX2e} + +% Package identification and version number. +\ProvidesPackage{titlepic}[2009/08/03 1.1 Package to display a picture on the title page] + +% Declare the options. +\DeclareOption{tt}{\gdef\@tptopspace{}\gdef\@tpsepspace{\vskip 3em}} +\DeclareOption{tc}{\gdef\@tptopspace{}\gdef\@tpsepspace{\vfil}} +\DeclareOption{cc}{\gdef\@tptopspace{\null\vfil}\gdef\@tpsepspace{\vskip 3em}} +\ExecuteOptions{cc} +\ProcessOptions + +% Define the sole command introduced by this package. +% Very similar to the definition of \title, etc. +\def\titlepic#1{\gdef\@titlepic{#1}} +\def\@titlepic{\@empty} % default: no picture + +% If a title page was requested from the document class (article/report/book), +% override \maketitle to show our picture. +\if@titlepage +\renewcommand\maketitle{ + \begin{titlepage}% + \let\footnotesize\small + \let\footnoterule\relax + \let \footnote \thanks + \@tptopspace% + \begin{center}% + {\LARGE \@title \par}% + \vskip 3em% + {\large + \lineskip .75em% + \begin{tabular}[t]{c}% + \@author + \end{tabular}\par% + }% + \vskip 1.5em% + {\large \@date \par}% % Set date in \large size. + \end{center}\par + \@tpsepspace% + {\centering\@titlepic\par} + \vfil + \@thanks + \end{titlepage}% + \setcounter{footnote}{0}% + \global\let\thanks\relax + \global\let\maketitle\relax + \global\let\@thanks\@empty + \global\let\@author\@empty + \global\let\@date\@empty + \global\let\@title\@empty + \global\let\@titlepic\@empty + \global\let\title\relax + \global\let\author\relax + \global\let\date\relax + \global\let\and\relax + \global\let\titlepic\relax +} +\fi diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index 433f8e9876b..48a0e47015e 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -243,7 +243,8 @@ my @WorkingTLP = qw( textcase textfit textopo textpath textpos theoremref thesis-titlepage-fhac thinsp thmbox thmtools thumb thumbpdf thuthesis ticket tikz-inet - tikz-timing timetable tipa titlefoot titlepages titlesec titling + tikz-timing timetable tipa + titlefoot titlepages titlepic titlesec titling tkz-doc tkz-linknodes tkz-tab tocbibind tocloft todo todonotes tokenizer toolbox tools toptesi totcount totpages tracking diff --git a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc index 6a06c9c9106..69baec9e71b 100644 --- a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc @@ -552,6 +552,7 @@ depend ticket depend timesht depend timing depend titlefoot +depend titlepic depend titlesec depend titling depend tocbibind diff --git a/Master/tlpkg/tlpsrc/titlepic.tlpsrc b/Master/tlpkg/tlpsrc/titlepic.tlpsrc new file mode 100644 index 00000000000..e69de29bb2d -- cgit v1.2.3