summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/ncclatex/ncclatex.sty
blob: dc7903bfa5561b57c7d51cd0f365e613b92879d7 (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
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{ncclatex}
         [2006/01/17 v1.07 NCC-LaTeX Extension Package (NCC)]
%
% \changes{v1.00}{2002/03/16}{This version is uploaded to CTAN}
% \changes{v1.01}{2002/05/17}{Package extdash is loaded with cyremdash}
% \changes{v1.01}{2002/05/17}{The equation counter is dynamic now}
% \changes{v1.02}{2002/05/19}{Vskip after table's caption is reduced}
% \changes{v1.03}{2004/04/08}{The processing of 'russian' option is improved}
% \changes{v1.04}{2004/12/12}{Require the latest version of nccsect}
% \changes{v1.05}{2005/01/09}{Add options T2A, T2B, T2C}
% \changes{v1.05}{2005/02/07}{Remove |\tr|, |\tl|, and |\tc| commands}
% \changes{v1.05}{2005/02/15}{Prepare equations tag in |\mathrm|)
% \changes{v1.05}{2005/03/23}{Add \NCC logo}
% \changes{v1.05}{2005/04/25}{Declare equation counter as dynamic one}
% \changes{v1.05}{2005/05/20}{Change nccsect package date to 2005/05/20}
% \changes{v1.06}{2005/12/27}{Reorganize the package!!!}
% \changes{v1.06}{2005/12/27}{The `minimize' option is introduced}
% \changes{v1.06}{2005/12/29}{Add defaults for parts in books}
% \changes{v1.06}{2006/01/01}{Minor changes}
% \changes{v1.07}{2006/01/17}{addtopackage -> afterpackage}
%
% Load basic packages
%
\RequirePackage{nccdefaults}
\RequirePackage{dcounter}[2005/04/25]
\RequirePackage{desclist}
\RequirePackage[shortcuts,cyremdash]{extdash}
\RequirePackage{nccmath}
\def\maketag@@@#1{\hbox{$\m@th\mathrm{#1}$}}
\RequirePackage{nccsect}[2005/05/20]
%
% Russian headings (Babel needed)
%
\newif\ifNCC@rus \NCC@rusfalse
\DeclareOption{russian}{\NCC@rustrue}
\DeclareOption{T2C}{\def\NCC@cyrenc{T2C}}
\DeclareOption{T2B}{\def\NCC@cyrenc{T2B}}
\DeclareOption{T2A}{\def\NCC@cyrenc{T2A}}
%
% Smaller section titles
%
\newif\ifNCC@small \NCC@smallfalse
\DeclareOption{small}{\NCC@smalltrue}
%
% The `minimize' option  does not load the optional packages:
%
\def\NCC@temp{%
  \RequirePackage{ncctheorems}
  \RequirePackage{nccthm}
  \RequirePackage{nccboxes}
  \RequirePackage{nccfoots}
  \RequirePackage{nccpic}
  \RequirePackage{nccfloats}
}
\DeclareOption{minimize}{\let\NCC@temp\relax}
%
% Process options
%
\ExecuteOptions{T2A}
\ProcessOptions\relax
\NCC@temp \let\NCC@temp\relax
%
% \acknow starts acknowledgements
%
\newcommand\acknowname{Acknowledgements}
\AfterPackage{babel}{%
  \addto\captionsrussian{%
    \def\acknowname{%
      {\cyr\CYRB\cyrl\cyra\cyrg\cyro\cyrd\cyra\cyrr\cyrn\cyro\cyrs\cyrt\cyri}}%
  }
}
\newcommand{\acknow}{%
  \NCC@secskip{\NCC@runskip}\@nobreakfalse
  \noindent\normalfont\textit\acknowname.\enskip
}
%
% Language specific actions
%
\ifNCC@rus
  \RequirePackage[\NCC@cyrenc]{fontenc}
  \RequirePackage[russian]{nccltrus}
\else
  \def\tg{\qopname\relax o{tg}}
  \def\arctg{\qopname\relax o{arctg}}
  \def\ctg{\qopname\relax o{ctg}}
  \def\arcctg{\qopname\relax o{arcctg}}
  \@ifundefined{No}{\def\No{\mbox{No.}}}{}
\fi
\let\NCC@cyrenc\relax
%
% \cref{label} is cite without square brackets
%
\newcommand*{\cref}[1]{{\def\@cite##1##2{##1}\cite{#1}}}
%
% \mop{FOO} is equivalent to \operatorname{FOO}
%
\newcommand{\mop}{\operatorname}
%
% Define NCC logo
%
\DeclareRobustCommand{\NCC}{{\protect\AmSfont
  N\kern-.05em\lower.5ex\hbox{C}\kern.05emC}%
}
%
% Customize sections and captions
%
\def\NCC@runskip{2.3ex \@plus 1ex \@minus .2ex}
\DeclareSection{-2}{table}{\bfseries}{\z@}{1.3ex}{\small}
\DeclareSection{-1}{figure}{\bfseries}{2ex}{\z@}{\small}
\ifNCC@small
  \@ifundefined{chapter}{%
    \DeclareSection*0{part}{\large\bff}%
                    {4ex \@plus 1ex \@minus .2ex}%
                    {2.8ex \@plus .2ex}{\LARGE\bff}
  }{%
    \DeclarePart{\StartFromTextArea\vspace{\stretch{.5}}\centering}%
                {\vfill\newpage}{\vspace{1.5em}\Large\bff}{\huge\bff}
    \DeclareSection*0{chapter}{\vspace{1.5ex}\large\bff}{\z@}%
                    {6ex \@plus .2ex}{\LARGE\bff}
  }
  \DeclareSection*1{section}{}%
                  {3.1ex \@plus 1ex \@minus .2ex}%
                  {1.5ex \@plus .2ex}{\large\bff}
  \DeclareSection*2{subsection}{}%
                  {2.7ex \@plus 1ex \@minus .2ex}%
                  {1.5ex \@plus .2ex}{\normalsize\bff}
  \DeclareSection*3{subsubsection}{}%
                  {\NCC@runskip}%
                  {1.5ex \@plus .2ex}{\normalsize\bff\itshape}
\else
  \@ifundefined{chapter}{%
    \DeclareSection*0{part}{\Large\bff}%
                    {5ex \@plus 1ex \@minus .2ex}%
                    {3.8ex \@plus .2ex}{\huge\bff}
  }{%
    \DeclarePart{\StartFromTextArea\vspace{\stretch{.5}}\centering}%
                {\vfill\newpage}{\vspace{2em}\LARGE\bff}{\Huge\bff}
    \DeclareSection*0{chapter}{\vspace{2ex}\Large\bff}{\z@}%
                    {8ex \@plus .2ex}{\huge\bff}
  }
  \DeclareSection*1{section}{}%
                  {3.5ex \@plus 1ex \@minus .2ex}%
                  {2.3ex \@plus .2ex}{\Large\bff}
  \DeclareSection*2{subsection}{}%
                  {3.1ex \@plus 1ex \@minus .2ex}%
                  {1.5ex \@plus .2ex}{\large\bff}
  \DeclareSection*3{subsubsection}{}%
                  {2.7ex \@plus 1ex \@minus .2ex}%
                  {1.5ex \@plus .2ex}{\normalsize\bff}
\fi
\DeclareSection4{paragraph}{}{\NCC@runskip}%
                {-.6em \@plus -.2em \@minus -.1em}{\normalsize\bff}
\DeclareSection5{subparagraph}[\parindent]{}{\NCC@runskip}%
                {-.6em \@plus -.2em \@minus -.1em}{\normalsize\bff}
%
% Millimeters are default units in NCC-LaTeX
%
\unitlength=1mm
\endinput