-
Notifications
You must be signed in to change notification settings - Fork 0
/
his-thesis.cls
963 lines (814 loc) · 30.4 KB
/
his-thesis.cls
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
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
%%
%% This is file `his-thesis.cls'
%%
%% \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}
\ProvidesClass{his-thesis}[2018/03/07]
% Necessary for included LaTeX classes
\newif\if@titlepage%
\@titlepagetrue%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Options
%%
% Chapters and parts must start on a right-hand page request one.
\newif\if@openright% FIXME necessary?
\@openrighttrue
\newif\if@mainmatter \@mainmattertrue% FIXME necessary?
\RequirePackage{ifthen}% provides \ifthenelse and \newboolean
\newboolean{@isfinal}
\DeclareOption{final}{\setboolean{@isfinal}{true}}
%% Ten, eleven, and twelve point size options
\newcommand\@ptsize{0}% FIXME necessary?
% For two-sided printing we use the switch \if@twoside.
% In addition we have to set the \if@mparswitch to get
% any margin paragraphs into the outside margin.
\@twosidetrue
\@mparswitchtrue
% Pass language-specific options "english" and "swedish" to Babel
\newcounter{@numberoflanguagesinoptions}
\DeclareOption{english}{%
\PassOptionsToPackage{swedish,main=USenglish}{babel}%
\stepcounter{@numberoflanguagesinoptions}
}
\DeclareOption{swedish}{%
\PassOptionsToPackage{USenglish,main=swedish}{babel}%
\stepcounter{@numberoflanguagesinoptions}
}
%%
%% End of Options
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Execute Options
%%
% \ExecuteOptions{a4paper,twoside,topside,openright}
\ProcessOptions
\input{his-thesis10.clo}
%%
%% End of Execute Options
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Required packages
%%
% Check that either 'english' or 'swedish' is specified as class option,
% but not both at the same time or none at all
\ifthenelse{\equal{\value{@numberoflanguagesinoptions}}{0}}{%
\PackageError{his-thesis}{One language must be specified as option: either 'english' or 'swedish'}{}%
}{%
\ifthenelse{\equal{\value{@numberoflanguagesinoptions}}{1}}{}{%
\PackageError{his-thesis}{Only one language may be specified as option: either 'english' or 'swedish'}{}%
}}
% For language-specific features such as correct word wrapping
\RequirePackage{babel}
% For improved \RaggedLeft, \RaggedRight, and \Centering commands
\RequirePackage{ragged2e}
\RequirePackage[overload]{textcase}% FIXME necessary?
%% Define page size and margins
\ifthenelse{\boolean{@isfinal}}{%
%% Option 'final' is set, so use special paper size
\RequirePackage[%
paperwidth=168mm,%
paperheight=240mm,%
layoutsize={168mm,240mm},% layout size equals special paper size
layoutvoffset={0mm},% where to place the dissertation's pages on paper
layouthoffset={0mm},%
margin=20mm,% symmetric margins even in two-side layout
showcrop=false%
]{geometry}
%% Important: there are various \pdfpagewidth \pdfpageheight statements that
%% change the paper size in mid-document
\RequirePackage{luatex85}% required for \pdfpageheight and \pdfpagewidth
}{%
%% Option 'final' not set, so use A4 paper with cut marks
\RequirePackage[%
a4paper,% use A4 paper as base to print on
layoutsize={168mm,240mm},% the dissertations internal paper size
layoutvoffset={28.5mm},% where to place the dissertation's pages on an A4 paper
layouthoffset={21mm},%
margin=20mm,% symmetric margins even in two-side layout
showcrop=true%
]{geometry}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Color Definitions
\RequirePackage[table,svgnames,dvipsnames]{xcolor}
% Define a red color used for special pages' backgrounds,
% needs to be re-defined in hismetadata.sty for either
% doctoral dissertations or licentiate thesises
\definecolor{specialpagebackground}{RGB}{191,15,0}% red
% An orange shade
\definecolor{oxid}{RGB}{234,120,25}
%% To set and restore page color
\xdef\thepagecolornone{white}% this seeming redundant definition is sometimes necessary
\RequirePackage[nopagecolor={white}]{pagecolor}
%%
%% End of Required packages
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Line spacing parameters
%%
\setlength\lineskip{0\p@}
\setlength\normallineskip{0\p@}
%%
%% End of Line spacing parameters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Paragraph style parameters
%%
\renewcommand\baselinestretch{}
\setlength\parskip{4.5\p@ \@plus0\p@}
\parindent=\z@
%%
%% End of Paragraph style parameters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\@item[#1]{%
\if@noparitem
\@donoparitem
\else
\if@inlabel
\indent \par
\fi
\ifhmode
\unskip\unskip \par
\fi
\if@newlist
\if@nobreak
\@nbitem
\else
\addpenalty\@beginparpenalty
\addvspace\@topsep
\addvspace{-\parskip}%
\fi
\else
\addpenalty\@itempenalty
\addvspace\itemsep
\fi
\global\@inlabeltrue
\fi
\everypar{%
\RaggedRight %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\@minipagefalse
\global\@newlistfalse
\if@inlabel
\global\@inlabelfalse
{\setbox\z@\lastbox
\ifvoid\z@
\kern-\itemindent
\fi}%
\box\@labels
\penalty\z@
\fi
\if@nobreak
\@nobreakfalse
\clubpenalty \@M
\else
\clubpenalty \@clubpenalty
\everypar{}%
\fi}%
\if@noitemarg
\@noitemargfalse
\if@nmbrlist
\refstepcounter\@listctr
\fi
\fi
\sbox\@tempboxa{\makelabel{#1}}%
\global\setbox\@labels\hbox{%
\unhbox\@labels
\hskip \itemindent
\hskip -\labelwidth
\hskip -\labelsep
\ifdim \wd\@tempboxa >\labelwidth
\box\@tempboxa
\else
\hbox to\labelwidth {\unhbox\@tempboxa}%
\fi
\hskip \labelsep}%
\ignorespaces}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Penalties
%%
%% \nopagebreak and \nolinebreak penalties
\@lowpenalty 51 % book default
\@medpenalty 151 % book default
\@highpenalty 301 % book default
% The following penalties are not used in book. Should we use them?
%%% Line breaking penalties
%\pretolerance=100 % Pass 1 of line breaking algorithm
%\tolerance=200 % Pass 2 of line breaking algorithm
%\doublehyphendemerits=5000 % Two consecutive hyphenated lines: 10000
%\finalhyphendemerits=5000 % Second to the last line is hyphenated
%\adjdemerits=10000 % Two adjacent visually incompatible lines
%\linepenalty=10 % Added for each line
%\looseness=0 % Try to make the paragraph \looseness longer
%
%%% Implicit horizontal penalties
%\hyphenpenalty=50 % Line break in hyphenated word
%\exhyphenpenalty=50 % Same as above, pre-text empty
%\binoppenalty=700 % Line break after binary operation
%\relpenalty=500 % Line break at math relation operator
%
%%% Implicit vertical penalties
%\clubpenalty=500 % Club line at bottom of page: 150
%\widowpenalty=500 % Widow line at top of page: 150
%\displaywidowpenalty=150 % Widow in front of display: 50
%\brokenpenalty=100 % Between hyphenated line and following line
%\predisplaypenalty=10000 % Forbid breaking in front of display
%\postdisplaypenalty=0 % Allow break after display
%
%%% Box related counter parameters
%\hbadness=10000 % Report if badness of hbox > \hbadness: 1000
%\vbadness=10000 % Report if badness of vbox > \vbadness: 1000
%\hfuzz=0.1pt % Report if overfull width of hbox > \hfuzz: 0.1pt
%\vfuzz=0.1pt % Report if overfull width of vbox > \vfuzz: 0.1pt
%%
%% End of Penalties
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\headerfooterfont}{\fontarial{6}{6}}
\newcommand{\staticheadertext}{\MakeUppercase{University of Sk{\"o}vde}}
\setcounter{topnumber}{2}
\renewcommand\topfraction{.7}
\setcounter{bottomnumber}{1}
\renewcommand\bottomfraction{.3}
\setcounter{totalnumber}{3}
\renewcommand\textfraction{.2}
\renewcommand\floatpagefraction{.5}
\setcounter{dbltopnumber}{2}
\renewcommand\dbltopfraction{.7}
\renewcommand\dblfloatpagefraction{.5}
\def\ps@headings{%
\def\@evenhead{\headerfooterfont\staticheadertext\hfil}%
\def\@evenfoot{\headerfooterfont\thepage\hfil}%
\def\@oddhead{\headerfooterfont\hfil\staticheadertext}%
\def\@oddfoot{\headerfooterfont\hfil\thepage}%
\let\@mkboth\markboth
}%
\setcounter{secnumdepth}{2}
\newcounter {part}
\newcounter {chapter}
\newcounter {section}[chapter]
\newcounter {subsection}[section]
\newcounter {subsubsection}[subsection]
\newcounter {paragraph}[subsubsection]
\renewcommand \thepart {\@Roman\c@part}
\renewcommand \thechapter {\@arabic\c@chapter}
\renewcommand \thesection {\thechapter.\@arabic\c@section}
\renewcommand\thesubsection {\thesection.\@arabic\c@subsection}
\renewcommand\thesubsubsection{\thesubsection .\@arabic\c@subsubsection}
\renewcommand\theparagraph {\thesubsubsection.\@arabic\c@paragraph}
\newcommand\@chapapp{\chaptername}
\newcommand\frontmatter{%
\cleardoublepage
\@mainmatterfalse
\pagenumbering{roman}}
\newcommand\mainmatter{%
\cleardoublepage
\@mainmattertrue
\pagenumbering{arabic}}
\newcommand\backmatter{%
\cleardoublepage
\@mainmatterfalse}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Parts
%%
\newcommand{\partlike}[1][]{%
\def\OptArgPartlike{{#1}}%
\partlikeRelay
}
% Hack to get two optional arguments into \partlike
% see: http://www.tex.ac.uk/FAQ-twooptarg.html
\newcommand{\partlikeRelay}[2][]{%
\@beginpart
\vspace{34.74mm}%
\begingroup\color{white}\raggedleft% \RaggedLeft
\ifthenelse{\equal{\OptArgPartlike}{}}{}{\begingroup\fontarial{13.5}{15.0}\OptArgPartlike\par\endgroup}%
\begingroup\fontarial{16.5}{21.0}#2\par\endgroup%
\ifthenelse{\equal{#1}{}}{}{\medskip\par\begingroup\fontarial{9.5}{10.5}#1\par\endgroup}%
\endgroup%
\@endpart%
}
\newcommand\part{%
\secdef\@part\@spart}% for part*, use @spart, for non-star part use @part
%% The actual formatting of the title of the part
\def\@part[#1]#2{%
\@beginpart
\ifnum \c@secnumdepth >-2\relax
\refstepcounter{part}%
\addcontentsline{toc}{part}{\thepart.\hspace{1em}#1}%
\else
\addcontentsline{toc}{part}{#1}%
\fi
\vspace{34.74mm}%
\begingroup\color{white}\raggedleft% \RaggedLeft
\begingroup\fontarial{13.5}{15.0}\MyUpperCase{\partname\hspace{0.5em}\thepart}\par\endgroup%
\begingroup\fontarial{16.5}{21.0}\MyUpperCase{#2}\par\endgroup%
\endgroup%
\@endpart%
}
%% The actual formatting of the title of the part (star form)
\def\@spart#1{%
\@beginpart
\vspace{34.74mm}%
\begingroup\color{white}\raggedleft% \RaggedLeft
\begingroup\fontarial{16.5}{21.0}\MyUpperCase{#1}\par\endgroup%
\endgroup%
\@endpart%
}
%% The actual formatting of the beginning of the part (both star and non-star forms)
\def\@beginpart{%
\cleardoublepage
\ifthenelse{\boolean{@isfinal}}{%
\eject \pdfpagewidth 176mm \pdfpageheight 250mm% Set paper size to 176mm x 250mm
}{%
% In non-final mode, i.e. when printing on A4, do not change paper size
}
\null\vfil
% Define a dark purple color used for page backgrounds
\newpagecolor{specialpagebackground}%
\markboth{}{}% no page header
\thispagestyle{empty}% no page numbers on just this page
}
%% The actual formatting of the end of the part (both star and non-star forms)
\def\@endpart{\vfill
\newpage%
\null%
\thispagestyle{empty}%
\ifthenelse{\boolean{@isfinal}}{%
\eject \pdfpagewidth 168mm \pdfpageheight 240mm% Set paper size to 168mm x 240mm
}{%
% In non-final mode, i.e. when printing on A4, do not change paper size
}
\newpage%
\restorepagecolor% restore original page color
}
%%
%% End of Parts
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Chapters
%%
\newcommand\chapter{\cleardoublepage% chapter shall start on a fresh right page
\global\@topnum\z@% ???
\@afterindentfalse% ???
\secdef\@chapter\@schapter}% for chapter*, use @schapter, for non-star chapter use @chapter
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne% ???
\if@mainmatter% if in main text body (i.e. not ToC, LoC, LoF, ...)
\refstepcounter{chapter}% increase chapter counter
\typeout{\@chapapp\space\thechapter.}% debug output in console
\addcontentsline{toc}{chapter}%
{\protect\numberline{\thechapter}#1}% will appear in ToC
\else
\addcontentsline{toc}{chapter}{#1}% chapters in frontmatter or backmatter, will appear in ToC
\fi
\else
\addcontentsline{toc}{chapter}{#1}% will appear in ToC
\fi
\addtocontents{lof}{\protect\addvspace{10\p@}}% add vertical space between chapters in list of figures
\addtocontents{lot}{\protect\addvspace{10\p@}}% add vertical space between chapters in list of tables
\@makechapterhead{#2}%
\@afterheading}
\def\@makechapterhead#1{% non-star chapter
\vspace*{29\p@}% Add some vertical space between top of page and where text "Chapter N" starts
% Above vertical spacing is a guess work so that the user-defined chapter's title's placement matches the star'ed version
{\parindent \z@ \raggedright
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter% if in main text body (i.e. not ToC, LoC, LoF, ...)
\fontarial{13.5}{15}
\addfontfeature{LetterSpace=7.5}% LetterSpace: 1pt / 13.5pt * 100 = 7.4
\MakeUppercase{\@chapapp}\space \thechapter
\nobreak
\vskip 1.5\p@
\fi
\fi
\interlinepenalty\@M
\fontarial{16.5}{18}
\addfontfeature{LetterSpace=7.5}% LetterSpace: 1.5pt / 16.5pt * 100 = 9.1
\MakeUppercase{#1}\par\nobreak
\vskip 14\p@
}}
\def\@schapter#1{\@makeschapterhead{#1}%
\@afterheading}
\def\@makeschapterhead#1{% star chapter
\vspace*{50\p@}% Add some vertical space between top of page and where text "This Is The Chapter Title" starts
{\parindent \z@ \raggedright
\interlinepenalty\@M
\fontarial{16.5}{18}
\addfontfeature{LetterSpace=7.5}% LetterSpace: 1.5pt / 16.5pt * 100 = 9.1
\uppercase{#1}\par\nobreak
\vskip 14\p@
}}
%%
%% End of Chapters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Sections
%%
%% Parameters of \@startsection
%% name: e.g., subsection
%% level: a number, denoting depth of section - e.g., chapter = 0, section = 1, etc.
%% indent: Indentation of heading from left margin; \z@ is short for zero
%% beforeskip: Absolute value = skip to leave above the heading.
%% If negative, then paragraph indent of text following heading is suppressed
%% afterskip: If positive, then skip to leave below heading,
%% else negative of skip to leave to right of run-in heading.
%% style: Commands to set style. Since June 1996 release the last command in this
%% argument may be a command such as \MakeUppercase or \fbox that takes an
%% argument. The section heading will be supplied as the argument to this
%% command. So setting #6 to, say, \bfseries\MakeUppercase would produce bold,
%% uppercase headings.
%% If * is missing, then increment the counter. If it is present, then there should
%% be no [<altheading>] argument. The command uses the counter secnumdepth. It
%% contains a pointer to the highest section level that is to be numbered.
%% First level heading (swedish: unterrubrik 1)
%% LetterSpace: 1pt / 13.5pt * 100 = 7.4
\newcommand\section{\@startsection {section}{1}{\z@}%
{-18pt \@plus -4pt \@minus -2pt}%
{2.8pt \@plus 2pt}%
{\fontarial{13.5}{15}\addfontfeature{LetterSpace=7.5}\MakeUppercase}}
%% Second level heading (swedish: unterrubrik 2)
%% LetterSpace: 0.5pt / 10.5pt * 100 = 4.8
\newcommand\subsection{\@startsection{subsection}{2}{\z@}%
{-18pt \@plus -4pt \@minus -2pt}%
{2.8pt \@plus 2pt}%
{\fontarial{10.5}{11}\addfontfeature{LetterSpace=5}\MakeUppercase}}
%% Third level heading (swedish: unterrubrik 3)
\newcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
{-5pt \@plus -2pt \@minus -.5pt}%
{0.1pt}%
{\fontarial{9.5}{11}}}
%% Fourth level heading: like third-level heading, but inline
\newcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
{-5pt \@plus -2pt \@minus -.5pt}%
{-1em}%
{\fontarial{9.5}{11}}}
%%
%% End of Sections
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Lists
%%
%% Modified from latex.ltx
\renewenvironment{enumerate}{%
\ifnum \@enumdepth >\thr@@\@toodeep\else
\advance\@enumdepth\@ne
\edef\@enumctr{enum\romannumeral\the\@enumdepth}%
\expandafter
\list
\csname label\@enumctr\endcsname
{\setlength{\rightmargin}{0.33cm} % Right margin indented 0.33 cm
\usecounter\@enumctr\def\makelabel##1{\hss\llap{##1}}}%
\fi}{\endlist}
%% Modified from latex.ltx
\renewenvironment{itemize}{%
\ifnum \@itemdepth >\thr@@\@toodeep\else
\advance\@itemdepth\@ne
\edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
\expandafter
\list
\csname\@itemitem\endcsname
{\setlength{\rightmargin}{0.33cm} % Right margin indented 0.33 cm
\setlength\labelwidth{0.45em} % Bullet positioned just to the
\setlength\labelsep{0.5cm-\labelwidth} % right of the left margi.
\def\makelabel##1{\hss\llap{##1}}}%
\fi}{\endlist}
\leftmargin \leftmargini
\setlength\leftmarginii {2.2em}
\setlength\leftmarginiii {1.87em}
\setlength\leftmarginiv {1.7em}
\setlength\topsep{0pt}
\setlength\partopsep{\topsep}
\setlength\parsep{\parskip}
\setlength\itemsep{0pt}
\setlength\labelsep{0.75em}
\setlength\labelwidth{0.5cm}
\setlength\leftmargini{0mm}
\addtolength\leftmargini{\labelwidth}
\leftmarginii\leftmargini
\leftmarginiii\leftmargini
\leftmarginiv\leftmargini
\@beginparpenalty -\@lowpenalty
\@endparpenalty -\@lowpenalty
\@itempenalty -\@lowpenalty
\renewcommand\theenumi{\@arabic\c@enumi}
\renewcommand\theenumii{\@alph\c@enumii}
\renewcommand\theenumiii{\@roman\c@enumiii}
\renewcommand\theenumiv{\@Alph\c@enumiv}
\newcommand\labelenumi{\theenumi.}
\newcommand\labelenumii{\theenumii}
\newcommand\labelenumiii{\theenumiii.}
\newcommand\labelenumiv{\theenumiv.}
\renewcommand\p@enumii{\theenumi}
\renewcommand\p@enumiii{\theenumi(\theenumii)}
\renewcommand\p@enumiv{\p@enumiii\theenumiii}
\newcommand\labelitemi{\textbullet}
\newcommand\labelitemii{\normalfont\bfseries \textendash}
\newcommand\labelitemiii{\textasteriskcentered}
\newcommand\labelitemiv{\textperiodcentered}
%\setlength \labelsep {.5em}
%\setlength \labelwidth{\leftmargini}
%\addtolength\labelwidth{-\labelsep}
%\@beginparpenalty -\@lowpenalty
%\@endparpenalty -\@lowpenalty
%\@itempenalty -\@lowpenalty
%\renewcommand\theenumi{\@arabic\c@enumi}
%\renewcommand\theenumii{\@alph\c@enumii}
%\renewcommand\theenumiii{\@roman\c@enumiii}
%\renewcommand\theenumiv{\@Alph\c@enumiv}
%\newcommand\labelenumi{\theenumi.}
%\newcommand\labelenumii{(\theenumii)}
%\newcommand\labelenumiii{\theenumiii.}
%\newcommand\labelenumiv{\theenumiv.}
%\renewcommand\p@enumii{\theenumi}
%\renewcommand\p@enumiii{\theenumi(\theenumii)}
%\renewcommand\p@enumiv{\p@enumiii\theenumiii}
%\newcommand\labelitemi{\textbullet}
%\newcommand\labelitemii{\normalfont\bfseries \textendash}
%\newcommand\labelitemiii{\textasteriskcentered}
%\newcommand\labelitemiv{\textperiodcentered}
%%
%% End of Lists
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Environments
%%
%% Description environment
\newenvironment{description}
{\list{}{\labelwidth\z@ \itemindent-\leftmargin
\let\makelabel\descriptionlabel}}
{\endlist}
\newcommand*\descriptionlabel[1]{\hspace\labelsep
\normalfont\bfseries #1}
%% Quote environment
\newenvironment{quote}{%
\par%
\smaller%
\begingroup%
\leftskip4em%
\rightskip\leftskip%
}{%
\par%
\endgroup%
}
%% Appendix environment
\newcommand\appendix{\par
\setcounter{chapter}{0}%
\setcounter{section}{0}%
\gdef\@chapapp{\appendixname}%
\gdef\thechapter{\@Alph\c@chapter}}
%%
%% End of Environments
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Parameters for existing environments
%%
%% Column separation in array = 5\arraycolsep
\setlength\arraycolsep{5\p@}
%% Column separation in tabular = 2\tabcolsep
\setlength\tabcolsep{6\p@}
%% Width of rules in array and tabular
\setlength\arrayrulewidth{.4\p@}
%% Space between adjacent rules in array and tabular
\setlength\doublerulesep{2\p@}
%% Amount of space put in by \ in tabbing environment
\setlength\tabbingsep{\labelsep}
%% Space between last line of text and footnotes in a minipage
\skip\@mpfootins = \skip\footins
%% Space around text in a \fbox
\setlength\fboxsep{3\p@}
%% Width of rules made by \fbox and \framebox
\setlength\fboxrule{.4\p@}
\@addtoreset {equation}{chapter}
%% Layout of equation numbers
\renewcommand\theequation
{\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@equation}
%%
%% End of Parameters for existing environments
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Figures
%%
%% Figure counter
\newcounter{figure}[chapter]
\renewcommand \thefigure
{\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@figure}
%% Floating parameters
\def\fps@figure{tbp}
\def\ftype@figure{1}
\def\ext@figure{lof}
\def\fnum@figure{\figurename\nobreakspace\thefigure}
%% Single and double column figures respectively
\newenvironment{figure}
{\@float{figure}}
{\end@float}
\newenvironment{figure*}
{\@dblfloat{figure}}
{\end@dblfloat}
%%
%% End of Figures
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Tables
%%
%% Table counter
\newcounter{table}[chapter]
\renewcommand \thetable
{\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@table}
%% Floating parameters
\def\fps@table{tbp}
\def\ftype@table{2}
\def\ext@table{lot}
%% Generate number for caption
\def\fnum@table{\tablename\nobreakspace\thetable}
%% Single and double column tables respectively
\newenvironment{table}
{\@float{table}}
{\end@float}
\newenvironment{table*}
{\@dblfloat{table}}
{\end@dblfloat}
%%
%% End of Tables
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Captions for floating objects
%%
%% White space above and below caption
\newlength\abovecaptionskip
\newlength\belowcaptionskip
\setlength\abovecaptionskip{10\p@}
\setlength\belowcaptionskip{0\p@}
%% Called with caption number (e.g., "Figure 1.2:") and caption text
\long\def\@makecaption#1#2{%
\relsize{-1}% slightly smaller font size for figure/table captions
\vskip\abovecaptionskip
\sbox\@tempboxa{#1: #2}% % Measure the width of the caption
\ifdim \wd\@tempboxa >\hsize % Does it fit on one line?
#1: #2\par % Yes, normal paragraph
\else % No, center
\global \@minipagefalse
\hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
\fi
\vskip\belowcaptionskip}
%%
%% End of Captions for floating objects
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Import font definitions
\RequirePackage{hisfont}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Font changing
%%
\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
\DeclareRobustCommand*\cal{\@fontswitch\relax\mathcal}
\DeclareRobustCommand*\mit{\@fontswitch\relax\mathnormal}
%%
%% End of Font changing
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Table of contents, list of figures, and list of tables
%%
%% Name of TOC
% This hack is necessary as making uppercase of 'innehåll' as defined by
% package 'babel' will result in 'INNEHåLL'
\iflanguage{swedish}{%
% if language is Swedish
\addto\captionsswedish{\renewcommand{\contentsname}{INNEH{\AA}LL}%
}
}{%
% if language other than Swedish, let 'babel' do its magic
}
%% Levels of headings included in table of contents
\setcounter{tocdepth}{2}
%% Width of page numbers
\newcommand\@pnumwidth{1.55em}
%% Width of right margin
\newcommand\@tocrmarg{0em} % Flush right
%% Separation of dots (in mu units)
\newcommand\@dotsep{1.0}
%% Produce table of contents
\newcommand\tableofcontents{%
\chapter*{\MakeUppercase{\contentsname}% manual make-uppercase necessary, automatic upper-casing inside \chapter* does not work(?)
\@mkboth{%
\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
\@starttoc{toc}% % Make the actual toc
}
%% Format part entries in toc
%% Called with \numberline{<\thepart>}{<heading>} and <page>
\newcommand*\l@part[2]{%
\ifnum \c@tocdepth >-2\relax
\addpenalty{-\@highpenalty}%
\addvspace{2.25em \@plus\p@}% % Add some vertical space
\setlength\@tempdima{3em}% % Width of \numberline{<\thepart>}{<heading>}
\begingroup
\parindent \z@ \rightskip \@pnumwidth % No indent, room for page numbers
\parfillskip -\@pnumwidth % No overfull messages
{\leavevmode
% Large number and heading, and
% right flushed page number with osf
\bfseries #1\hfil \hb@xt@\@pnumwidth{\hss #2}}\par
\nobreak
\global\@nobreaktrue
\everypar{\global\@nobreakfalse\everypar{}}%
\endgroup
\fi}
%% Called with \numberline{<\thechapter>}{<heading>} and <page>
\newcommand*\l@chapter[2]{%
\ifnum \c@tocdepth >\m@ne
\addpenalty{-\@highpenalty}%
\vskip 1.0em \@plus\p@
\setlength\@tempdima{1.5em}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode \bfseries
\advance\leftskip\@tempdima
\hskip -\leftskip
#1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
\penalty\@highpenalty
\endgroup
\fi}
%% Format section entries in toc
%% Use definitions in latex.ltx
%% Called with \numberline{<\thesection>}{<heading>} and <page>
\newcommand*\l@section{\@dottedtocline{1}{1.5em}{2.3em}}
\newcommand*\l@subsection{\@dottedtocline{2}{3.8em}{3.2em}}
\newcommand*\l@subsubsection{\@dottedtocline{3}{7.0em}{4.1em}}
\newcommand*\l@paragraph{\@dottedtocline{4}{10em}{5em}}
%% Produce list of figures
\newcommand\listoffigures{%
\chapter*{\MakeUppercase{\listfigurename}}% manual make-uppercase necessary, automatic upper-casing inside \chapter* does not work(?)
\@mkboth{\MakeUppercase\listfigurename}%
{\MakeUppercase\listfigurename}%
\@starttoc{lof}% % Make the actual lof
}
%% Format figure entries in lof
\newcommand*\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}
%% Produce list of tables
\newcommand\listoftables{%
\chapter*{\MakeUppercase{\listtablename}}% manual make-uppercase necessary, automatic upper-casing inside \chapter* does not work(?)
\@mkboth{%
\MakeUppercase\listtablename}%
{\MakeUppercase\listtablename}%
\@starttoc{lot}% % Make the actual lot
}
%% Produce entry in lot
\let\l@table\l@figure
%%
%% End of Table of contents, list of figures, and list of tables
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Footnotes
%%
%% No rule above footnotes
\renewcommand\footnoterule{%
\kern-3\p@
\hrule\@width.4\columnwidth
\kern2.6\p@}
\@addtoreset{footnote}{chapter}
%% Format footnote
%% Called with text of footnote
\newcommand\@makefntext[1]{%
\parindent 1em%
\noindent
\hb@xt@1.8em{\hss\@makefnmark}#1}
%% Format the footnote markers that are printed in the text
%\def\@makefnmark{\hbox{\temfivespace\@textsuperscript{\normalfont\@thefnmark}}}
%%
%% End of Footnotes
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Initialization
%%
%% Distance between two columns in two column mode
\setlength\columnsep{10\p@}
%% Width of rule between two columns in two column mode
\setlength\columnseprule{0\p@}
%% Use headings as default pag style
\pagestyle{headings}
%% Arabic page numbers
\pagenumbering{arabic}
%%
%% End of Initialization
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\endinput
%%
%% End of file `his-thesis.cls'.