summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/sfheaders/sfheaders.sty
blob: d7f06f94cd8da1e5b5e0a937f98a8ef4ef7d371d (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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
% Package: SFheaders.sty
% Sans-Serif headers; modified from {book|report|article}.cls defaults.
% Last change: MLO 1997-09-25 10:21 *****
%
% Author: Maurizio Loreti, aka MLO or (HAM) I3NOO
% Work:   University of Padova - Department of Physics
%         Via F. Marzolo, 8 - 35131 PADOVA - Italy
% EMail:  loreti@padova.infn.it
% WWW:    http://wwwcdf.pd.infn.it/~loreti/mlo.html

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{sfheaders}[1997/09/25 Sans-Serif headers]

\@ifclassloaded{article}{
% Here if \documentclass{article}
  \def\@part[#1]#2{%
      \ifnum \c@secnumdepth >\m@ne
        \refstepcounter{part}%
        \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
      \else
        \addcontentsline{toc}{part}{#1}%
      \fi
      {\parindent \z@ \raggedright
       \interlinepenalty \@M
       \normalfont
       \ifnum \c@secnumdepth >\m@ne
         \Large \sffamily \bfseries \partname~\thepart
         \par\nobreak
       \fi
       \huge \sffamily \bfseries #2%
       \markboth{}{}\par}%
      \nobreak
      \vskip 3ex
      \@afterheading}
  \def\@spart#1{%
      {\parindent \z@ \raggedright
       \interlinepenalty \@M
       \normalfont
       \huge \sffamily \bfseries #1\par}%
       \nobreak
       \vskip 3ex
       \@afterheading}}
{\@ifclassloaded{book}{
% Here if \documentclass{book}
  \def\@part[#1]#2{%
      \ifnum \c@secnumdepth >-2\relax
        \refstepcounter{part}%
        \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
      \else
        \addcontentsline{toc}{part}{#1}%
      \fi
      \markboth{}{}%
      {\centering
       \interlinepenalty \@M
       \normalfont
       \ifnum \c@secnumdepth >-2\relax
         \huge \sffamily \bfseries \partname~\thepart
         \par
         \vskip 20\p@
       \fi
       \Huge \sffamily \bfseries #2\par}%
      \@endpart}

  \def\@spart#1{%
      {\centering
       \interlinepenalty \@M
       \normalfont
       \Huge \sffamily \bfseries #1\par}%
      \@endpart}

  \def\@makechapterhead#1{%
    \vspace*{50\p@}%
    {\parindent \z@ \raggedright \normalfont
      \ifnum \c@secnumdepth >\m@ne
        \if@mainmatter
          \huge \sffamily \bfseries \@chapapp\space \thechapter
          \par\nobreak
          \vskip 20\p@
        \fi
      \fi
      \interlinepenalty\@M
      \Huge \sffamily \bfseries #1\par\nobreak
      \vskip 40\p@
    }}

  \def\@makeschapterhead#1{%
    \vspace*{50\p@}%
    {\parindent \z@ \raggedright
      \normalfont
      \interlinepenalty\@M
      \Huge \sffamily \bfseries #1\par\nobreak
      \vskip 40\p@
  }}
}{
% Here if none of the above (\documentclass{report} ?)
  \def\@part[#1]#2{%
      \ifnum \c@secnumdepth >-2\relax
        \refstepcounter{part}%
        \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
      \else
        \addcontentsline{toc}{part}{#1}%
      \fi
      \markboth{}{}%
      {\centering
       \interlinepenalty \@M
       \normalfont
       \ifnum \c@secnumdepth >-2\relax
         \huge \sffamily \bfseries \partname~\thepart
         \par
         \vskip 20\p@
       \fi
       \Huge \sffamily \bfseries #2\par}%
      \@endpart}

  \def\@spart#1{%
      {\centering
       \interlinepenalty \@M
       \normalfont
       \Huge \sffamily \bfseries #1\par}%
      \@endpart}

  \def\@makechapterhead#1{%
    \vspace*{50\p@}%
    {\parindent \z@ \raggedright \normalfont
      \ifnum \c@secnumdepth >\m@ne
          \huge \sffamily \bfseries \@chapapp\space \thechapter
          \par\nobreak
          \vskip 20\p@
      \fi
      \interlinepenalty\@M
      \Huge \sffamily \bfseries #1\par\nobreak
      \vskip 40\p@
    }}

  \def\@makeschapterhead#1{%
    \vspace*{50\p@}%
    {\parindent \z@ \raggedright
      \normalfont
      \interlinepenalty\@M
      \Huge \sffamily \bfseries #1\par\nobreak
      \vskip 40\p@
    }}
}}

\renewcommand{\section}{\@startsection {section}{1}{\z@}%
             {-3.5ex \@plus -1ex \@minus -.2ex}%
             {2.3ex \@plus.2ex}%
             {\normalfont\Large\sffamily\bfseries}}

\renewcommand{\subsection}{\@startsection{subsection}{2}{\z@}%
             {-3.25ex\@plus -1ex \@minus -.2ex}%
             {1.5ex \@plus .2ex}%
             {\normalfont\large\sffamily\bfseries}}

\renewcommand{\subsubsection}{\@startsection{subsubsection}{3}{\z@}%
             {-3.25ex\@plus -1ex \@minus -.2ex}%
             {1.5ex \@plus .2ex}%
             {\normalfont\normalsize\sffamily\bfseries}}

\renewcommand{\paragraph}{\@startsection{paragraph}{4}{\z@}%
             {3.25ex \@plus1ex \@minus.2ex}%
             {-1em}%
             {\normalfont\normalsize\sffamily\bfseries}}

\renewcommand{\subparagraph}{\@startsection{subparagraph}{5}{\parindent}%
             {3.25ex \@plus1ex \@minus .2ex}%
             {-1em}%
             {\normalfont\normalsize\sffamily\bfseries}}
\endinput

%%
%% End of `SFheaders.sty'.