summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ncctools/topsection.sty
blob: 5f041ab50f1264d85434dd62adec3908a59e5641 (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
%%
%% This is file `topsection.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% topsection.dtx  (with options: `package')
%% 
%% IMPORTANT NOTICE:
%% 
%% This file is a generated file from the sources of the `ncctools'
%% bundle.
%% 
%% You are not allowed to modify this file.
%% 
%% You are allowed to distribute this file if and only if
%% it is distributed with the corresponding source files in
%% the `ncctools' bundle.
%% 
%% For the copying and distribution conditions of the source files,
%% see the README file distributed with the ncctools bundle.
%%
%% File: topsection.dtx Copyright (C) 2005 by Alexander I. Rozhenko
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{topsection}
         [2005/12/24 v1.0 Top section definition (NCC)]
\providecommand\@mkboth[2]{}
\newcommand\@iftopchapter[2]{}
\@ifundefined{chapter}{%
  \def\NCC@topsection{\section}%
  \let\@iftopchapter\@secondoftwo
}{%
  \def\NCC@topsection{\chapter}%
  \let\@iftopchapter\@firstoftwo
}
\newcommand*\topsection[1]{}
\AtBeginDocument{%
  \@ifpackageloaded{nccsect}{%
    \renewcommand*\topsection[1]{%
      \ifx\@mkboth\@gobbletwo
        \noheadingtag \NCC@topsection{#1}%
      \else
        \norunninghead
        \noheadingtag \NCC@topsection{#1}%
        \@mkboth{\MakeUppercase{#1}}{\MakeUppercase{#1}}%
      \fi
    }%
  }{%
    \renewcommand*\topsection[1]{%
      \NCC@topsection*{#1}%
      \@mkboth{\MakeUppercase{#1}}{\MakeUppercase{#1}}%
    }%
  }%
}
\endinput
%%
%% End of file `topsection.sty'.