summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ltxmisc/anonchap.sty
blob: 8b2101e818112b83918a5e48a8e653ec2bb3554b (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
% anonchap.sty
%
% Provides commands to make \chapter typeset like \section
% DO NOT USE WITH THE TOCBIBIND PACKAGE (which also supplies these commands)
%
% author: Peter Wilson (CUA)
%         (now at peter.r.wilson@boeing.com)
% Copyright 1996
% Released under the LaTeX Project Public License
%
%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{anonchap}[2000/04/01 v1.1 typeset chapter like section]

\newcommand{\simplechapter}[1][\@empty]{%
  \let\@tbiold@makechapterhead\@makechapterhead
  \renewcommand{\@makechapterhead}[1]{%
    \vspace*{50\p@}%
    {\parindent \z@ \raggedright
     \normalfont
     \interlinepenalty\@M
     \Huge\bfseries #1\space\thechapter\simplechapterdelim\space
       ##1\par\nobreak
     \vskip 40\p@
  }}
}

\newcommand{\restorechapter}{%
  \let\@makechapterhead\@tbiold@makechapterhead
}

\newcommand{\simplechapterdelim}{}

\endinput

% Usage:
% \simplechapter[<name>] and \simplechapterdelim{<delim>} act together
% so that any subsequent \chapter commands, for example \chapter{First}
% ... \chapter{Second}...,
% will be typeset in the style of a \section (or numbered \chapter*) as:
% <name> 1<delim> First
% ...
% <name> 2<delim> Second
%
% A subsequent \restorechapter command will reset the \chapter typesetting
% back to its default style.
%
% Note that the argument to \simplechapter is optional, and that by default
% \simplechapterdelim is defined as \newcommand{\simplechapterdelim}{}.
%
% Extending the above example:
% \simplechapter
% \chapter{First}
% ...
% \renewcommand{\simplechapterdelim}{:}
% \chapter{Second}
% ...
% \restorechapter   % restore before issuing a modified \simplechapter
% \simplechapter[Chap]
% \chapter{Third}
% ...
% \restorechapter
% \chapter{Fourth}
% ...
% Will be typeset as:
% 1 First
% ...
% 2: Second
% ...
% Chap 3: Third
% ...
% Chapter 4
% Fourth
% ...
%