titlepic.sty 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. % titlepic.sty is a LaTeX package to show a picture on the cover produced by \maketitle.
  2. % By Thomas ten Cate <[email protected]>. Free software, no warranty of any kind.
  3. %
  4. % Version history:
  5. % 1.1: now more self-contained, comes with a PDF manual
  6. % 1.0: first release
  7. %
  8. % -----------------------------------------------------------------------------
  9. % No idea whether it works on older LaTeXes.
  10. \NeedsTeXFormat{LaTeX2e}
  11. % Package identification and version number.
  12. \ProvidesPackage{titlepic}[2009/08/03 1.1 Package to display a picture on the title page]
  13. % Declare the options.
  14. \DeclareOption{tt}{\gdef\@tptopspace{}\gdef\@tpsepspace{\vskip 3em}}
  15. \DeclareOption{tc}{\gdef\@tptopspace{}\gdef\@tpsepspace{\vfil}}
  16. \DeclareOption{cc}{\gdef\@tptopspace{\null\vfil}\gdef\@tpsepspace{\vskip 3em}}
  17. \ExecuteOptions{cc}
  18. \ProcessOptions
  19. % Define the sole command introduced by this package.
  20. % Very similar to the definition of \title, etc.
  21. \def\titlepic#1{\gdef\@titlepic{#1}}
  22. \def\@titlepic{\@empty} % default: no picture
  23. % If a title page was requested from the document class (article/report/book),
  24. % override \maketitle to show our picture.
  25. \if@titlepage
  26. \renewcommand\maketitle{
  27. \begin{titlepage}%
  28. \let\footnotesize\small
  29. \let\footnoterule\relax
  30. \let \footnote \thanks
  31. \@tptopspace%
  32. \begin{center}%
  33. {\LARGE \@title \par}%
  34. \vskip 3em%
  35. {\large
  36. \lineskip .75em%
  37. \begin{tabular}[t]{c}%
  38. \@author
  39. \end{tabular}\par%
  40. }%
  41. \vskip 1.5em%
  42. {\large \@date \par}% % Set date in \large size.
  43. \end{center}\par
  44. \@tpsepspace%
  45. {\centering\@titlepic\par}
  46. \vfil
  47. \@thanks
  48. \end{titlepage}%
  49. \setcounter{footnote}{0}%
  50. \global\let\thanks\relax
  51. \global\let\maketitle\relax
  52. \global\let\@thanks\@empty
  53. \global\let\@author\@empty
  54. \global\let\@date\@empty
  55. \global\let\@title\@empty
  56. \global\let\@titlepic\@empty
  57. \global\let\title\relax
  58. \global\let\author\relax
  59. \global\let\date\relax
  60. \global\let\and\relax
  61. \global\let\titlepic\relax
  62. }
  63. \fi