summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/ncclatex/ncctitle.sty
blob: 5a38762aae6627893fb6367503f6c7f7ec146bc5 (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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
\ProvidesPackage{ncctitle}
         [2005/12/26 v1.06 Title page (NCC)]
%
% \changes{v1.00}{2002/02/19}{This version is uploaded to CTAN}
% \changes{v1.01}{2004/11/30}{Add the \NCC@titlestyle hook}
% \changes{v1.01}{2004/11/30}{Add the \StartFromHeaderArea command
%                             at the beginning of title and abstract}
% \changes{v1.01}{2004/11/30}{Service title management commands added}
% \changes{v1.02}{2004/12/07}{Add the \NCC@abstractstyle hook}
% \changes{v1.02}{2004/12/07}{Introduce \makelastpage command}
% \changes{v1.02}{2004/12/07}{Add services for the abstract and last page}
% \changes{v1.03}{2004/12/16}{Replace \NCC@gempty with \@empty}
% \changes{v1.04}{2005/06/18}{Use \ExpandTextArea in title pages}
% \changes{v1.04}{2005/06/18}{Introduce \titleareadefault}
% \changes{v1.05}{2005/07/24}{Replace \vfil to \vfill in the \endabstract}
% \changes{v1.06}{2005/12/26}{Change extension from .clo to .sty}
%
% This package provides a title, an abstract, and a last page prepared
% on separate title pages.
%
\RequirePackage{ncctitlepage}
%
% The expansion of the text area on these pages is specified with the
% \titleareadefault macro.
%
\newcommand\titleareadefault{*}
%
% The \maketitle uses the following hooks:
%
% \NCC@titlestyle   a style applied to the title
% \NCC@titlebegin   typed out at the beginning of title
% \@maketitle       prepares a title
% \NCC@titlecomment typed out right after the title
% \NCC@titleend     typed out at the end of title
%
% We do not delete title specific commands because the \@maketitle
% command can be used for preparing other special pages also.
%
\def\maketitle{%
  \begin{titlepage}%
    \NCC@titlestyle
    \ExpandTextArea[\titleareadefault]%
    \let\footnoterule\relax
    \renewcommand\thefootnote{\@fnsymbol\c@footnote}%
    \begingroup
      \def\@makefnmark{\@textsuperscript{\normalfont\@thefnmark}}%
      \NCC@titlebegin
      \@maketitle
      \NCC@titlecomment
      \NCC@titleend
    \endgroup
    \@thanks\setcounter{footnote}{0}\gdef\@thanks{}%
  \end{titlepage}%
}
\let\NCC@titlecomment\@empty
%
% What goes first in title: author or title?
%
\@ifundefined{ifNCC@authorbeforetitle}{%
  \newif\ifNCC@authorbeforetitle
  \newcommand{\AuthorBeforeTitle}{\NCC@authorbeforetitletrue}
  \newcommand{\TitleBeforeAuthor}{\NCC@authorbeforetitlefalse}
  \@onlypreamble\AuthorBeforeTitle
  \@onlypreamble\TitleBeforeAuthor
  \AuthorBeforeTitle
}
%
% \@maketitle makes the title itself. The \@date useless in NCC titles
%
\def\@maketitle{%
  \ifx\@author\@empty {\huge\bff \@title \par}%
  \else
    \ifNCC@authorbeforetitle \else
      {\huge\bff \@title \par}\vskip 3em
    \fi
    {\Large\bfseries \lineskip .75em \@author \par}%
    \ifNCC@authorbeforetitle 
      \vskip 2em {\huge\bff \@title \par}%
    \fi
  \fi
}
%
% Service hooks for the title:
%
% \titlestretch{value}
% \titlestyle{A style}
% \titlehead{A text at the top of title}
% \titlesign{A sign of Publishing House}
% \titlefoot{A text at the bottom of title}
% \titlecomment{A comment below title}
%
% The \titlecomment is also applied to the last page
%
\newcommand*\titlestretch[1]{\def\NCC@titlestretch{#1}}
\newcommand*\titlestyle[1]{\def\NCC@titlestyle{#1}}
\newcommand\titlehead[1]{\def\NCC@titlebegin{{#1\par}\vfill}}
\newcommand\titlesign[1]{\def\NCC@titlesign{#1}}
\newcommand\titlefoot[1]{%
  \def\NCC@titleend{%
    \vspace{\stretch{\NCC@titlestretch}}%
    {\NCC@titlesign\par}%
    \vspace{\stretch{\NCC@titlestretch}}%
    {#1\par}%
  }%
}
\newcommand\titlecomment[1]{%
  \def\@tempa{#1}%
  \ifx\@tempa\@empty
    \let\NCC@titlecomment\@empty
  \else
    \def\NCC@titlecomment{\vskip 1.5em {\large#1\par}}%
  \fi
}
%
% The abstract environment uses the following hooks:
%
% \NCC@abstractstyle a style applied to the abstract
% \NCC@abstractbegin typed out at the beginning of abstract
% \NCC@abstractend   typed out at the end of abstract
%
% The area of the abstract page is specified with \TitleAreaDefault macro.
%
\def\abstract{%
  \titlepage 
  \NCC@abstractstyle
  \ExpandTextArea[\titleareadefault]%
  \NCC@abstractbegin
  \begingroup
}
\def\endabstract{
  \par\endgroup
  \vfill
  \NCC@abstractend
  \endtitlepage
}
%
% Service hooks for the abstract:
%
% \abstractstyle{A style for main part of abstract}
% \bibindex[style]{A bibliography index of the document}
% \copyrighttable[style]{ISBN}{\item copyright\\ \item copyright ...}
%
% \fulltitle[style]{authors}{full title} this command is used inside
% the abstract.
%
% In the \bibindex and \copyrighttable, the default style is \footnotesize.
% In the \fulltitle, the default style is \normalsize.
%
\newcommand*\abstractstyle[1]{%
  \def\NCC@abstractstyle{#1\def\qef{\par\addvspace{2.5ex \@minus .5ex}}}%
}
\newcommand\bibindex[2][\footnotesize]{%
  \if!#2!%
    \let\NCC@abstractbegin\@empty
  \else
    \def\NCC@abstractbegin{{\noindent#1\ignorespaces#2\par}\qef}%
  \fi
}
\newcommand*\copyrighttable[3][\footnotesize]{%
  \def\NCC@abstractend{#1\noindent
    \pbox[lb]{#2}\hfill
    \def\item{\llap{\copyright\ }}%
    \pbox[lb]{#3}%
    \par
  }
}
\newcommand*\fulltitle[3][\normalsize]{%
  {\par#1\normalfont{\bfseries#2} #3\par}%
  \qef%
}
%
% The \makelastpage uses the following hooks:
%
% \NCC@lastpagestyle   a style applied to the last page
% \NCC@lastpagebegin   typed out at the beginning of the last page
% \@maketitle          prepares a title
% \NCC@titlecomment    typed out right after the title on the last page
% \NCC@lastpageend     typed out at the end of the last page
%
% The area of the last page is specified with \TitleAreaDefault macro.
%
\newcommand{\makelastpage}{%
  \begin{titlepage}%
    \NCC@lastpagestyle
    \ExpandTextArea[\titleareadefault]%
    \NCC@lastpagebegin
    \@maketitle
    \NCC@titlecomment
    \NCC@lastpageend
  \end{titlepage}%
}
%
% Service hooks for the last page:
%
% \lastpagestretch{value}
% \lastpagestyle{A style}
% \lastpagehead{A text at the top of the last page}
% \lastpageinfo[style]{Designers}{Publishing attributes}{Publisher}
%
\newcommand*\lastpagestretch[1]{\def\NCC@lastpagestretch{#1}}
\newcommand*\lastpagestyle[1]{\def\NCC@lastpagestyle{#1}}
\newcommand\lastpagehead[1]{\def\NCC@lastpagebegin{{#1\par}\vfill}%
}
\newcommand\lastpageinfo[4][\small]{%
  \def\NCC@lastpageend{#1%
    \vspace{\stretch{\NCC@lastpagestretch}}%
    {#2\par}\bigskip
    \hrule \@height .6pt\@width\linewidth
    {\Strut/.5/\ignorespaces#3\unskip\Strut/-.5/\par}%
    \hrule \@height .6pt\@width\linewidth
    \bigskip{#4\par}%
  }%
}
%
% Defaults
%
\titlestretch{1}
\titlestyle{\centering}
\titlehead{}
\titlesign{}
\titlefoot{}
\titlecomment{}
%
\abstractstyle{\small}
\bibindex{}
\def\NCC@abstractend{}
%
\lastpagestretch{1}
\lastpagestyle{\centering}
\lastpagehead{}
\def\NCC@lastpageend{\vspace{\stretch{\NCC@lastpagestretch}}}
%
\endinput