summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/quotchap/quotchap.sty
blob: fa74d805f11de19c8e21c4a2960929832b3e6b1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
%%
%% This is file `quotchap.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% quotchap.dtx 
%% 
%% This file is part of the QUOTCHAP package, a package a package for
%% creating decorative chapter headings with quotations, a postscript
%% output device is needed.
%% Copyright (C) 1998 - 2010 by Karsten Tinnefeld.
%% Copyright (C) 2011 - 2012 by Jan Klever.
%% 
%% This file is NOT part of the LaTeX2e system, but intended for use with
%% it.
%% 
%% This file is free software; you can redistribute it and/or modify it
%% under the terms of the GNU Library General Public License as published
%% by the Free Software Foundation; either version 2 of the License, or
%% (at your option) any later version.
%% 
%% This document is distributed in the hope that it will be useful, but
%% WITHOUT ANY WARRANTY; without even the implied warranty of
%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
%% General Public License for more details.
%% 
%% You should have received a copy of the GNU General Public License
%% somehow; if not, write to the Free Software Foundation, Inc., 675 Mass
%% Ave, Cambridge, MA 02139, USA.
%% 
%% Error Reports in case of UNCHANGED versions to
%% 
%%              Jan Klever
%%              Kleiststr. 2
%%              D-22089 Hamburg
%%              Germany
%%       Email: jasa.klever@gmx.de
%% 
%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}[1996/12/01]
\ProvidesPackage{quotchap}
  [2012/10/20 v1.1 Decorative Chapter Headings with Quotes]
\newif\if@usecolor\@usecolortrue
\DeclareOption{grey}{\@usecolortrue}
\DeclareOption{nogrey}{\@usecolorfalse}
\newcommand*{\@newfontcmd}{\@ifundefined{@defaultcnfont}{\newcommand*}{%
    \PackageWarning{quotchap}{%
      You have tried to specify more than one font to be\MessageBreak
      used for the chapter numbers. I ignore the font\MessageBreak
      `\CurrentOption'}
    \providecommand*}}
\DeclareOption{avantgarde}{\@newfontcmd{\@defaultcnfont}{pag}}
\DeclareOption{beramono}{\@newfontcmd{\@defaultcnfont}{fvm}}
\DeclareOption{berasans}{\@newfontcmd{\@defaultcnfont}{fvs}}
\DeclareOption{beraserif}{\@newfontcmd{\@defaultcnfont}{fve}}
\DeclareOption{biolinum}{\@newfontcmd{\@defaultcnfont}{LinuxBiolinumO-LF}}
\DeclareOption{bookman}{\@newfontcmd{\@defaultcnfont}{pbk}}
\DeclareOption{charter}{\@newfontcmd{\@defaultcnfont}{bch}}
\DeclareOption{courier}{\@newfontcmd{\@defaultcnfont}{pcr}}
\DeclareOption{helvetica}{\@newfontcmd{\@defaultcnfont}{phv}}
\DeclareOption{kpfonts}{\@newfontcmd{\@defaultcnfont}{jkp}}
\DeclareOption{libertine}{\@newfontcmd{\@defaultcnfont}{LinuxLibertineO-LF}}
\DeclareOption{lmodern}{\@newfontcmd{\@defaultcnfont}{lmr}}
\DeclareOption{newcentury}{\@newfontcmd{\@defaultcnfont}{pnc}}
\DeclareOption{palatino}{\@newfontcmd{\@defaultcnfont}{ppl}}
\DeclareOption{times}{\@newfontcmd{\@defaultcnfont}{ptm}}
\DeclareOption{utopia}{\@newfontcmd{\@defaultcnfont}{put}}
\ProcessOptions\relax
\providecommand*{\@defaultcnfont}{pbk}
\if@usecolor
  \IfFileExists{color.sty}{%
    \RequirePackage{color}
    \definecolor{chaptergrey}{rgb}{0.6,0.6,0.6}}{%
    \PackageError{quotchap}{%
      The color package is apparently unavailable.\MessageBreak
      Turn off the `grey' option and come back again}{%
      Since you did not say `nogrey', quotchap defined chapter
      numbers to appear\MessageBreak grey. You do not need a color
      printer, since most printing devices can cope\MessageBreak with
      grey scales, but you need the color package coming with the
      graphics\MessageBreak bundle available from CTAN.}}
\else
  \providecommand*{\color}[1]{}
\fi
\AtEndOfPackage{%
  \newcommand*{\chapnumfont}{%
    \usefont{T1}{\@defaultcnfont}{b}{n}\fontsize{100}{130}\selectfont%
    \color{chaptergrey}}
  \let\size@chapter\huge
  \providecommand*{\chapterheadstartvskip}{\vspace*{2.3\baselineskip}}
  \providecommand*{\chapterheadendvskip}{\vspace{1.7\baselineskip}}
  \providecommand*{\sectfont}{\relax}
  \@ifundefined{@mainmattertrue}{\newif\if@mainmatter\@mainmattertrue}{}}
\newenvironment{savequote}[1][10cm]{%
  \begin{lrbox}{\@quotebox}
    \begin{minipage}[t]{#1}\footnotesize\slshape
      \ignorespaces}{%
      \unskip\end{minipage}\end{lrbox}
  \global\setbox\@quotebox\copy\@quotebox
  \global\let\@printcites\@iprintcites
  \ignorespacesafterend}
\newcommand{\qauthor}[1]{%
  \par\smallskip
  {\raggedleft\upshape #1\qquad\hbox{}\par}\bigskip}
\newcommand{\qsetcnfont}[1]{%
    \renewcommand*{\@defaultcnfont}{#1}}
\newsavebox{\@quotebox}
\let\@printcites\relax
\renewcommand\chapter{%
  \if@openright\cleardoublepage\else\clearpage\fi
  \thispagestyle{plain}%
  \global\@topnum\z@
  \@printcites
  \@afterindentfalse
  \secdef\@chapter\@schapter}
\renewcommand{\@makechapterhead}[1]{\chapterheadstartvskip%
  {\size@chapter{\sectfont\raggedleft
      {\chapnumfont
        \ifnum \c@secnumdepth >\m@ne%
        \if@mainmatter\thechapter%
        \fi\fi
        \par\nobreak}%
      {\raggedleft\advance\leftmargin10em\interlinepenalty\@M #1\par}}
    \nobreak\chapterheadendvskip}}
\renewcommand{\@makeschapterhead}[1]{%
  {\let\c@secnumdepth\m@ne\@makechapterhead{#1}}}
\newcommand*{\@iprintcites}{%
  \vbox to\z@{\copy\@quotebox\vss}
  \global\let\@printcites\relax}
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
\endinput
%%
%% End of file `quotchap.sty'.