summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/ncclatex/nccdefaults.sty
blob: 1ac2ebdb1e2f812e110394609ac8616e893424ee (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
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{nccdefaults}
         [2006/01/17 v1.03 NCC-LaTeX default settings (NCC)]
%
% \changes{v1.01}{2006/01/05}{This version is uploaded to CTAN}
% \changes{v1.02}{2006/01/06}{Remove \SetTOCStyle and \ChapterPrefixStyle}
% \changes{v1.03}{2006/01/17}{addtopackage -> afterpackage}
%
% The package specifies default settings to be applied to some packages
% from ncctools collection when they will be loaded. All this technique
% is based on the `afterpackage' package from ncctools.
%
\RequirePackage{afterpackage}
%
% Declare the equation counter to be dynamic and specify the default
% count style depending on class in use.
%
\AfterPackage{dcounter}{%
  \DeclareDynamicCounter{equation}
  \@ifundefined{chapter}{\countstyle{}}{\countstyle{chapter}}
}
%
% The default style of table headers is \scriptsize
%
\AfterPackage{nccboxes}{\renewcommand{\cboxstyle}{\scriptsize}}
%
% Change defaults for the nccsect package
%
\AfterPackage{nccsect}{%
%
% Specify section, toc, and caption syffices and default section style.
%
  \SectionTagSuffix{.\hskip .6em}
  \CaptionTagSuffix{.\hskip .6em \@plus .2em \@minus .1em}
  \NumberlineSuffix{.\hskip .6em}{.\hskip .4em}
  \sectionstyle{hangindent*}
%
% \openrightorany clears page or double page depending on openright
% mode selected.
%
  \@ifundefined{if@openright}{%
    \newcommand\openrightorany{\clearpage}%
  }{%
    \newcommand\openrightorany{\clearpage
      \if@openright \if@twoside
        \begingroup\let\leftmark\relax \cleardoublepage\endgroup
      \fi\fi
    }%
  }
  \@ifundefined{chapter}{}{%
%
% The following hooks are specified in books and reports only. 
%
% Redefine the start-part and start-chapter hooks:
%
    \RequirePackage{watermark}
    \def\NCC@startpart{\openrightorany\thispageheading{}}
    \def\NCC@startchap{\openrightorany\thispageheading{}%
      \global\@topnum\z@
    }
%
% Specify the appearance of part and chapter prefices
%
    \def\NCC@thetocpart{\partname\ \thepart}
    \ChapterPrefixStyle{}% no prefix by default
%
% Provide \frontmatter, \mainmatter, and \backmatter commands
%
    \@ifundefined{if@mainmatter}{%
      \newif\if@mainmatter \@mainmattertrue
    }{}
    \providecommand\frontmatter{%
      \@mainmatterfalse\pagenumbering{roman}%
    }
    \providecommand\mainmatter{%
      {\@openrighttrue\openrightorany}%
      \@mainmattertrue
      \pagenumbering{arabic}%
    }
    \providecommand\backmatter{%
      \openrightorany \@mainmatterfalse
    }
  }
}
%
% Specify default styles for theorems
%
\AfterPackage{nccthm}{%
  \renewtheoremtype{remark}{\bfseries}{}{}
  \TheoremCommentDelimiters{}{}
  \AfterTheoremHeaderChar{.}
  \AfterTheoremHeaderSkip{\hskip .7em \@plus .2em \@minus .1em}
  \AparStyleParameters{\bfseries\mathversion{bold}}%
                      {\bfseries\mathversion{bold}}{.\enskip}
  \ProofStyleParameters{\bfseries\mathversion{bold}}{\proofname}
  \newcommand\proofname{Proof}
  \AfterPackage{babel}{%
    \addto\captionsrussian{%
      \def\proofname{%
        {\cyr\CYRD\cyro\cyrk\cyra\cyrz\cyra\cyrt\cyre\cyrl\cyrsftsn%
         \cyrs\cyrt\cyrv\cyro}}%
    }
  }
}
%
% Patch to the russian style of babel
%
\AfterPackage{babel}{%
  \ifx\cyrillicencoding\undefined \else
%
% Add a small kern to German left double quote shorthand
%
    \declare@shorthand{russian}{"`}{\glqq\nobreak\hskip.0166667em }
%
% Remove last Babel's ``improvements'' to \flqq and \frqq commands.
% The result of these improvements is that russian corner quotes
% are taken from another font encoding than T2 and look very bad.
%
    \DeclareRobustCommand{\flqq}{%
      \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
    \DeclareRobustCommand{\frqq}{%
      \textormath{\guillemotright}{\mbox{\guillemotright}}}
%
% Redefine the numero sign to work in any encoding
%
    \DeclareRobustCommand{\No}{%
      \ifmmode{\nfss@text{\textnumero}}\else{\cyr\textnumero}\fi
    }
  \fi
}
\endinput