summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/toptesi/toptesi.sty
blob: f2ef8813c8e52f4af5617f56be08e963eee9de72 (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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
%%
%% This is file `toptesi.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% toptesi.dtx  (with options: `topsty')
%% 
%% Copyright 1989--2005 Claudio Beccari All rights reserved.
%% 
%%  This system is distributed in the hope that it will be useful,
%%  but WITHOUT ANY WARRANTY; without even the implied warranty of
%%  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
%% 
%% 
%% IMPORTANT NOTICE:
%% 
%% This file is subject to the LPPL licence, version 1.3 or any subsequent
%% version. Copy of the LaTeX Project Public Licence is downloadable from
%% any CTAN archive.
%% 
%% 
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{toptesi}%
[2008/12/15 v.5.00 Extension for toptesi.cls]%
\def\TRON{\tracingcommands \tw@ \tracingmacros \tw@}
\def\TROFF{\tracingcommands\z@ \tracingmacros \z@}
\let\TROF\TROFF
\newif\if@binding \@bindingfalse
\newif\ifT@Ppdfa  \T@Ppdfafalse
\newif\ifchapterbibliography \chapterbibliographyfalse
\DeclareOption{cucitura}{\@bindingtrue}
\DeclareOption{14pt}{\input{topsiz14.clo}}
\DeclareOption{chapterbib}{\chapterbibliographytrue}
\DeclareOption{trieste}{\AtEndOfPackage{\RequirePackage{trieste}}}
\DeclareOption{classica}{\AtEndOfPackage{\RequirePackage{trieste}}}
\DeclareOption{pdfa}{\T@Ppdfatrue}
\ProcessOptions\relax
\RequirePackage{graphicx}
\textheight 585pt
\divide\textheight by \baselineskip
\multiply\textheight by \baselineskip
\advance\textheight by \topskip
\ifx\f@size\@xivpt
    \textwidth=138mm
\else
    \textwidth=150mm
\fi
\oddsidemargin=\paperwidth
\advance\oddsidemargin -\textwidth
\divide\oddsidemargin \tw@
\advance\oddsidemargin -1in
\evensidemargin=\oddsidemargin
\marginparwidth\oddsidemargin
\advance\marginparwidth 1in
\advance\marginparwidth-2.5\marginparsep
\if@binding
 \typeout{Messaggio Toptesi: Ricalcolo i margini}
 \advance\oddsidemargin 7mm
 \advance\evensidemargin -7mm
 \advance\marginparwidth -7mm
 \advance\marginparwidth -7mm
\fi
\def\lapagina{\thepage}
\mark{{}{}}
\newbox\@intesta
\def\ps@plain{\let\@mkboth\@gobbletwo
\def\@oddfoot{\null\hfill {{\lapagina}}\hfill \null}\def\@oddhead{}
\def\@evenhead{}\let\@evenfoot\@oddfoot}
\if@twoside
   \def\ps@headings{\let\@mkboth\markboth%
   \def\@oddfoot{\null\hfill {{\lapagina}} \hfill\null}
   \let\@evenfoot\@oddfoot
   %
   \def\@evenhead{\setbox\@intesta\hbox{\footnotesize\slshape
        \leftmark}%
   \ifdim\wd\@intesta>\textwidth \headWarn{\chapter}\fi%
   \underline{\makebox[\textwidth]{\footnotesize\slshape
        \strut\leftmark}}}%
   \def\@oddhead{\setbox\@intesta\hbox{\footnotesize\slshape
        \rightmark}%
   \ifdim\wd\@intesta>\textwidth \headWarn{\section}\fi%
   \underline{\makebox[\textwidth]{\footnotesize\slshape
        \strut\rightmark}}}%
   \def\chaptermark##1{\markboth{\thechapter\ -- ##1}{}}
   \def\sectionmark##1{\markright{\ifnum\c@secnumdepth>\z@
   \thesection\ -- \fi ##1}}}
\else
   \def\ps@headings{\let\@mkboth\markboth
   \def\@oddfoot{\null \hfill {\lapagina} \hfill \null}
   \def\@evenfoot{}
   \def\@oddhead{\setbox\@intesta\hbox{\footnotesize\slshape
        \rightmark}%
   \ifdim\wd\@intesta>\textwidth \headWarn{\chapter}\fi%
   \underline{\makebox[\textwidth]{\footnotesize\slshape
        \strut\rightmark}}}%
   \def\chaptermark##1{\markright{\thechapter\ -- ##1}}}
\fi
\def\headWarn#1{\PackageWarning{toptesi}{%
   THE HEADING IS TOO LONG\MessageBreak
   Use the optional argument of command \string#1\MessageBreak
   See the LaTeX Handbook (1994) on section C.4.1\MessageBreak}}
\newif\iffigurespage
\newif\iftablespage
\newif\ifnumeriromani
\newif\iffrontmatter
\def\frontmatter{\clearpage\ps@plain\pagenumbering{roman}%
    \numeriromanitrue\frontmattertrue\@openrightfalse}
\def\mainmatter{\if@twoside\@openrighttrue\fi
    \clearpage\ps@headings\pagenumbering{arabic}%
    \numeriromanifalse\frontmatterfalse}
\AtBeginDocument{\frontmatter}
\figurespagefalse
\tablespagefalse
\def\sommario{%
 \iffrontmatter\else\frontmattertrue\fi
 \if@openright\cleardoublepage\else\clearpage\fi
 \global\@topnum\z@
 \@afterindentfalse
 \@schapter{\summaryname}%
 \addcontentsline{toc}{chapter}{\summaryname}%
        }
\def\ringraziamenti{%
 \iffrontmatter\else\frontmattertrue\fi
 \if@openright\cleardoublepage\else\clearpage\fi
 \global\@topnum\z@
 \@afterindentfalse
 \@schapter{\acknowledgename}%
 \addcontentsline{toc}{chapter}{\acknowledgename}%
        }
\renewcommand\chapter{%
  \iffrontmatter\mainmatter\fi
  \if@openright\cleardoublepage\else\clearpage\fi
  \thispagestyle{plain}%
  \global\@topnum\z@
  \@afterindentfalse
  \secdef\@chapter\@schapter}
\renewcommand\part{%
  \iffrontmatter\mainmatter\fi
  \if@openright\cleardoublepage\else\clearpage\fi
  \thispagestyle{empty}%
  \if@twocolumn\onecolumn\@tempswatrue\else\@tempswafalse\fi
  \null\vfil
  \secdef\@part\@spart}
\renewcommand\tableofcontents{%
 \if@twocolumn\@restonecoltrue\onecolumn\else\@restonecolfalse\fi
 \if@openright\cleardoublepage\else\clearpage\fi
 \global\@topnum\z@
 \@afterindentfalse
 \@schapter{\contentsname}%
 \@starttoc{toc}%
 \clearpage
 \if@restonecol\twocolumn\fi
    }
\renewcommand\listoffigures{%
    \if@twocolumn\@restonecoltrue\onecolumn\else\@restonecolfalse\fi
    \if@openright\cleardoublepage\else\clearpage\fi
    \global\@topnum\z@
    \@afterindentfalse
    \@schapter{\listfigurename}
    \@mkboth{\listfigurename}{\listfigurename}%
    \@starttoc{lof}%
    \clearpage
    \if@restonecol\twocolumn\fi
    }
\renewcommand\listoftables{%
    \if@twocolumn\@restonecoltrue\onecolumn\else\@restonecolfalse\fi
    \if@openright\cleardoublepage\else\clearpage\fi
    \global\@topnum\z@
    \@afterindentfalse
    \@schapter{\listtablename}%
    \@mkboth{\listtablename}{\listtablename}%
    \@starttoc{lot}%
    \clearpage
    \if@restonecol\twocolumn\fi
    }
\def\indici{%
 \iffrontmatter\else\frontmattertrue\fi
        \tableofcontents
        \iftablespage
                {\addvspace{10pt}
                \let\saveaddvspace=\addvspace
                \def\addvspace##1{}
                \listoftables
                \let\addvspace=\saveaddvspace}
        \fi
        \iffigurespage
                {\addvspace{10pt}
                \let\saveaddvspace=\addvspace
                \def\addvspace##1{}
                \listoffigures
                \let\addvspace=\saveaddvspace}
        \fi
}
\onecolumn
\if@twoside
    \flushbottom
\else
    \ifx\@xivpt\f@size
        \raggedbottom
    \else
        \flushbottom
    \fi
\fi
\brokenpenalty=10000
\def\interlinea#1{\linespread{#1}\selectfont}
\def\endinterlinea{\par}
\def \@floatboxreset {%
        \reset@font
        \linespread{1}%
        \normalsize
        \@setminipage
}
\def\fps@figure{htb} \def\fps@table{htb}
\setcounter{topnumber}{2}
\def\topfraction{1}
\setcounter{bottomnumber}{1}
\def\bottomfraction{.5}
\setcounter{totalnumber}{3}
\def\textfraction{0}
\def\floatpagefraction{0}
\setcounter{dbltopnumber}{2}
\def\dbltopfraction{1}
\def\dblfloatpagefraction{0}
\newdimen\captionwidth
\long\def\@makecaption#1#2{%
   \begingroup
   \small \parskip\z@ \parindent\z@
   \finalhyphendemerits 100000\relax
   \linespread{0.95}\selectfont
   \vskip \abovecaptionskip
   \captionwidth=\hsize
   \advance\captionwidth-3em
   \setbox0 \hbox{#1.\quad#2}%
   \ifdim\wd0>\hsize
      \setbox1 \vbox{\hsize=\captionwidth
      \unhbox0\par\global\setbox2\lastbox}%
      \setbox2\hbox{\unhbox2}%
      \ifdim\wd2<0.333333\captionwidth
         \count255=\ht1 \advance\count255 \dp1
         \divide\count255\baselineskip
         \advance\count255\@ne
         \@tempdima=\wd2
         \advance\@tempdima \count255\captionwidth
         \advance\@tempdima 0.5\captionwidth
         \advance \count255\@ne
         \divide \@tempdima \count255
         \captionwidth=\@tempdima
         \setbox0 \vbox{\hsize\captionwidth
         #1.\quad#2}
      \else
         \setbox2\hbox to\captionwidth{\unhbox2 \hfill}%
         \setbox0\vbox{\unvbox1\box2}%
      \fi
   \fi
   \makebox[\hsize]{\box0}%
   \endgroup
}
\def\redef@bibitem{\def\@bibitem##1{\item\if@filesw
       \immediate\write\@auxout
       {\string\bibcite{##1}{\thechapter.\the\c@enumi}}\fi\ignorespaces}}
\def\thebibliography#1{%
 \ifchapterbibliography\section*{\bibname}\relax
    \if@twoside\markright{\bibname}\fi
    \addcontentsline{toc}{section}{\bibname}\relax
    \redef@bibitem
    \list{[\thechapter.\arabic{enumi}]}{%
    \settowidth\labelwidth{[\thechapter.#1]}\leftmargin\labelwidth
    \advance\leftmargin\labelsep\itemsep\z@ plus 1pt\parsep\z@
    \usecounter{enumi}}
 \else
    \chapter*{\bibname}\relax
    \@mkboth{\bibname}{\bibname}\relax
    \addcontentsline{toc}{chapter}{\bibname}\relax
    \list{[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}%
    \leftmargin\labelwidth
    \advance\leftmargin\labelsep\itemsep\z@ plus 1pt\parsep\z@
    \usecounter{enumi}}
 \fi
 \def\newblock{\hskip .11em plus .33em minus -.07em}
 \sloppy
 \sfcode`\.=1000\relax}

\let\endthebibliography=\endlist
\long\def\@footnotetext#1{\insert\footins{\linespread{1}\footnotesize
    \interlinepenalty\interfootnotelinepenalty
    \splittopskip\footnotesep
    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
    \hsize\columnwidth \@parboxrestore
   \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}%
   \@makefntext{\rule{\z@}{\footnotesep}\ignorespaces#1\strut}}}
\mathcode`\,="013B
\catcode`\^^Z=10
\topmargin 0pt
\let\summaryname\empty
\let\acknowledgename\empty
\newcommand*\ExtendCaptions[3]{{%
\@ifundefined{captions#1}{%
\PackageWarning{toptesi}{Language option #1 not specified\MessageBreak
Skipping any redefinition\MessageBreak}%
}{%
\expandafter\let\expandafter\@tempA\csname captions#1\endcsname
 \toks0=\expandafter{\@tempA%
    \def\summaryname{#2}%
    \def\acknowledgename{#3}}%
 \expandafter\xdef\csname captions#1\endcsname{\the\toks0}%
 }}}%
\ExtendCaptions{italian}{Sommario}{Ringraziamenti}
\ExtendCaptions{english}{Summary}{Acknowledgements}
\def\italiano{\selectlanguage{italian}}%
\def\english{\selectlanguage{english}}%
\let\inglese\english
\AtBeginDocument{%
    \italiano
    \renewcommand\@chapapp{\chaptername}%
    }
\RequirePackage{topfront}
\RequirePackage{topcoman}
\def\sf@size{7}
\renewcommand*\not{\mathrel{\mathchoice%
{\rlap{$\displaystyle\mkern2.5mu\mathnormal{/}$}}%
{\rlap{$\textstyle\mkern2.5mu\mathnormal{/}$}}%
{\rlap{$\scriptstyle\mkern2.5mu\mathnormal{/}$}}%
{\rlap{$\scriptscriptstyle\mkern2.5mu\mathnormal{/}$}}%
}}
\renewcommand\mapstochar{\mathrel{\mathchoice
{\displaystyle\unitlength=0.0555\fontdimen6\font
   \picture(0,0)\put(1,1.5){\linethickness{0.72\unitlength}%
   \line(0,1){6}}\endpicture}
{\textstyle\unitlength=0.0555\fontdimen6\font
   \picture(0,0)\put(1,1.5){\linethickness{0.72\unitlength}%
   \line(0,1){6}}\endpicture}
{\scriptstyle\unitlength=0.0555\fontdimen6\font
   \picture(0,0)\put(1,0.55){\linethickness{0.61\unitlength}%
   \line(0,1){5}}\endpicture}
{\scriptscriptstyle\unitlength=0.0555\fontdimen6\font
   \picture(0,0)\put(1,0.2){\linethickness{0.56\unitlength}%
   \line(0,1){4}}\endpicture}
}}
\ifT@Ppdfa\RequirePackage[a-1b]{pdfx}\fi
\endinput
%%
%% End of file `toptesi.sty'.