summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/titlepic/titlepic.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/titlepic/titlepic.sty
Initial commit
Diffstat (limited to 'macros/latex/contrib/titlepic/titlepic.sty')
-rw-r--r--macros/latex/contrib/titlepic/titlepic.sty90
1 files changed, 90 insertions, 0 deletions
diff --git a/macros/latex/contrib/titlepic/titlepic.sty b/macros/latex/contrib/titlepic/titlepic.sty
new file mode 100644
index 0000000000..2aca230a8d
--- /dev/null
+++ b/macros/latex/contrib/titlepic/titlepic.sty
@@ -0,0 +1,90 @@
+% titlepic.sty is a LaTeX package to show a picture on the cover produced by \maketitle.
+% By Thomas ten Cate <ttencate@gmail.com>. Free software, no warranty of any kind.
+%
+% Version history:
+% 1.2: works without titlepage as well
+% 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}[2017/03/14 1.2 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
+ }
+\else
+ \def\@maketitle{%
+ \newpage
+ \null
+ \vskip 2em%
+ \begin{center}%
+ \let \footnote \thanks
+ {\LARGE \@title \par}%
+ \vskip 1.5em%
+ {\large
+ \lineskip .5em%
+ \begin{tabular}[t]{c}%
+ \@author
+ \end{tabular}\par}%
+ \vskip 1em%
+ {\large \@date}%
+ \end{center}%
+ \vskip .5em%
+ {\centering\@titlepic\par}
+ \par
+ \vskip 1.5em}
+\fi