-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMSUstyle.cls
1844 lines (1579 loc) · 51.3 KB
/
MSUstyle.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
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%% Updated and maintained by Prof. Mark Owkes [email protected]
%%
%% ---------------------- Origional Header ----------------------------
%%
%% MSUstyle.cls was created and edited by Seth Humphries in Jun-2007 and
%% last update 21-Nov-2009
%% Copyright (c) 2007,2008, 2009 Seth HD. umphries
%% This work is licensed under the Creative Commons
%% Attribution-Noncommercial-Share Alike 3.0 License. To view a copy
%% of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/;
%% or, (b) send a letter to Creative Commons, 171 2nd Street, Suite
%% 300, San Francisco, California, 94105, USA.
%%
%% The above copyright notice and this permission notice shall be incuded
%% in all copies or substantial portions of the Software.
%%
%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
%% OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
%% MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
%% IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
%% CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
%% TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
%% SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
%%%%%%%%%%%% IDENTIFICATION %%%%%%%%%%%%
\newcommand{\MSUstyleversion}{2.0}% current version number
\newcommand{\MSUstyleupdated}{2023/08/24}% date of last change(s)
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{MSUstyle}
[\MSUstyleupdated\space\MSUstyleversion\space(Montana State Graduate School)]%
\RequirePackage{calc}% part of LaTeX tools bundle
\RequirePackage[plain]{algorithm}
\RequirePackage{algorithmic}
\RequirePackage{ccicons}
%%%%%%%%%%%% INITIAL CODE %%%%%%%%%%%%
\widowpenalty=500 % Try to avoid widows at bottom of page
\clubpenalty=1000 % No orphans at top of page
\brokenpenalty=999 %no hyphenations at page breaks
\hyphenpenalty=1000 %no hyphenation at end of lines
\tolerance=1000 %adjust to make the above penalties tighter or looser
\raggedbottom
%% Switch for testing draft mode (toggled by ``draft'' option).
\newif\if@draft
\@draftfalse % initially false by default
%% Switch for testing current page style.
\newif\if@tcpage
% no default value (set by \pagestyle)
% indicates that page numbers are in the upper corners
%% Switch for alternative chapter headings (toggled by ``altchapter'' option).
\newif\if@altchapter
\@altchapterfalse % initially false by default
%% Switch for big inner margins (toggled by ``bigmargin'' option).
\newif\if@bigmargin
\@bigmarginfalse % initially false by default
%% Switches for appendices
\newif\ifAppendmultiple
\Appendmultiplefalse % initially false by default
\newif\ifAppendsingle
\Appendsinglefalse % initially false by default
%% Switches for Creative Commons copyright
\newif\ifCopyrightcc
\Copyrightccfalse % initially false
%% Because of the draft option, and to allow users to override
%% defaults, we don't want to be passing conflicting options back to
%% the report class, so we define our own temporary toggles holding
%% the most recent setting for each of four basic options: point size,
%% number of page sides, whether new chapters open on right-hand pages
%% or on any page, and line spacing. These toggles will be set from
%% the corresponding options below.
%
\newcommand{\@thesisptsz}{}
\newcommand{\@thesisside}{}
\newcommand{\@thesisopen}{}
\newcommand{\@thesislnsp}{}
%% the next couple commands are used to switch between
%% differences in theses and dissertations
\newcommand{\perm}{}
\newcommand{\degree}{}
\newcommand{\degreetype}{}
% \setlength{\intextsep}{14pt}
%%%%%%%%%%%% OPTION DECLARATION %%%%%%%%%%%%
%% ``draft'' option: change default document settings.
\DeclareOption{draft}{\@drafttrue
\typeout{MyThesis Class Option: ``draft''}
\ExecuteOptions{11pt,oneside,openany,doublespaced,normalmargins}
\PassOptionsToClass{draft}{report}
%% Macros for printing "DRAFT" at the corners of a page.
\newcommand{\tlDRAFT}%
{\raisebox{ 3ex}[0pt][0pt]{\sffamily\scriptsize \llap{DRAFT\ V}ersion \@draftver}}
\newcommand{\trDRAFT}%
{\raisebox{ 3ex}[0pt][0pt]{\sffamily\scriptsize DRAFT\ V\rlap{ersion \@draftver}}}
\newcommand{\blDRAFT}%
{\raisebox{-3ex}[0pt][0pt]{\sffamily\scriptsize \llap{DRAFT\ V}ersion \@draftver}}
\newcommand{\brDRAFT}%
{\raisebox{-3ex}[0pt][0pt]{\sffamily\scriptsize DRAFT\ V\rlap{ersion \@draftver}}}
}%DeclareOption{draft}
%% ``altchapter'' option: use alternative chapter headings
\DeclareOption{altchapter}{\@altchaptertrue}
\DeclareOption{numberedsections}{\@altchaptertrue}
%% ``bigMargin'' options: use 1.5" inner margins
\DeclareOption{bigmargin}{\@bigmargintrue}
%% Point Size options: change current setting.
\DeclareOption{10pt}{\renewcommand{\@thesisptsz}{10pt}}
\DeclareOption{11pt}{\renewcommand{\@thesisptsz}{11pt}}
\DeclareOption{12pt}{\renewcommand{\@thesisptsz}{12pt}}
\DeclareOption{13pt}{\renewcommand{\@thesisptsz}{13pt}}
%% Number of Page Sides options: change current setting.
\newif\if@twoside
\@twosidefalse % initially false by default
\DeclareOption{twoside}{\renewcommand{\@thesisside}{twoside} \@twosidetrue}
\DeclareOption{oneside}{\renewcommand{\@thesisside}{oneside}}
%% New Chapter Openings options: change current setting.
\DeclareOption{openany}{\renewcommand{\@thesisopen}{openany}}
\DeclareOption{openright}{\renewcommand{\@thesisopen}{openright}}
%% Line Spacing options: change current setting.
\DeclareOption{singlespaced}{\renewcommand{\@thesislnsp}{1}}
\DeclareOption{oneandahalfspaced}{\renewcommand{\@thesislnsp}{1.25}}
\DeclareOption{doublespaced}{\renewcommand{\@thesislnsp}{1.66}}
\DeclareOption{thesis}{\renewcommand{\perm}{\@thesisPermission}%
\renewcommand{\degree}{\@thesisD}%
\renewcommand{\degreetype}{\@thesisDT}%
}
\DeclareOption{dissertation}{\renewcommand{\perm}{\@dissertationPermission}%
\renewcommand{\degree}{\@dissertationD}%
\renewcommand{\degreetype}{\@dissertationDT}%
}
\DeclareOption{compexam}{\renewcommand{\degree}{\@dissertationD}%
\renewcommand{\degreetype}{\@compexam}%
}
% Appendix option
\DeclareOption{appendsingle}{\Appendsingletrue}
\DeclareOption{appendmultiple}{\Appendmultipletrue}
%% Copyright options
\DeclareOption{copyrightcc}{\Copyrightcctrue}
%% All other options are passed to the base class directly.
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}
%%%%%%%%%%%% OPTION EXECUTION %%%%%%%%%%%%
%% Default settings.
\ExecuteOptions{12pt,letterpaper,oneside,%
openright,doublespaced,normalmargins,dissertation,final}
%
\ProcessOptions
%%%%%%%%%%%% PACKAGE LOADING %%%%%%%%%%%%
%% Load base class using current setting for basic options.
\LoadClass[\@thesisptsz,\@thesisside,\@thesisopen]{report}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%% MAIN CODE %%%%%%%%%%%%
%%% phantomsection, texorpdfstring, and pdfbookmark are needed if you do
%%% not compile via pdflatex. !!!!!!!!!
% \newcommand{\phantomsection}{}% helps with hyperref. \phantomsection
% is provided by pdflatex, but not latex.
% \newcommand{\texorpdfstring}[2]{#1}%
% \def\pdfbookmark[#1]#2#3{}%
%%%%%%
\newcommand{\ignore}{} %used to comment out parts of latex
\newcommand{\comment}{} %used to comment out parts of latex
%%%%%% Line Spacing
%
%% \linespacing is used to define the default line spacing.
%% for the entire document. If the argument is less than
%% 1.25 (for 1.5-spaced) a warning message is displayed
%% when not in draft mode.
%%
%% Don't use this command for temporary, localized changes.
%% Instead, use the ``spacing environments'':
%% \begin{singlespaced} ...\end{singlespaced}
%% \begin{oneandahalfspaced}...\end{oneandahalfspaced}
%% \begin{doublespaed} ...\end{doublespaced}
%% \begin{longquote} ...\end{longquote}
%% \begin{longquotation} ...\end{longquotation}
%% \begin{newspacing}{x.xx} ...\end{newspacing}
\newcommand{\linespacing}[1]{%
\gdef\@spacing{#1}
\newlinestretch{#1}\if@draft\else\ifdim #1pt < 1.25pt\typeout
{MyThesis Class Warning: line spacing less than 1 1/2}\fi\fi
}
%
%% ``longquote'' and ``longquotation'' produce single-spaced quotes, while
%% ``newspacing'' encloses paragraphs with a different line spacing,
%% such as ``singlespaced'', ``oneandahalfspaced'', or ``doublespaced''.
\newenvironment{longquote}%
{\begin{quote}\newlinestretch{1}}{\end{quote}}
\newenvironment{longquotation}%
{\begin{quotation}\newlinestretch{1}}{\end{quotation}}
\newenvironment{singlespaced}%
{\begin{newspacing}{1}}{\end{newspacing}}
\newenvironment{oneandahalfspaced}%
{\begin{newspacing}{1.5}}{\end{newspacing}}
\newenvironment{doublespaced}%
{\begin{newspacing}{2}}{\end{newspacing}}
\newenvironment{newspacing}[1]%
{\par\begingroup\newlinestretch{#1}}%
{\par\vskip\parskip\vskip\baselineskip\endgroup
\vskip-\parskip\vskip-\baselineskip}
%
%% To change the actual line spacing.
\newcommand{\newlinestretch}[1]%
{\renewcommand{\baselinestretch}{#1}\currenttextsize}
%
%% To keep track of the current text size.
\let\currenttextsize=\normalsize
%
%% Redefine size-changing commands to update \currenttextsize.
\let\tmp@tiny=\tiny
\renewcommand{\tiny}%
{\let\currenttextsize=\tmp@tiny\tmp@tiny}
\let\tmp@scriptsize=\scriptsize
\renewcommand{\scriptsize}%
{\let\currenttextsize=\tmp@scriptsize\tmp@scriptsize}
\let\tmp@footnotesize=\footnotesize
\renewcommand{\footnotesize}%
{\let\currenttextsize=\tmp@footnotesize\tmp@footnotesize}
\let\tmp@small=\small
\renewcommand{\small}%
{\let\currenttextsize=\tmp@small\tmp@small}
\let\tmp@normalsize=\normalsize
\renewcommand{\normalsize}%
{\let\currenttextsize=\tmp@normalsize\tmp@normalsize}
\let\tmp@large=\large
\renewcommand{\large}%
{\let\currenttextsize=\tmp@large\tmp@large}
\let\tmp@Large=\Large
\renewcommand{\Large}%
{\let\currenttextsize=\tmp@Large\tmp@Large}
\let\tmp@LARGE=\LARGE
\renewcommand{\LARGE}%
{\let\currenttextsize=\tmp@LARGE\tmp@LARGE}
\let\tmp@huge=\huge
\renewcommand{\huge}%
{\let\currenttextsize=\tmp@huge\tmp@huge}
\let\tmp@Huge=\Huge
\renewcommand{\Huge}%
{\let\currenttextsize=\tmp@Huge\tmp@Huge}
%
%%%%%% Front Matter Parameters
%
%% The following commands set the respective field values so we
%% can generate the title page, copyright page, permissions page
%% and signature page automatically
%
\renewcommand{\author}[1]%
{\ifx\empty#1\empty\else\gdef\@author{#1}\fi}
\renewcommand{\title}[1]%
{\ifx\empty#1\empty\else\gdef\@title{#1}\fi}
\newcommand{\departmentchair}[1]%
{\ifx\empty#1\empty\else\gdef\@departmentchair{#1}\fi}
\newcommand{\committeechair}[1]%
{\ifx\empty#1\empty\else\gdef\@committeechair{#1}\fi}
\newcommand{\graduatedean}[1]%
{\ifx\empty#1\empty\else\gdef\@graduatedean{#1}\fi}
\newcommand{\department}[1]%
{\ifx\empty#1\empty\else\gdef\@department{#1}\fi}
\newcommand{\degreetitle}[1]%
{\ifx\empty#1\empty\else\gdef\@degreetitle{#1}\fi}
\newcommand{\copyrightyear}[1]%
{\ifx\empty#1\empty\else\gdef\@copyrightyear{#1}\fi}
\newcommand{\submitdate}[1]%
{\ifx\empty#1\empty\else\gdef\@submitdate{#1}\fi}
\newcommand{\thesisPermission}[1]%
{\ifx\empty#1\empty\else\gdef\@thesisPermission{#1}\fi}
\newcommand{\dissertationPermission}[1]%
{\ifx\empty#1\empty\else\gdef\@dissertationPermission{#1}\fi}
\newcommand{\thesisD}[1]%
{\ifx\empty#1\empty\else\gdef\@thesisD{#1}\fi}
\newcommand{\dissertationD}[1]%
{\ifx\empty#1\empty\else\gdef\@dissertationD{#1}\fi}
\newcommand{\thesisDT}[1]%
{\ifx\empty#1\empty\else\gdef\@thesisDT{#1}\fi}
\newcommand{\dissertationDT}[1]%
{\ifx\empty#1\empty\else\gdef\@dissertationDT{#1}\fi}
\newcommand{\draftver}[1]%
{\ifx\empty#1\empty\else\gdef\@draftver{#1}\fi} %draft version
\newcommand{\name}[1]%
{\ifx\empty#1\empty\else\gdef\name{#1}\fi} %name
\newcommand{\keys}[1]%
{\ifx\empty#1\empty\else\gdef\keys{#1}\fi} %name
\newcommand{\DocTitle}[1]%
{\ifx\empty#1\empty\else\gdef\DocTitle{#1}\fi} %name
\newcommand{\OWNwebpage}[1]%
{\ifx\empty#1\empty\else\gdef\OWNwebpage{#1}\fi} %name
%
%% bibliography databases
%
\newcommand{\bibfiles}[1]%
{\ifx\empty#1\empty\else\gdef\@bibfiles{#1}\fi}
%
%% default values of private functions
%
\def\@title{\DocTitle}
\def\@author{\name}
\def\@bibfiles{}
\def\@committeechair{}
\def\@departmentchair{}
\def\@department{}
\def\@degreetitle{}
\def\@graduatedean{}
\def\@submitdate{\ifcase\the\month\or
January\or February\or March\or April\or May\or June\or
July\or August\or September\or October\or November\or December\fi
\space \number\the\year}
\def\@gradyear{2008}
\def\@copyrightyear{\number\the\year}
\def\@bibfiles{}
\def\@draftver{}
\def\@thesisDT{thesis} %degree type
\def\@thesisD{Master of Science} %degree
\def\@dissertationDT{dissertation} %degree type
\def\@dissertationD{Doctor of Philosophy} %degree
\def\@compexam{comprehensive exam}
\def\@dissertationPermission{In presenting this dissertation in partial fulfillment of the requirements for a doctoral degree at Montana State University, I agree that the Library shall make it available to borrowers under rules of the Library. I further agree that copying of this dissertation is allowable only for scholarly purposes, consistent with ``fair use'' as prescribed in the U.S. Copyright Law. Requests for extensive copying or reproduction of this dissertation should be referred to ProQuest Information and Learning, 300 North Zeeb Road, Ann Arbor, Michigan 48106, to whom I have granted ``the exclusive right to reproduce and distribute my dissertation in and from microform along with the non-exclusive right to reproduce and distribute my abstract in any format in whole or in part.''}
\def\@thesisPermission{In presenting this thesis in partial fulfullment of the requirements for a master's degree at Montana State University, I agree that the Library shall make it available to borrowers under rules of the Library. \newline \indent If I have indicated my intention to copyright this thesis by including a copyright notice page, copying is allowable only for scholarly purposes, consistent with ``fair use'' as prescribed in the U.S. Copyright Law. Requests for permission for extended quotation from or reproduction of this thesis in whole or in parts may be granted only by the copyright holder.}
%% Switch for printing copyright notice on titlepage
%
\newif\ifcopyright
\copyrightfalse % initially false by default
%% Switch for generating a title page
%
\newif\iftitlepage
\titlepagetrue % initially true by default
%% Switch for generating a signature page
%
\newif\ifsignaturepage
\signaturepagefalse % initially false by default
%% Switch for generating a list of figures
%
\newif\iffigurespage
\figurespagetrue % initially true by default
%% Switch for generating a list of tables
%
\newif\iftablespage
\tablespagetrue % initially true by default
%% Switch for generating a list of tables
%
\newif\ifalgorithmspage
\algorithmspagetrue % initially true by default
%% Switch for generating a table of contents
%
\newif\ifcontentspage
\contentspagetrue % initially true by default
%% Switch for generating a bibliography
%
\newif\ifbibpage
\bibpagetrue % initially true by default
\newif\ifAppend %if there is no appendix the ref page has different look
\Appendfalse % initially false by default
\ifAppendsingle \Appendtrue \fi
\ifAppendmultiple \Appendtrue \fi
%% \settocdepth - use this to change how "deep" to number
%% in the table of contents for different sections; e.g.
%% subsubsections for chapters, then switch to chapter-only
%% for appendices.
%% tocdepth is reset to the value in \setchaptertocdepth
%% at each \chapter{}, or to the value in \setappendixtocdepth
%% at each \chapter{} after the \appendix command. So, if
%% you want to change the defaults, use \setchaptertocdepth and
%% \setappendixtocdepth. To temporarily change depth for the
%% current section, use a different function: \settocdepth[x].
%% You should never need to call \setcounter{tocdepth}{..}
%% directly.
%%
%% 0 = chapter only
%% 1 = chapter + sections
%% 2 = chapter, section, subsection
%% 3 = chapter, section, subsection, subsubsection
%
\newcommand{\settocdepth}[1]{%
\addtocontents{toc}{\protect\setcounter{tocdepth}{#1}}}
\newcommand{\setlotdepth}{%
\addtocontents{lot}{\protect\setcounter{tocdepth}{1}}}
\newcommand{\setlofdepth}{%
\addtocontents{lof}{\protect\setcounter{tocdepth}{1}}}
\newcommand{\setappendixtocdepth}[1]{%
\def\appendix@tocdepth{#1}}
\newcommand{\setchaptertocdepth}[1]{%
\def\chapter@tocdepth{#1}}
\setchaptertocdepth{3} %call above function and set it
\setcounter{secnumdepth}{0}
\newcommand{\setfrontpagestyle}[1]{%
\gdef\front@pagestyle{#1}}
\newcommand{\setbodypagestyle}[1]{%
\gdef\body@pagestyle{#1}}
\newcommand{\setbackpagestyle}[1]{%
\gdef\back@pagestyle{#1}}
% note that MT is the postal abreviation for Montana. go MSU!
% dummy commands to prevent recursion errors...
\newcommand{\MTcontentsname}{}
\newcommand{\toccontentlinestring}{}
\newcommand{\tocpdfbookmarkstring}{}
\newcommand{\MTlistfigurename}{}
\newcommand{\lofcontentlinestring}{}
\newcommand{\lofpdfbookmarkstring}{}
\newcommand{\MTlisttablename}{}
\newcommand{\lotcontentlinestring}{}
\newcommand{\lotpdfbookmarkstring}{}
\newcommand{\MTlistalgorithmname}{}
\newcommand{\loacontentlinestring}{}
\newcommand{\loapdfbookmarkstring}{}
\newcommand{\settocstring}[1]{%
\renewcommand{\MTcontentsname}{#1}
\renewcommand{\contentsname}{\MakeUppercase{#1}}
\renewcommand{\toccontentlinestring}{%
\texorpdfstring{\MakeUppercase{#1}}{#1}
}
\renewcommand{\tocpdfbookmarkstring}{#1}
}
\newcommand{\setlofstring}[1]{%
\renewcommand{\MTlistfigurename}{#1}
\renewcommand{\listfigurename}{\MakeUppercase{#1}}
\renewcommand{\lofcontentlinestring}{%
\texorpdfstring{\MakeUppercase{#1}}{#1}
}
\renewcommand{\lofpdfbookmarkstring}{#1}
}
\newcommand{\setlotstring}[1]{%
\renewcommand{\MTlisttablename}{#1}
\renewcommand{\listtablename}{\MakeUppercase{#1}}
\renewcommand{\lotcontentlinestring}{%
\texorpdfstring{\MakeUppercase{#1}}{#1}
}
\renewcommand{\lotpdfbookmarkstring}{#1}
}
\newcommand{\setloastring}[1]{%
\renewcommand{\MTlistalgorithmname}{#1}
\renewcommand{\listalgorithmname}{\MakeUppercase{#1}}
\renewcommand{\loacontentlinestring}{%
\texorpdfstring{\MakeUppercase{#1}}{#1}
}
\renewcommand{\loapdfbookmarkstring}{#1}
}
%% bookmark names
\settocstring{Table of Contents}
\setlotstring{List of Tables}
\setlofstring{List of Figures}
\setloastring{List of Algorithms}
%%%%%% Page Styles
%
% redefinition of tcplain to meet MSU requirements (top center page numbering)
\if@twoside % if two-sided printing
\newcommand{\ps@tcplain}{%
\@tcpagetrue%
\let\@mkboth\markboth%
\def\@oddfoot{%
\if@draft%
\blDRAFT\hfil%
{\slshape\small\today}\hfil\brDRAFT%
\fi%
}%
\let\@evenfoot\@oddfoot%
\def\@oddhead{%
\if@draft\tlDRAFT\fi%
\hfil\thepage\hfil%
\if@draft\trDRAFT\fi%
}%
\def\@evenhead{%
\if@draft\tlDRAFT\fi%
\hfil\thepage\hfil%
\if@draft\trDRAFT\fi%
}%
}%ps@tcplain
\else % if one-sided printing
\newcommand{\ps@tcplain}{%
\@tcpagetrue%
\let\@mkboth\markboth%
\def\@oddfoot{%
\if@draft%
\blDRAFT\hfil%
{\slshape\small\today}\hfil\brDRAFT%
\fi%
}%
\def\@oddhead{%
\if@draft\tlDRAFT\fi%
\hfil\thepage\hfil%
\if@draft\trDRAFT\fi%
}%
}%ps@tcplain
\fi % @twoside
% ========================= %
% Document Layout %
% ========================= %
%% Set margins
\setlength{\headsep}{\baselineskip}
\newlength\newtop \newtop=1in
% Top of number should be at 1 in (add height of 1 line)
\addtolength{\newtop}{\baselineskip}
% Top header also includes headsep (distance between number and top of text
\addtolength{\newtop}{\headsep}
% Define all margins
\if@bigmargin%
\def\margingeom{inner=1.5in,outer=1.0in,top=\newtop,bottom=1.0in,headsep=\headsep}
\else%
\def\margingeom{inner=1.0in,outer=1.0in,top=\newtop,bottom=1.0in,headsep=\headsep}
\fi%
% Set margins using geometry package (showframe for debugging)
%\RequirePackage[\margingeom,showframe]{geometry}
\RequirePackage[\margingeom]{geometry}
% Margins used for preliminary pages
\newlength\prelheadsep \prelheadsep=\headsep
\newlength\preltop \preltop=\newtop
\addtolength{\prelheadsep}{3\baselineskip}
\addtolength{\preltop}{3\baselineskip}
\if@bigmargin%
\def\marginprel{inner=1.5in,outer=1.0in,top=\preltop,bottom=1.0in,headsep=\prelheadsep}
\else%
\def\marginprel{inner=1.0in,outer=1.0in,top=\preltop,bottom=1.0in,headsep=\prelheadsep}
\fi%
% Margins used for LOF, LOT, and LOA (extra line for headings)
\newlength\listheadsep \listheadsep=\headsep
\newlength\listtop \listtop=\newtop
\addtolength{\listheadsep}{5\baselineskip}
\addtolength{\listtop}{5\baselineskip}
\if@bigmargin%
\def\marginlist{inner=1.5in,outer=1.0in,top=\listtop,bottom=1.0in,headsep=\listheadsep}
\else%
\def\marginlist{inner=1.0in,outer=1.0in,top=\listtop,bottom=1.0in,headsep=\listheadsep}
\fi%
% Default line spacing: use current setting from options.
\linespacing{\@thesislnsp}
%% Default indent
\setlength\parindent{5ex}
%% Adjust the vertical spacing between the main text and the notes,
%% and between successive notes if they are not single-spaced.
\setlength{\skip\footins}{.75\baselineskip}
%
%% \flushbottom looks silly with lots of extra space between paragraphs
%% better to put the "extra" space at the bottom of the page!
\raggedbottom
%
%% Default page style.
\pagestyle{tcplain}
\setfrontpagestyle{tcplain}
\setbodypagestyle{tcplain}
\setbackpagestyle{tcplain}
\if@altchapter
\AtBeginDocument{\protect{\setcounter{secnumdepth}{4}}}
\else
\AtBeginDocument{\protect{\setcounter{secnumdepth}{0}}}
\fi
\RequirePackage{setspace}
\renewenvironment{table}
{\setlength\abovecaptionskip{6\p@}%
\setlength\belowcaptionskip{2\p@}%
\@float{table}}
{\end@float}
\renewenvironment{figure}
{\setlength\abovecaptionskip{2\p@}%
\setlength\belowcaptionskip{6\p@}%
\@float{figure}}
{\end@float}
\renewenvironment{algorithm}
{\setlength\abovecaptionskip{2\p@}%
\setlength\belowcaptionskip{6\p@}%
\@float{algorithm}}
{\end@float}
% ========================= %
% Contents Pages %
% ========================= %
%
%% All this junk is for handling the spacing in the TOC, LOF, and LOT.
%
\newlength{\MT@tocentryskip@value}
\newlength{\MT@beforepartskip@value}
\newlength{\MT@beforechapskip@value}
\newlength{\MT@beforesecskip@value}
\newlength{\MT@beforesubsecskip@value}
\newlength{\MT@beforesubsubsecskip@value}
\newlength{\MT@beforeparaskip@value}
\newlength{\MT@beforesubparaskip@value}
\newlength{\MT@beforefigskip@value}
\newlength{\MT@beforetableskip@value}
\def\set@MTtocskip#1{%
\setlength{\MT@tocentryskip@value}{#1}
% set base lengths
\setlength{\MT@beforepartskip@value}{2\MT@tocentryskip@value}
\setlength{\MT@beforechapskip@value}{1.5\MT@tocentryskip@value}
\setlength{\MT@beforesecskip@value}{0in}
\setlength{\MT@beforesubsecskip@value}{0in}
\setlength{\MT@beforesubsubsecskip@value}{0in}
\setlength{\MT@beforeparaskip@value}{0in}
\setlength{\MT@beforesubparaskip@value}{0in}
\setlength{\MT@beforefigskip@value}{\MT@tocentryskip@value}
\setlength{\MT@beforetableskip@value}{\MT@tocentryskip@value}
% add glue
\addtolength{\MT@beforepartskip@value}{\z@ \@plus\p@}
\addtolength{\MT@beforechapskip@value}{\z@ \@plus\p@}
\addtolength{\MT@beforesecskip@value}{\z@ \@plus.2\p@}
\addtolength{\MT@beforesubsecskip@value}{\z@ \@plus.2\p@}
\addtolength{\MT@beforesubsubsecskip@value}{\z@ \@plus.2\p@}
\addtolength{\MT@beforeparaskip@value}{\z@ \@plus.2\p@}
\addtolength{\MT@beforesubparaskip@value}{\z@ \@plus.2\p@}
\addtolength{\MT@beforefigskip@value}{\z@ \@plus.2\p@}
\addtolength{\MT@beforetableskip@value}{\z@ \@plus.2\p@}
}
\set@MTtocskip{10pt}
\renewcommand{\appendix}{%
\ifAppendmultiple % Appendices page if multiple appendices
\if@openright
\cleardoublepage
\else
\clearpage
\fi
\quad \vspace{2.5in}\par
\begin{center}
\MakeUppercase{APPENDICES}
\end{center}
\thispagestyle{\back@pagestyle}
\phantomsection
\protect{\addcontentsline{toc}{chapter}{APPENDICES}}
\if@openright
\cleardoublepage
\else
\clearpage
\fi
\fi
\renewcommand{\@chapapp}{\MakeUppercase{\appendixname}}
\thispagestyle{tcplain}% Do NOT use the \back@pagestyle macro here
\settocdepth{\appendix@tocdepth}
\setcounter{chapter}{0}%
\setcounter{section}{0}%
\def\thechapter{\@Alph\c@chapter}
\def\chapapp@tocdepth{\expandafter\appendix@tocdepth}
\def\chapapp@chapter{\app@chapter}
\def\chapapp@schapter{\app@schapter}
\renewcommand{\thesection}{\thechapter.\@arabic\c@section}
\phantomsection%
}
% Define TOC Appendix Headings
\ifAppendmultiple
\def\app@chapter[#1]#2{%
\ifnum \c@secnumdepth > \m@ne
\refstepcounter{chapter}%
\protect{\addcontentsline{toc}{section}{\texorpdfstring%
{\MakeUppercase{\@chapapp}\space\protect\numberline{\thechapter}\hspace{-0.18in} : \space#1}%
{APPENDIX\space\thechapter : \space#1}}% end addcontentsline
} %end protect
\else
\addcontentsline{toc}{section}{\MakeUppercase{#1}}%
\fi
\protect{\chaptermark{#1}}%
\if@twocolumn
\@topnewpage[\@makeapphead{#2}]%
\else
\@makeapphead{#2}%
\@afterheading
\fi
%\vfill \quad
%\clearpage
}
\else % Only 1 appendix -> no indent in TOC
\def\app@chapter[#1]#2{%
\ifnum \c@secnumdepth > \m@ne
\refstepcounter{chapter}%
\protect{\addcontentsline{toc}{chapter}{\texorpdfstring%
{\MakeUppercase{\@chapapp}: \space#1}%
{APPENDIX: \space#1}}% end addcontentsline
} %end protect
\else
\addcontentsline{toc}{chapter}{\MakeUppercase{#1}}%
\fi
\protect{\chaptermark{#1}}%
\if@twocolumn
\@topnewpage[\@makeapphead{#2}]%
\else
\@makeapphead{#2}%
\@afterheading
\fi
%\vfill \quad
%\clearpage
}
\fi
% Define Appendix heading pages
\ifAppendmultiple
\def\@makeapphead#1{%
{ \parindent \z@ \raggedright \normalfont
\quad \vspace{2.5in}\par
\begin{center}
\underline{\MakeUppercase{\appendixname}\space \thechapter}
\end{center}
\par\nobreak
\vskip 0\p@
\interlinepenalty\@M
\begin{doublespaced}
\centering \MakeUppercaseWithNewline{#1}\par\nobreak
\end{doublespaced}
\clearpage
}
}
\else
\def\@makeapphead#1{%
{ %\parindent \z@ \raggedright \normalfont
\begin{doublespaced}
\centering \MakeUppercase{\appendixname}: \MakeUppercaseWithNewline{#1}
\end{doublespaced}
\vskip 30\p@ %\vskip 0.3in
}
}
\fi
\setappendixtocdepth{3}
\renewcommand\@dotsep{0.2} %%dot separation in TOC, LOT, LOF and LOA
\renewcommand*\l@chapter[2]{% this changes spacings in the TOC
\ifnum \c@tocdepth >\m@ne
\addpenalty{-\@highpenalty}%
\addvspace{\MT@beforechapskip@value}%
\setlength\@tempdima{1.5em}% was 1.5em is just right
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode
\advance\leftskip\@tempdima
\hskip -\leftskip
#1\nobreak\normalfont\normalcolor
\leaders\hbox{$\m@th
\mkern \@dotsep mu\hbox{.}\mkern \@dotsep
mu$}\hfill
\nobreak
% \hb@xt@\@pnumwidth{\hss #2} %this extends dots to pg#width away from pg #
\hfil #2 %extend all way to pge # per dge desires.
\par
\penalty\@highpenalty
\endgroup
\addvspace{\MT@beforechapskip@value}%
\fi}
% Maximum width of a TOC/LOC/LOF entry before a linebreak occurs (actually the min cline width)
\renewcommand{\@pnumwidth}{1in}
\renewcommand{\@tocrmarg}{1.5in}
\newcommand*{\MT@dottedtocline}[5]{%
\ifnum #1>\c@tocdepth \else
\addvspace{\MT@@toclineskip}
{\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
\parindent #2\relax\@afterindenttrue
\interlinepenalty\@M
\leavevmode
\@tempdima #3\relax
\advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
{#4}\nobreak
\leaders\hbox{$\m@th
\mkern \@dotsep mu\hbox{.} \mkern \@dotsep
mu$}\hfill
\nobreak
\hfil\normalfont \normalcolor #5%
% \hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor #5}%
\par
}%
\fi}
% TOC spacing before (and after number if it exists)
\if@altchapter % Alt tiltes (with numbers)
\renewcommand*\l@section{%
\let\MT@@toclineskip=\MT@beforesecskip@value
\MT@dottedtocline{1}{1em}{2.1em}}
\renewcommand*\l@subsection{%
\let\MT@@toclineskip=\MT@beforesubsecskip@value
\MT@dottedtocline{2}{2.7em}{2.8em}}
\renewcommand*\l@subsubsection{%
\let\MT@@toclineskip=\MT@beforesubsubsecskip@value
\MT@dottedtocline{3}{4.9em}{3.0em}}
\else % Standard titles (no numbers)
\renewcommand*\l@section{%
\let\MT@@toclineskip=\MT@beforesecskip@value
\MT@dottedtocline{1}{1.6em}{1.8em}}
\renewcommand*\l@subsection{%
\let\MT@@toclineskip=\MT@beforesubsecskip@value
\MT@dottedtocline{2}{3.8em}{2.0em}}
\renewcommand*\l@subsubsection{%
\let\MT@@toclineskip=\MT@beforesubsubsecskip@value
\MT@dottedtocline{3}{6.0em}{3.0em}}
\fi
\renewcommand*\l@paragraph{%
\let\MT@@toclineskip=\MT@beforeparaskip@value
\MT@dottedtocline{4}{10.5em}{5em}}
\renewcommand*\l@subparagraph{%
\let\MT@@toclineskip=\MT@beforesubparaskip@value
\MT@dottedtocline{5}{12.5em}{6em}}
% LOF, LOT, LOA spacing before and after number
\renewcommand*\l@figure{%
\let\MT@@toclineskip=\MT@beforefigskip@value
\MT@dottedtocline{1}{0.5in}{2.0em}}
\let\l@table\l@figure % Same for table and algorithm
\let\l@algorithm\l@figure
\newlength{\MT@tmpa}
%\RequirePackage{geometry}
\newcommand{\do@tablespage}{%
\iftablespage
\if@openright\cleardoublepage\else\clearpage\fi
% must clear page here, so that phantomsection\addcontentsline is on the correct page
\phantomsection%
\pdfbookmark[0]{\lotpdfbookmarkstring}{Tables}%
\settoheight{\MT@tmpa}{A}
\set@MTtocskip{\MT@tmpa}
{\newlinestretch{1}
% Define headers
\def\conheadmark{\listhead{List of Tables -- Continued}{Table}}
\def\firheadmark{\listhead{List of Tables}{Table}}
% Set pagestyle to continued
\pagestyle{continued}
% Setup header spacing
\expandafter\newgeometry\expandafter{\marginlist}
% Header on first page
\thispagestyle{firstpage}
% List of Tables
\newlinestretch{1.0}%
\@starttoc{lot}
% End of list
\clearpage
% Remove header spacing & reset pagestyle
\restoregeometry
\pagestyle{\front@pagestyle}
}
\newpage
\fi
}
\newcommand{\do@figurespage}{%
\iffigurespage
\if@openright\cleardoublepage\else\clearpage\fi
% must clear page here, so that phantomsection\addcontentsline is on the correct page
\phantomsection%
\pdfbookmark[0]{\lofpdfbookmarkstring}{Figures}%
\settoheight{\MT@tmpa}{A}
\set@MTtocskip{\MT@tmpa}
{\newlinestretch{1}
% Define headers
\def\conheadmark{\listhead{List of Figures -- Continued}{Figure}}
\def\firheadmark{\listhead{List of Figures}{Figure}}
% Set pagestyle to continued
\pagestyle{continued}
% Setup header spacing
\expandafter\newgeometry\expandafter{\marginlist}
% Header on first page
\thispagestyle{firstpage}
% List of Figures
\newlinestretch{1.0}%
\@starttoc{lof}
% End of list
\clearpage
% Remove header spacing & reset pagestyle
\restoregeometry
\pagestyle{\front@pagestyle}
}
\newpage
\fi
}
\newcommand{\do@algorithmspage}{%
\ifalgorithmspage
\if@openright\cleardoublepage\else\clearpage\fi
% must clear page here, so that phantomsection\addcontentsline is on the correct page
\phantomsection%
\pdfbookmark[0]{\loapdfbookmarkstring}{Algorithms}%
\settoheight{\MT@tmpa}{A}
\set@MTtocskip{\MT@tmpa}
% {\newlinestretch{1}
% Define headers
\def\conheadmark{\listhead{List of Algorithms -- Continued}{Algorithm}}
\def\firheadmark{\listhead{List of Algorithms}{Algorithm}}
% Set pagestyle to continued
\pagestyle{continued}
% Setup header spacing
\expandafter\newgeometry\expandafter{\marginlist}
% Header on first page