quotchap.sty 6.0 KB

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