• No results found

The nddiss2ε class

N/A
N/A
Protected

Academic year: 2021

Share "The nddiss2ε class"

Copied!
38
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

The nddiss2ε class

2017-05-09

Abstract

The nddiss2ε class can be used to typeset dissertations submitted to the University of Notre Dame’s Graduate School. This class conforms with the Graduate School guidelines as of Spring 2013 for the layout of the Ph.D. dissertations and Master’s theses.

Contents

1 Introduction 2

1.1 Disclaimer . . . 2

1.2 Dependencies and Limitations . . . 2

1.3 History . . . 3 2 Quick Start 3 3 Usage 4 3.1 Options . . . 5 4 Arrangement of Contents 6 4.1 Title Page . . . 7 4.2 Copyright Page . . . 7 4.3 Abstract Page(s) . . . 8 4.4 Dedication . . . 8

4.5 Table of Contents; Lists of Figures and Tables . . . 8

(2)

5 Note For Authors 10 5.1 Tips and Suggestions . . . 11 5.2 You Found Errors? . . . 13

6 Other Packages Used 13

6.1 Generating PDF document . . . 14

7 The Implementation 15

1

Introduction

The LATEX 2ε document class nddiss2ε is suitable for producing dissertations and

theses conforming to the Spring 2013 guidelines of the Graduate School at the University of Notre Dame. The package is extends the standard LATEX book class.

The latest version of this class and related documentation can be found in a few places:

• On CTAN: https://ctan.org/pkg/nddiss • On GitHub: https://github.com/ndlib/nddiss

• On the University of Notre Dame’s Graduate School website: http:// graduateschool.nd.edu/

1.1

Disclaimer

While this class does as much formatting as it can, there are a few formatting items that you, the user, must do manually (see Section 5). Please keep in mind that only you are responsible for the correct formatting of your dissertation/thesis. Should you have questions, please consult the official formatting guide or email dteditor@nd.edu.

1.2

Dependencies and Limitations

This classfile depends on many other packages to be installed. All of these required packages are available through MiKTeX and TeXLive, and chances are good they are already installed by your TeX distribution. Refer to section 6 for a list of the essential packages.

The document class has only been tested with a small subset of available packages. There are numerous packages you may want to use for your work, but they may have to be modified accordingly. Things lacking include support for the subfigure and subcaption package and proper formatting of the captions in such an environment. Formatting of the captions could be much easier with the caption1 in general, and is a thing-to-do for future versions. Permitting use of the subfigure and subcaption packages would also be a good thing to do if an update is

(3)

ever made for reaosns other than resolving conflicts caused by changing Graduate School regulations. If you want to use a subfigure environment and don’t need the caption capabilities of the subcaption package, adding the following code to your preamble may allow you to do this and still have your captions formatted according to the Graduate School’s rules.

\usepackage{subcaption} \makeatletter

\renewcommand\LT@makecaption[3]{%

\LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\LTcapwidth{% \vskip\abovetableskip% \centering\normalspacing #1{#2 }\\[\single@skip] {#3}\par \endgraf\vskip\belowtableskip}% \hss}}} \makeatother

1.3

History

The nddiss2ε package is an extensive rewrite by Sameer Vijay of an earlier NDthe-sis class for formatting dissertations. Megan Patnott updated nddiss2ε to the 2013 Graduate School Formatting guidelines. The NDThesis class was by D. A. Peterson.

2

Quick Start

This section provides a template you can use to get started. The distribution comes with a more detailed file, template.tex, that is similar, but more detailed.

\documentclass[numrefs,final]{nddiss2e} \begin{document}

\frontmatter

\title{Title in Title Caps} \author{Your Name} \work{Dissertation} \degaward{Doctor of Philosophy} \advisor{} \department{} \maketitle

\makepublicdomain % There is also a copyright option \begin{abstract}

(4)

\end{abstract} % dedication is optional \begin{dedication} For Someone \end{dedication} \tableofcontents \listoffigures \listoftables

% list of symbols is optional \begin{symbols} \sym{a}{definition of a} \end{symbol} % preface is optional \begin{preface} Preface here \end{preface} \begin{acknowledge} Thanks to everyone \end{acknowledge} \mainmatter

\chapter{A New Dawn} % Chapter 1 All the text ...

\appendix

\chapter{Additional Data} % Appendix A \backmatter

\bibliographystyle{nddiss2e} \bibliography{bibdatabase} \end{document}

3

Usage

Invoke the nddiss2ε document class by adding \documentclass[hoptionsi]{nddiss2e} at the beginning of your LATEX source file. For most people the options

\documentclass[draft]{nddiss2e} is good enough for the initial revisions. If you want your figures to display, use \documentclass[review]{nddiss2e}.

(5)

sub-mitted version.

If you have two advisors, add the option twoadvisors here, and then use \secondadvisor{} later on the title page to give the name of the second advisor. By default, all documents produced using this class are formatted as one-sided, doublespaced, letter-sized pages, per the Graduate School requirements. In theory, the class file’s specifications should override your system’s defaults. If, however, you are getting A4 paper, try adding \pdfpagewidth{8.5in} and \pdfpageheight{11in} immediately after the \documentclass in your file.

3.1

Options

Exactly one of these options must be used. The draft and review options enable

draft review final

faster processing of the document and also include annotations to help write and edit it.

The draft option enables a fast processing and preliminary document showing the labels for citations, tables, figures etc. and a black solid rule highlighting the horizontal overflows. Additionally, figures are replaced with placement boxes showing where the included figure would be placed. Such a document would be the one you would prepare for revising your text during writing stages.

The review option makes it possible to prepare a document that is one step closer to the final version. Almost all the formatting of the final version is present, but the labels and keys as in the draft option are also displayed. A document prepared with the review option would be the one to personally check for proper formatting and possibly giving to your advisor if she wished to suggest corrections. The final option produces the document to be submitted to the Graduate School for formatting checks and as the final version.

The twoadvisors option will produce a title page with space for two advisors.

twoadvisors

Use the \secondadvisor macro command (discussed in Section 4.1) on the title page to give the name of the second advisor.

The noinfo option disables the information page produced when the review

noinfo

or final style options are used. It is recommended that you only use this option when making the final submission to the Graduate School.

These options determine how citations are displayed in the text. The default

numrefs

textrefs style is numrefs. The numrefs option produces a numbered citation sytle by using natbib and the “nddiss2e” or “nddiss2enoarticletitles” citation style file2.

The textrefs option changes the citation style to be similar to “author-date” style with the same files.

At most one of these options should be selected. The sort option will cause

sort compress sort&compress

both numerical and “author-date” style references to be sorted in the order that they appear in the bibliography when multiple references are cited. The compress option compresses numerical citations, e.g. it turns [1,2,3] into [1-3], and does nothing to “author-date” style references. The sort&compress option first sorts

2

(6)

and then compresses numerical references, and only sorts “author-date” style ref-erences.

Since the same set of packages and style files result in differing citation formats, refer to the documentation for natnotes.dvi in your TEXMF tree, to be aware of the various ways in which you can make a citation in your text.

These options adjust the font size of the body text. The choice is only

applica-10pt 11pt 12pt

ble when the draft option is used, and defaults to 10pt. When review or final is used, this option is ignored and 12pt is used.

The twoside option causes the class file to prepare a document meant to be

twoside

printed double-sided. This option is strictly for if you want to prepare a two-sided document for your own use. The only difference from the one-sided document is in the page layout. Do NOT use this option when preparing to submit it to the Graduate School.

The nocenter option allows non-centered chapter titles. Do NOT turn in your

nocenter

document this way to the Graduate School!

The openbib option formats your bibliography in the following manner:

openbib

Author

Article/book title Other information Website, if applicable

Usually you would not need to use this option since the default layout of the bibliography is acceptable.

4

Arrangement of Contents

A dissertation or a thesis document contains the following parts, in the order listed. Only those marked as optional may be omitted.

1. Title Page 2. Copyright page

3. Abstract (optional for Master’s thesis) 4. Dedication (optional)

5. Table of Contents 6. List of Figures 7. List of Tables

8. List of Symbols (optional) 9. Preface (optional)

(7)

12. Appendix (or Appendices) (optional) 13. Bibliography (or References, or Works cited)

The macros and environments described below ease the formatting of these parts.

4.1

Title Page

The title page is generated by \maketitle with no arguments. This macro has

\maketitle

been modified for providing a title page in the correct format.

You can set information to display on the title page by using the following commands before invoking \maketitle.

• The title of the document, using the \title macro. You may use linebreaks

\title{}

within the title, protected via \protect\\ and the title may be up to four lines long.

• Give your name in full and exactly as registered with the Graduate School,

\author{}

using the \author macro, e.g. \author{Gary Graham Gordon-Graeme}). • Whether the document is a Thesis or a Dissertation as the argument of the

\work{}

\work macro, e.g. \work{Dissertation}).

• Specify the degree you’re aiming for with the \degaward macro. Should

\degaward{}

be one of \degaward{Doctor of Philosophy} (without the “in subject ” or \degaward{Master of Science\\in\\Engineering}.

• Give the name of your advisor with the \advisor macro.

\advisor{}

• Give the name of your second advisor, if any, with the \secondadvisor

\secondadvisor{}

macro. You also need to pass in the twoadvisors option in the \documentclass declaration.

• Give the name of your department with the \department macro, e.g.

\department{}

\department{Gnulogical Engineering}).

• The month and year of the defense of the thesis with the \degdate

\degdate{}

e.g. \degdate{June 2004}). If you forget to declare this, the current month/year will be used.

4.2

Copyright Page

The \makecopyright macro should be invoked after \maketitle to produce a

\makecopyright \copyrightholder{} \copyrightyear{}

copyright page. Prior to calling \makecopyright, you may specify a different name for the copyright holder (the default is the name given through the \author macro) and for the copyright year (the default being the current year). Do this with the \copyrightholder{hnamei} and \copyrightyear{hyear i} macros.

Alternatively, you can use \makepublicdomain to produce a page with the

(8)

message “This document is in the public domain.” Note that the absence of the copyright page does not place your dissertaion in the public domain, you must declare it as such explicitly.

4.3

Abstract Page(s)

The abstract text should be placed between \begin{abstract} and \end{abstract}.

abstract

If the abstract is longer than one page, the environment will place the author’s name in the top-right header.

You may use \abstractname{htext i} to change the abstract caption to text.

\abstractname{}

Default name: Abstract. You probably don’t need to change it.

4.4

Dedication

The dedication is optional. If you want one, use the dedication envrionment. The

dedication

format of dedication is essentially free. This environment will center the text of your dedication vertically on the page.

You may use \dedicationname{htext i} to change the title for the dedication

\dedicationame{}

page. Default name: \mbox{} i.e. an empty title. You probably don’t need to change it.

4.5

Table of Contents; Lists of Figures and Tables

Use the macros \tableofcontents,\listoffigures and \listoftables, in this

\tableofcontents \listoffigures \listoftables

order, to produce the required table of contents and lists of figures and tables. You may use \contentsname, \listfigurename and \listtablename to

\contentsname{} \listfigurename{} \listtablename{}

change the titles for these sections. By default they are CONTENTS, FIGURES, and TABLES. You probably don’t need to change them.

4.6

List of Symbols

The list of symbols is optional. Use the symbols envrionment to format a list of

symbols

symbols/abbreviations used in your work. The envrionment takes an optional ar-gument specifying the desired format, e.g. \begin{symbols}[cl] for first column centered and the next column aligned left. By default, the first column will be right aligned and the second column will be left aligned. You may use any of the standard tabular column alignment options.

The command \sym{hsymbol i}{hdefinitioni} may make the task of entering

\sym{}{}

the symbols and their meanings in the symbols environment easier. \sym takes two arguments: the first, a math “object” and the second, the plain text describ-ing the symbol. Since the first argument is in math mode, any plain text needs to be wrapped with \mathrm{..} Likewise, any math symbol in the second argument

needs to placed in $..$. Example: \sym{\beta_\mathrm{norm}}{Definition for $\beta$} You may use \symbolsname{} to change the title of the symbols section.

De-\symbolsname{}

(9)

4.7

Preface

The preface environment is provided for formatting the preface to your work.

preface

You may use \prefacename to change the name of this section. Default name:

\prefacename{}

PREFACE.

4.8

Acknowledgments

The environment acknowledgments is used to format the acknowledgment chapter.

acknowledgments

You may use \acknowledgename to change the name of this section. Default

\acknowledgename{}

name: Acknowledgments.

4.9

Text

Use the macro \mainmatter to mark the beginning of your text. You can then use

\mainmatter

\part, \chapter, \section, \subsection, and \subsubsection commands, as you would with the book class. Text is formatted in \normalspacing i.e. double-spacing. The pages are numbered in plain pagestyle such that the page numbers are centered in the bottom. The chapter titles can be multi-line, and if so are formatted doubly spaced.

Use the macro \unnumchapter to create to create unnumbered chapters that

\unnumchapter{}

appear in the Table of Contents.

4.10

Appendix

Use the command \appendix after the last normal chapter to signal that all

\appendix

following chapters are to be appendices. This use is the same as in the book class. To begin an appendix, use the \chapter{htitlei} macro.

4.11

Backmatter

The \backmatter macro separates the bibliography, index and glossary from the

\backmatter

main matter and any appendices.

4.12

Bibliography

If you are using BibTEX (and why would you not want to use BibTEX?), use the

\bibliography

\bibliography{hbibfilei} macro to generate the bibliography. You should refer to BibTEX manual for details about making a .bib file and format for the entries. For citing references in the text, the package natbib is included with ei-ther the settings numbers,sort&compress (numrefs option) or authoryear,sort (textrefs option). The package natbib is a fantastic package that has numerous macros for citing in different ways.

Warning: The packages cite and citation are NOT compatible with the natbib package, and will cause errors if used.

If you are not using BibTEX make your own bibliography by using the

thebib-thebibliography

(10)

in the right format in your .tex source file itself. If you are using the textrefs option, you’ll need to consult the natbib manual to ensure that you enter your entries in the format required by the package.

You may use \bibname{hnewbibnamei} to change the name of this section.

\bibname{}

Default name: Bibliography.

4.13

Chapter-wise Bibliography

By default the bibliography appears at the end of your work and contains all the references from the entire entity. If you need to have a separate bibliography for each chapter, you can do it in the following way. First, load the package chapterbib without any options in the preamble of your main source file and redefine the commands \bibname and \bibsection as shown below.

%% Main source file %% \documentclass[...]{nddiss2e} \usepackage{chapterbib} \renewcommand{\bibname}{Cited works} \renewcommand{\bibsection}{\section{\bibname}} ... \begin{document} \include{chptr1} ... \include{appndx} \end{document}

To process the bibliography for each chapter individually, the chapters or sections must be separated into different files and include them in the main file, as shown above. Each such \included file must contain its own \bibliographystyle{nddiss2e} and \bibliography{...} command at an ap-propriate position. There should not be any bibliographic commands in the main source file.

After compiling the main tex file once (with latex or pdflatex), the .aux files needed by bibtex will have been created and you can then run bibtex on each of the separate source files to obtain a .bbl for each file. The remaining steps are the same as for a normal .tex file.

You can find more details of this in the natbib manual.

5

Note For Authors

The dissertation author must make sure that the following conditions are met in order to generate a dissertation acceptable by the Graduate School:

(11)

• Table captions must be above the corresponding table, In case of the table environment, this can be achieved by putting \caption before you include the table (e.g. in a tabular environment).

• Figure captions should be below the corresponding figure. In the figure envi-ronment, the \caption goes after the \includegraphics macro command. • The bibliography is the last section/chapter of the thesis—unless you are

using the chapter-wise bibliography.

5.1

Tips and Suggestions

• It is strongly recommended that you compile your document with pdfLATEX.

Compiling to dvi or postscript first may result in “fuzzy” fonts when viewing the document on your screen. Additionally, the benefits of hyperref and pdflscape are only available if you compile using pdfLATEX.

• Use the \toprule, \midrule and \bottomrule macro commands (from the booktabs package) in tables for generating the appropriate horizontal rules. Refrain from using vertical rules to separate columns in tables as much as possible.

• Use the longtable environment for handling very long tabular materials. Ex-ample:

\begin{longtable}{lc}

\caption[]{LONG TABLE CAPTION \label{tab:longtable} } \toprule

Heading 1 & Heading 2 \\ \midrule

\endfirsthead

\caption[]{ } \\ % doesn’t matter what text is in the continued caption. \midrule

Heading 1 & Heading 2 \\ \midrule

\endhead \endfoot \bottomrule \endlastfoot

% Now the tabular material % Long & Table etc. \\

\end{longtable}

• If a figure or table is very wide and will not fit on a page, use the landscape environment (from the included lscape package) to format them in land-scape mode. They will automatically appear on a separate page. If you use pdfLATEX to compile your document, then the included pdflscape package

(12)

• The sidewaystable environment (from the included rotating package) is in-compatible with the current class and should be avoided.

• Usually the width of the figure and table captions is 90% of the textwidth (i.e. 0.9\textwidth). If needed, the width can be changed on a case-by-case basis by doing one of the following:

– Use a minipage environment of appropriate width and enclose your tab-ular or figure float inside it, or

– set the \capwidth inside the table or the figure environment, and \LTcapwidth outside the longtable environment, e.g.,

\begin{table}[H] \setlength{\capwidth}{0.8\textwidth} \centering \caption{TABLE CAP\label{tab:this}} \begin{tabular}{lc} ... \end{tabular} \end{table} \setlength{\LTcapwidth}{6in} \begin{longtable}{lccc} ... \end{\longtable}

• Use the tabularx environment for the actual formatting of the tables (within the table environment). It differs slightly from tabular environment and you should refer to their documentation in the TEXMF tree for more information. • If you’ve used a longtable environment in your document, it might be neces-sary to compile the document multiple times so as to get proper alignment of columns. This is documented in the longtable manual.

• If you wish to use \footnotes in the longtable environment, please read its documentation. There are some handicaps present.

• To cite a website in your bibliography3, use the following format in your

.bib file:

@Misc{fairley2000,

author = "N. Fairley",

title = "Casa{XPS} {VAMAS} processing software", howpublished = "Website",

note = "\url{http://www.casaxps.com}", }

When processed with the nddiss2e.bst citation style file this gives: 111. N. Fairley. CasaXPS VAMAS processing software. Website. http: //www.casaxps.com.

(13)

5.2

You Found Errors?

Errors in a LATEX document are to be expected. If you have a problem that is

that seems to be more than a typo or unbalanced brace, it is possible that there is a conflict between the packages you have included and those that nddiss2ε uses. If you find yourself in that situtation, there is a mailing list for handling support issues with nddiss2ε. Look through the archive, and if there are no answers, please send an email to ND-LATEX-USERS@listserv.nd.edu (registration required). The more effort you spend in isolating the problem or in troubleshooting will make it more likely that others can reproduce the problem and help you solve it. Also if you have a problem that you then solve, please also email the list. Your doing so will help the next person to have that problem, and will also make the maintainers aware of it, so future versions of the class file can be better.

6

Other Packages Used

A number of packages are required by default and must be present in your TEX search path (if you use a package manager such as MiKTeX or TeXLive, it will take care of this for you). As far as possible, these have been tested for proper formatting style with the nddiss2ε class file. The list includes ifthen, exscale, ifpdf, ifluatex, ifxetex, xspace, longtable, indentfirst, tabularx, showkeys, enumerate, latexsym. epsfig, color, graphicx, url, setspace4, amsmath, float, lscape, rotating, booktabs, and natbib5. Sameer urges you to read the documentation of these

packages available in the TEXMF tree, if you think you might use their features or want to tweak some advanced options. Of these packages, ifpdf, longtable, natbib, booktabs, rotating, url, and setspace are not part of the LATEX required distribution,

so you may need to download them. They are all available through both MiKTeX and TeXLive; note that ifpdf is part of the oberdiek bundle, which is what you need to download to get that package if it is not already installed on your system. Other packages may or may not be appropriate for use with the nddiss2ε class when producing copies to be submitted to the Graduate School. Please be careful when using packages that change the default fonts, or the page layout.

In general, the official guidelines of the Graduate School are followed to the maximum extent possible. This includes proper formatting of the title page and the abstract page (from the ndthesis package), numbering of the pages in the frontmatter, generation of properly formatted table of contents, list of figures etc., as well as bibliography at the end. Per the guide, the number of different fonts and font sizes used is kept to a minimum. The contents, all lists and the bibliography are single-spaced but the inter-line spacing for the rest of the document is double.

(14)

6.1

Generating PDF document

The nddiss2ε class also allows production of pdf documents with pdfLATEX . As of

Spring 2013, this is the preferred method of compilation. In this case, the hyperref and pdflscape packages are also required. The hyperref package ensures that the generated pdf document contains internal as well as external links for citations and bookmarks. A document produced by this method also contains embedded fonts (press quality pdf) and is suitable for electronic submission to the library and for microfilm archiving. Although the most appropriate options for hyperref are passed on, for advanced features refer to its documentation. The pdflscape package flips pages with landscape orientation in the pdf file for easier reading, but the location of the page numbers does not change.

(15)

7

The Implementation

Following is our attempt at documenting the source of the nddiss2ε class file for the TEX hackers.

At the start, we define the base version of LATEX 2ε needed and the label information for

the nddiss2ε class.

1\NeedsTeXFormat{LaTeX2e}[1999/12/01] 2\ProvidesClass{nddiss2e}

3 [2016/10/16 v3.2016%

4 Notre Dame Dissertation document class] 5%

\dissfileversion \dissfiledate

The \dissfileversion and \dissfiledate macros contain the version and the date of the release.

6\providecommand{\dissfileversion}{3.2017.2} 7\providecommand{\dissfiledate}{2017/05/09} 8%

New boolean variables for the options used in nddiss2ε class are set here with default values. 9\newif\ifdiss@draft \diss@drafttrue 10\newif\ifdiss@review \diss@reviewfalse 11\newif\ifdiss@final \diss@finalfalse 12\newif\ifinfo@page \info@pagetrue 13\newif\ifadvisors@two \advisors@twofalse 14\newif\ifdiss@dedication \diss@dedicationfalse 15\newif\ifnum@refs \num@refstrue 16\newif\ifcentered@chaptitle \centered@chaptitletrue 17\newif\if@ltfirstcaption 18% draft review final

Exactly one of these options must be present in order to get a proper document. These options set appropriate boolean variables (flags) and pass some common options to the parent book class.

(16)

32 \typeout{FINAL MODE}\typeout{}\info@pagetrue% 33 \diss@draftfalse\diss@reviewfalse\diss@finaltrue 34 \PassOptionsToClass{12pt,letterpaper,oneside,final}{book} } 35% numrefs textrefs

The options numrefs or textrefs select the appropriate citation style i.e. “numbered” or “textual”, respectively. By choosing textrefs, one can get “author-date” style of citation in the text. The default is numrefs.

36\DeclareOption{numrefs}{

37 \typeout{NUMBERED REFERENCES}\num@refstrue} 38\DeclareOption{textrefs}{

39 \typeout{TEXTUAL REFERENCES}\num@refsfalse} The option nocenter allows non-centered chapter titles. 40\DeclareOption{nocenter}{\centered@chaptitlefalse} 41%

The openbib option is useful in creating indented bibliography. Usually you would not need to use this option since the default layout of the bibliography is very much acceptable.

42\DeclareOption{openbib}{%

43 \PassOptionsToPackage{openbib}{natbib} 44}

45%

The sort option is passed to natbib, and causes multiple citations to be listed in the sequence they appear in the bibliography.

46\DeclareOption{sort}{%

47 \PassOptionsToPackage{sort}{natbib} 48}

49%

The compress option is passed to natbib, and causes numerical citations to be compressed so that, e.g. 1,2,3 becomes 1-3. Does not also sort.

50\DeclareOption{compress}{%

51 \PassOptionsToPackage{compress}{natbib} 52}

53%

The sort&compress option sorts numerical citations, and then compresses them. 54\DeclareOption{sort&compress}{%

55 \PassOptionsToPackage{sort&compress}{natbib} 56}

57%

The other options are declared in the following lines.

twoadvisors The twoadvisors option sets the flag for modifying the layout of the title page. 58\DeclareOption{twoadvisors}{\typeout{TWO ADVISORS}\typeout{}% 59 \advisors@twotrue}

(17)

10pt 11pt 12pt

The options 10pt, 11pt or 12pt are passed on to the book class if appropriate, depending on whether the \diss@draft flag is set true.

61\DeclareOption{10pt}{% 62 \ifdiss@draft% 63 \PassOptionsToClass{10pt}{book}% 64 \else% 65 \OptionNotUsed% 66 \ClassWarningNoLine{nddiss2e}%

67 {Font size 10pt not allowed; using 12pt}% 68 \fi% 69} 70\DeclareOption{11pt}{% 71 \ifdiss@draft% 72 \PassOptionsToClass{11pt}{book}% 73 \else% 74 \OptionNotUsed% 75 \ClassWarningNoLine{nddiss2e}%

76 {Font size 11pt not allowed; using 12pt}% 77 \fi 78} 79\DeclareOption{12pt}{% 80 \PassOptionsToClass{12pt}{book}% 81} 82% 83\DeclareOption{noinfo}{\info@pagefalse} 84%

The twoside option is for when you want to prepare a two-sided document for your own use. The only difference from the one-sided document is in the page layout. This option is passed on to the parent book class.

85\DeclareOption{twoside}{\typeout{TWO SIDED DOCUMENT}% 86 \PassOptionsToClass{twoside}{book} }%

87%

All options other than those defined above are ignored and a warning is printed on the screen during compile-time. After processing all the options, the book class is loaded with the specified options.

88\DeclareOption*{\ClassWarning{nddiss2e}% 89 {UnknownOption ‘\CurrentOption’} }% 90\ProcessOptions\relax

91\LoadClass{book} 92%

At this stage, the packages ifthen, exscale, etoolbox ifpdf, ifluatex, ifxetex, longtable, xspace, indentfirst, tabularx, enumerate and latexsym are loaded. It is important to load these in a specific order so as not to cause conflicts in definitions of certain macros.

93\RequirePackage{ifthen,exscale,etoolbox} 94\RequirePackage{ifpdf,ifluatex,ifxetex}

(18)

97 PDF Output is required to support the PDF/A format.

98 }{DVI output is not supported. Use pdflatex to generate the dissertation.} 99} 100\RequirePackage[a-2b]{pdfx} 101\RequirePackage{longtable} 102\RequirePackage{threeparttable} 103\RequirePackage[flushleft]{threeparttablex} 104\RequirePackage{xspace} 105\RequirePackage{indentfirst} 106\RequirePackage{tabularx} 107\RequirePackage{enumerate} 108\RequirePackage{latexsym} 109\RequirePackage{textcase} 110%

If the \diss@final is set false (when using draft or review option) then the showkeys package is also loaded.

111% \ifdiss@final\relax\else\RequirePackage{showkeys}\fi 112%

Depending in whether you are using pdfLATEX or plain LATEX , epsfig, color and graphicx

are loaded with respective options.

113\ifboolexpr{bool{pdf} or bool{xetex} or bool{luatex}}{% 114 \RequirePackage{epsfig} 115 \RequirePackage{color} 116 \RequirePackage{graphicx} 117 \AtBeginDocument{ 118 \pdfadjustspacing=1 119 } 120}{% 121 \RequirePackage[dvips]{epsfig} 122 \RequirePackage[dvips]{color} 123 \RequirePackage[dvips]{graphicx} 124} 125%

Now the natbib package is loaded with its options, appropriate to numrefs or textrefs class option. If numrefs is specified, then natbib is read-in with its options for “numbered” references and sorted & compressed (eg. [3-6,8-10]). In this case, the default delimiter is square brackets and the default seperator is a comma. For the textrefs option, the natbib package is read-in so as to sort the references in an “author-date” style of citations. The default delimiter and seperator, in this case, are round brackets and colon, respectively. 126\ifnum@refs 127 \RequirePackage[numbers]{natbib} 128\else 129 \RequirePackage[authoryear]{natbib} 130\fi

Additionally, the packages amsmath, float, booktabs, rotating, url and setspace are loaded when (pdf)LATEX processes \begin{document}. Again, the order of these packages is

(19)

links in the document) is also loaded. The options for this package have been tested to produce a document which can be printed on laser printers without any problems because of colored link boxes. Megan added required package pdflscape, which is part of the oberdiek bundle in MiKTeX and TeXLive. Using this package will flip landscape pages on the screen so that it’s easier to read.

131\AtBeginDocument{ 132\RequirePackage{amsmath} 133\RequirePackage{float} 134\RequirePackage{booktabs} 135\RequirePackage{rotating} 136\RequirePackage{url} 137\RequirePackage[doublespacing]{setspace}[2000/12/01] 138\ifboolexpr{bool{pdf} or bool{xetex} or bool{luatex}}{% 139 \ifluatex 140 \RequirePackage[luatex]{pdflscape} 141 \else 142 \ifxetex 143 \RequirePackage[xetex]{pdflscape} 144 \else 145 \ifpdf 146 \RequirePackage{pdflscape} 147 \fi 148 \fi 149 \fi

150 % cannot use RequirePackage since pdfx also includes hyperref 151 \hypersetup{ 152 plainpages=false, 153 pdfpagelabels, 154 bookmarks=true,% 155 bookmarksnumbered=true,% 156 linktocpage=true,% 157 breaklinks=true,% 158 bookmarkstype=toc,% 159 colorlinks=false,% 160 pdfpagemode=UseOutlines} 161}{} 162} 163\RequirePackage{metalogo} 164%

Set the \pagestyle for the document to plain here and define default spacing. 165\AtBeginDocument{

166\pagestyle{plain} 167\normalspacing

168\typeout{Pagestyle and spacing normal} 169}

170%

Here, define some spacing macros for page layout and doublespacing. 171\newcommand{\normalspacing}{\doublespacing}

(20)

173\newcommand\double@baselinestretch{1.625} 174\newlength{\usedtextsize} 175\setlength{\usedtextsize}{\f@size pt} 176\newlength{\single@skip} 177\setlength{\single@skip}{\single@baselinestretch \usedtextsize} 178\newlength{\double@skip} 179\setlength{\double@skip}{\double@baselinestretch \usedtextsize} 180\setlength{\footnotesep}{\double@skip} 181%

Define new lengths for some variables for a proper layout of normal pages, pages with text and figures and pages with only floats. Note that although the geometry package is usually easier, when Megan tried to switch to that she discovered that something ends up overwriting it and, although the the showframe option showed that the margins were setting correctly, the text didn’t look like they were. So these length values are set to what geometry said they should be to get a 1.5 in left margin and 1 in margins on all other sides (we’ll use vspace commands later to get the 2 in top margin on pages where that’s needed). 182\setlength{\hoffset}{0pt} 183\setlength{\voffset}{0pt} 184\setlength{\topmargin}{-32pt} 185\setlength{\headsep}{20pt} 186\setlength{\marginparwidth}{47pt} 187\setlength{\marginparsep}{7pt} 188\setlength{\textheight}{648pt} 189\setlength{\textwidth}{432pt} 190\setlength{\oddsidemargin}{36pt} 191\setlength{\evensidemargin}{36pt} 192\setlength{\footskip}{30pt} 193% 194\setlength{\floatsep}{30pt} 195\setlength{\intextsep}{50pt} 196% 197\newcommand{\clearemptydoublepage}{\newpage{\pagestyle{empty}% 198 \cleardoublepage}} 199%

\nddiss Define the macro \nddiss that is the logo used in the titlepage and the stamp in the dissertation document. 200\DeclareRobustCommand{\nddiss}{% 201 \textsf{{\scshape nd}diss}\kern-0.03em% 202 2$_\mathsf{\textstyle\varepsilon}$} 203% \work \degaward \advisor \secondadvisor \department \degdate

Here define new macros for use in the dissertation title page. 204\renewcommand{\title}[1]{\def\@title{#1}}

205\newcommand{\work}[1]{\def\@work{#1}}

(21)

209 \newcommand{\secondadvisor}[1]{\def\@secondadvisor{#1}} 210\fi

211\newcommand{\department}[1]{\def\@department{#1}} 212\newcommand{\degdate}[1]{\def\@degdate{#1}} 213 \degdate{\ifcase\month\or

214 January\or February\or March\or April\or May\or June\or

215 July\or August\or September\or October\or November\or December\fi 216 \space\number\year}

217%

As a default, these macros have an empty arguement. Only the \degdate macro takes on the current month-year combination in the absence of any assignation.

218% Defaults are empty except the \degdate 219 \title{}

220 \author{} 221 \work{} 222 \degaward{} 223 \advisor{}

224 \ifadvisors@two \secondadvisor{} \fi 225 \department{}

226%

\@infopage Define \@infopage macro that will create a page which contains important information about the document and the version of nddiss2ε used etc. for the end-user and the proofreader along with a standard disclaimer and details of where to find documentation for the nddiss2ε class file. This information can be suppressed by specifying the “noinfo” option while invoking the nddiss2ε class.

227\DeclareRobustCommand{\@infopage}{ 228 \thispagestyle{empty}

229 \null\vspace*{\single@skip} 230 \begin{center}

231 This \@work\space \\ entitled \\ \MakeTextUppercase{\@title} \\ 232 typeset with \nddiss\ v%

233 \dissfileversion\ (\dissfiledate) % 234 on \today\space for\\ 235 \@author\\ 236 \end{center} 237 238 \normalfont\normalsize\singlespacing 239

240 \noindent This \LaTeXe\space classfile conforms to the 241 University of Notre Dame style guidelines as of Fall 242 2012. However it is still possible to generate a

243 non-conformant document if the instructions in the class 244 file documentation are not followed!

245

246 \begin{center}

247 \begin{minipage}{0.75\textwidth}

(22)

250 as well. Those guidelines override everything mentioned 251 about formatting in the documentation for

252 this \nddiss\space class file. 253 \end{minipage}

254 \end{center} 255

256 \noindent\itshape This page can be disabled by

257 specifying the ‘‘{\upshape\ttfamily noinfo}’’ option to the class invocation. 258 \upshape

259(i.e.,{\ttfamily{\textbackslash}documentclass[\ldots,noinfo]\{nddiss2e\}} 260)

261 \begin{center}

262 {\bfseries\large\singlespacing This page is \slshape NOT

263 \upshape part of the dissertation/thesis. It should be disabled before 264 making final, formal submission, but should be included in the version 265 submitted for format check.}

266 \end{center}

267 \normalsize\normalfont

268 \nddiss\ documentation can be found at these locations: 269 \begin{center} 270 \url{http://graduateschool.nd.edu} \\ 271 \url{https://ctan.org/pkg/nddiss} 272 \end{center} 273 274\vfill 275\normalfont\normalsize\normalspacing\eject} 276%

\maketitle Redefine the macro \maketitle to produce the information page as well as the actual title page of the dissertation.

277\renewcommand{\maketitle}{

278 \ifinfo@page\@infopage\else\relax\fi% 279 \clearemptydoublepage

280 \normalfont\normalsize\normalspacing

titlepage The structuring begins with checking the proper macros for obtaining correct formatting for the title page. If any of those are not defined, an error is issued and processing stopped. Most of the code for this was taken from the earlier ndthesis class and hence, the documentation is also picked from there.

281 \begin{titlepage}%

282\ifthenelse{\equal{\@work}{}}{\ClassError{nddiss2e}% 283 {The \protect\work\space macro is undefined.\MessageBreak 284 The title page may be incorrectly formatted.}%

285 {Specify \protect\work\space as Dissertation or Thesis}}{\relax} 286\ifthenelse{\equal{\@degaward}{}}{\ClassError{nddiss2e}%

287 {The \protect\degaward\space macro is undefined.\MessageBreak 288 The title page may be incorrectly formatted.}%

289 {Specify \protect\degaward\space. It defines the awarded degree% 290 (Ph.D., M.S., etc.)}}{\relax}

(23)

292 {The \protect\advisor\space macro is undefined.\MessageBreak 293 The title page may be incorrectly formatted.}%

294 {Spepcify \protect\advisor\space It is who signs your walking papers!}}{\relax} 295\ifthenelse{\equal{\@department}{}}{\ClassError{nddiss2e}%

296 {The \protect\department\space macro is undefined.\MessageBreak 297 The title page may be incorrectly formatted.}%

298 {Specify which \protect\department\space is awarding your degree?}}{\relax} 299\ifadvisors@two

300 \ifthenelse{\equal{\@secondadvisor}{}}{\ClassError{nddiss2e}% 301 {The \protect\secondadvisor\space macro is undefined.\MessageBreak 302 The title page may be incorrectly formatted.}%

303 {Use \protect\secondadvisor\space for your second advisor}}{\relax} 304\fi

305%

Now set up some skip registers to hold the inter-data spacing. The initial values will create a two-inch top margin for the title page, provided the title is only one line long. \skip1 is the primary internal spacing command; \skip2 is the spacing between the student’s name and the line for the first adviser to sign if there are two advisers and \skip3 is the spacing between the student’s name and the line for the adviser to sign if there is only one adviser; \skip4 controls the top margin. We’ll account for titles longer than one line in a bit . . .

306\skip1=2.1\double@skip 307\skip2=1.7\double@skip 308\skip3=2.7\double@skip 309\skip4=36pt

310%

If the author has two advisors, we need to do a little tweaking to the internal spacing. 311 \ifadvisors@two

312 \skip1=1.6\double@skip 313 \else\relax

314 \fi

The 2012 formatting guidelines require the title to be 2” from the top of page. If it’s more than one line long, we need to adjust the internal spacing:

315 \setbox0=\vbox{\MakeTextUppercase{\@title}} 316 \ifdim \ht0 > 3\double@skip

317 \advance \skip1 -.75\double@skip 318 \else 319 \ifdim \ht0 > 2\double@skip 320 \advance\skip1 -.5\double@skip 321 \else 322 \ifdim \ht0 > \double@skip 323 \advance\skip1 -.25\double@skip 324 \fi 325 \fi 326 \fi

(24)

but we check to see if it is two or three lines long. If so, we need to remove those extra lines from the internal spacing.

327 \setbox1=\vbox{\@degaward} 328 \ifdim \ht1 > 2\double@skip 329 \advance\skip1 -.5\double@skip 330 \else

331 \ifdim \ht1 > \double@skip

332 \advance \skip1 -.25\double@skip 333 \else

334 \relax

335 \fi 336 \fi

If we have two advisers, a three or four line title, and a three line degree field or two advisers, a four line title, and a two line degree field, then we need to remove some spacing between the name and the first adviser and from the top margin, and give that space to the internal spacing.

337 \ifadvisors@two

338 \ifdim \ht0 > 3\double@skip 339 \ifdim \ht1 > \double@skip

340 \advance \skip4 -.675\double@skip 341 \advance \skip2 -.4\double@skip 342 \advance \skip1 .25\double@skip 343 \else \relax

344 \fi

345 \else

346 \ifdim \ht0 > 2\double@skip 347 \ifdim \ht1 > 2\double@skip 348 \advance \skip2 -.4\double@skip 349 \advance \skip1 .1\double@skip

350 \else \relax 351 \fi 352 \else \relax 353 \fi 354 \fi 355 \else \relax 356 \fi

Finally we start putting the text in place . . . centered, of course. 357 \null\vspace*{\skip4}

358 \begin{center}%

359 \MakeTextUppercase{\@title} \par% 360 \vskip\skip1%

361%

Now skip the required vertical space, declare that this is for the University of Notre Dame, and list what degree has been earned.

362 A \@work \par% 363 \vskip\skip1%

(25)

366 in Partial Fulfillment of the Requirements \\

367 for the Degree of \par

368 \vskip\skip1%

369 \@degaward%

370 \vskip\skip1%

371 by \\%

372%

Now format the author’s name. 373 \@author

374%

Now skip the proper space and place the signature line for the advisor with his/her name typeset below it. This is accomplished by essentially centering a box that is twice as long as the required length of the signature line and placing the line in only the right-hand side. 375 \ifadvisors@two 376 \vskip\skip2 377 \hspace*{2.75in}\underline{\hspace{2.75in}}\\% 378 \hspace*{2.75in}\@advisor, Co-Director\\ 379 \else 380 \vskip\skip3 381 \hspace*{2.75in}\underline{\hspace{2.75in}}\\% 382 \hspace*{2.75in}\@advisor, Director\\ 383 \fi% 384%

If there is a second advisor, place that line here now. 385\ifadvisors@two % 386 \vskip\double@skip% 387 \hspace*{2.75in}\underline{\hspace{2.75in}}\\% 388 \hspace*{2.75in}\@secondadvisor, Co-Director\\ 389\fi 390%

We end with the department and date; the internal spacing is chosen so that these are at the page bottom.

391 \vskip\skip1%

392 Graduate Program in \@department \\% 393 Notre Dame, Indiana \\

394 \@degdate 395 \end{center} 396 \end{titlepage}% 397}

398%

copyrightpage The environment copyrightpage defines the defaults for proper formatting the copyright page (if opted).

399\newenvironment{copyrightpage}{% 400 \clearemptydoublepage

(26)

403 \null\vfil 404 \begin{center}\normalspacing}% 405{ \end{center}\vfil\null \clearpage } 406% \copyrightholder \copyrightyear

Define a few macros for defining the copyright holder and the year desired. By default, they are taken as the current year and the author of the dissertation.

407\newcommand{\@copyrightyear}{\the\year} 408\newcommand{\@copyrightholder}{\@author}

409\newcommand{\@copyrightlicense}{All Rights Reserved}

410\newcommand{\copyrightyear}[1]{\renewcommand{\@copyrightyear}{#1}} 411\newcommand{\copyrightholder}[1]{\renewcommand{\@copyrightholder}{#1}} 412\newcommand{\copyrightlicense}[1]{\renewcommand{\@copyrightlicense}{#1}} 413%

\makecopyright Finally, the \makecopyright macro creates the copyright page as per defined in the copyrightpage environment. 414\newcommand{\makecopyright}{% 415 \ifdiss@final 416 \begin{copyrightpage} 417 \normalfont\normalsize 418 \copyright\space Copyright by \\ 419 \@copyrightholder \\ 420 \@copyrightyear\\ 421 \@copyrightlicense \\[10mm] 422 \end{copyrightpage} 423 \fi 424}% 425%

\makepublicdomain Or, if chosen, \makepublicdomain macro creates a copyright page (using earlier copyrightpage environment) that puts the document in public domain.

426\newcommand{\makepublicdomain}{% 427 \ifdiss@final

428 \begin{copyrightpage}

429 This document is in the public domain. 430 \end{copyrightpage}

431 \fi 432}% 433%

(27)

440\renewcommand{\figurename}{Figure} 441\renewcommand{\partname}{Part} 442\renewcommand{\chaptername}{Chapter} 443\renewcommand{\appendixname}{Appendix} 444\renewcommand{\contentsname}{Contents} 445\renewcommand{\listfigurename}{Figures} 446\renewcommand{\listtablename}{Tables} 447\renewcommand{\bibname}{Bibliography} 448\renewcommand{\indexname}{Index} 449%

abstract This environment is adapted from the report class since the book class does not have one. Additionally, we add a \pdfbookmark for the abstract in the pdf document.

450\newenvironment{abstract}{%

451 \ifboolexpr{bool{pdf} or bool{xetex} or bool{luatex}}{% 452 \pdfbookmark[0]{\abstractname}{abstract}%abstract.0 453 }{}

454 \typeout{Abstract page(s)} 455 \renewcommand{\@oddfoot}{\@empty} 456 \renewcommand{\@evenfoot}{\@empty}

If the abstract extends to a second page, place the author’s name in top right corner of that page. Make sure it’s upright, as required by the University and that this appears at 0.7500from the top.

457 \let\@evenhead\@oddhead 458 \renewcommand{\@oddhead}{\hfil{\upshape\@author}} 459 \titlepage 460 \null 461 \begin{center} 462 \vspace*{36pt} 463 {\normalsize\mdseries \normalspacing 464 \MakeTextUppercase{\@title} \\[3.5ex] 465 \normalsize\abstractname \\ by \\ \@author\space}% 466 \@endparpenalty \@M 467 \end{center}\par}% 468{\par\vfil\null\endtitlepage} 469%

(28)

\tableofcontents The \tableofcontents macro is redefined to begin at page 2 if the dedication environ-ment does not exist. It is single-spaced.

479\renewcommand\tableofcontents{%

480 \ifdiss@dedication\relax\else\setcounter{page}{2}\fi 481 \chapter*{\contentsname}%

482 \ifboolexpr{bool{pdf} or bool{xetex} or bool{luatex}}{% 483 \pdfbookmark[0]{\contentsname}{contents}%contents.0 484 }{} 485 \singlespacing 486 \@starttoc{toc}% 487 \normalspacing 488 } 489% \listoffigures \listoftables

These macros are modified to add the \listfigurename and \listoftables to the Table of Contents. Both of these are also single spaced. The inter-entry spacing is changed by adding a \vskip after each entry. This is done in the figure and table environments later.

490\renewcommand\listoffigures{% 491 \chapter*{\listfigurename}%

492 \addcontentsline{toc}{chapter}{\listfigurename}% 493 \typeout{List of figures - \listfigurename} 494 \singlespacing 495 \@starttoc{lof}% 496 \normalspacing 497} 498% 499\renewcommand\listoftables{% 500 \chapter*{\listtablename}% 501 \addcontentsline{toc}{chapter}{\listtablename}% 502 \typeout{List of tables - \listtablename} 503 \singlespacing 504 \@starttoc{lot}% 505 \normalspacing 506} 507% preface acknowledgement

These environments are similar to the dedication environment. They are defined as \chapter*{} so they are not numbered and not added to Table of Contents and so, add that manually by using \addcontentsline.

(29)

518 \addcontentsline{toc}{chapter}{\acknowledgename}% 519}%

520{\par\null\clearpage}% 521%

\unnumchapter Allows the user to create unnumbered chapters that appear in the TOC. 522\newcommand\unnumchapter[1]{%

523 \chapter*{#1}%

524 \addcontentsline{toc}{chapter}{#1}} symbols

\sym

Define symbols environment which lays out it as a \chapter* and adds \symbolsname to the TOC. The environment is actually a horizontally centered longtable environment. To aid entry of a symbol and its definition, \sym macro command is also defined. 525\newcommand{\sym}[2]{\ensuremath{#1} & #2 \\} 526\newenvironment{symbols}[1][rl]{% 527 \typeout{Symbols page} 528 \chapter*{\symbolsname}% 529 \addcontentsline{toc}{chapter}{\symbolsname}% 530 \begin{center}\begin{longtable}{#1}}% 531{\end{longtable}\end{center}\par\null} 532%

Modify chapter definition in \@chapter to put the word “Chapter” (\@chapapp) in the Table of Contents. That is, now the TOC will contain “Chapter 1: First chapter” rather than “1. First chapter.” The rest of the format code is essentially the same as that in the book class.

533\def\@chapter[#1]#2{

534 \ifnum \c@secnumdepth >\m@ne 535 \if@mainmatter 536 \refstepcounter{chapter}% 537 \typeout{\MakeTextUppercase{\@chapapp\space\thechapter.}}% 538 \addcontentsline{toc}{chapter}% 539 {{\@chapapp\ \thechapter: #1}}% 540 \else 541 \addcontentsline{toc}{chapter}{#1}% 542 \fi 543 \else 544 \addcontentsline{toc}{chapter}{#1}% 545 \fi 546 \chaptermark{#1}% 547 \addtocontents{lof}{\protect\addvspace{10\p@}}% 548 \addtocontents{lot}{\protect\addvspace{10\p@}}% 549 \@makechapterhead{\MakeTextUppercase{#2}}% 550 \@afterheading }% 551%

Modify part definition in \@part and \@spart to keep the font size for part headings \normalsize and \mdseries. It is otherwise the same as in the book class.

552\def\@part[#1]#2{%

(30)

554 \refstepcounter{part}% 555 \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}% 556 \else 557 \addcontentsline{toc}{part}{#1}% 558 \fi 559 \markboth{}{}% 560 {\centering 561 \interlinepenalty \@M 562 \normalfont

563 \ifnum \c@secnumdepth >-2\relax

564 \normalsize\mdseries \partname\nobreakspace\thepart 565 \par 566 \vskip 20\p@ 567 \fi 568 \normalsize\mdseries \MakeTextUppercase{#2}\par}% 569 \@endpart} 570\def\@spart#1{% 571 {\centering 572 \interlinepenalty \@M 573 \normalfont 574 \normalsize\mdseries #1\par}% 575 \@endpart} 576%

Now format section headings to conform to the official guidelines.

\@makechapterhead First, modify the chapter heading label to be normalsize’d and centered. Instead of the bold-faced heading label, also make it \mdseries. If we are in the \mainmatter, we add “CHAPTER” and chapter number before actually putting the chapter name otherwise only the “chapter name” is put. Note that chapter/section headings must all be double-spaced.

577\renewcommand{\@makechapterhead}[1]{% 578 \vspace*{30pt}%

579 {\parindent \z@ \raggedright 580 \ifnum \c@secnumdepth >\m@ne 581 \normalfont\normalsize% 582 \if@mainmatter 583 \ifcentered@chaptitle\center\else\relax\fi% 584 \MakeTextUppercase{\@chapapp{} \thechapter}\par\nobreak 585 \fi 586 \fi 587 \interlinepenalty\@M 588 \ifcentered@chaptitle\center\else\relax\fi% 589 \mdseries{#1}\par\nobreak 590 \vskip 30\p@ 591 }} 592%

(31)

in a single-line, we copy the formatting for the chapter heading label (single-spacing) and make the spacing double again for the text.

593\renewcommand{\@makeschapterhead}[1]{% 594 \vspace*{30pt}% 595 {\parindent \z@ \raggedright 596 \normalfont\normalsize% 597 \interlinepenalty\@M 598 \ifcentered@chaptitle\center\else\relax\fi 599 \mdseries{\MakeTextUppercase{#1}}\par\nobreak 600 \vskip 30\p@ 601 }} 602%

Now, set the section labels to \mdseries rather than bold-faced. We also make sure that these are set in normal spacing, font and size. This is done for each of \section, \subsection, \subsubsection, \subsubsubsection, \paragraph and \subparagraph. 603\renewcommand\section{\suppressfloats[t]%

604 \@startsection {section}{1}{\z@}% 605 {-4.2ex \@plus -1ex \@minus -.2ex}% 606 {1.8ex \@plus.2ex}%

607 {\normalfont\normalsize\mdseries} } 608\renewcommand\subsection{\suppressfloats[t]% 609 \@startsection{subsection}{2}{\z@}% 610 {-3.9ex\@plus -1ex \@minus -.2ex}% 611 {1.2ex \@plus .2ex}%

612 {\normalfont\normalsize\mdseries} }

613\renewcommand\subsubsection{\suppressfloats[t]% 614 \@startsection{subsubsection}{3}{\z@}% 615 {-3.9ex\@plus -1ex \@minus -.2ex}% 616 {1.2ex \@plus .2ex}%

617 {\normalfont\normalsize\mdseries} } 618\renewcommand\paragraph{%

619 \@startsection{paragraph}{4}{\z@}% 620 {3.9ex \@plus1ex \@minus.2ex}% 621 {-1em}%

622 {\normalfont\normalsize\mdseries} } 623\renewcommand\subparagraph{%

624 \@startsection{subparagraph}{5}{\parindent}% 625 {3.9ex \@plus1ex \@minus .2ex}%

626 {-1em}%

627 {\normalfont\normalsize\mdseries} } 628%

\l@part Modify the macro \l@part that formats part titles in the contents-like files (.toc, .lof and .lot) by adding a \@dottedtocline macro. The indent width is set to 1.5em -to line up a continued line with the section number below it. We also leave less space between each part and the last section entry than the default and don’t change the font. 629\renewcommand*\l@part[2]{%

(32)

632 \setlength\@tempdima{1.5em}% 633 \begingroup 634 {\leavevmode 635 \@dottedtocline{1}{0pt}{\@tempdima}{#1}{#2} 636 }\par 637 \nobreak 638 \global\@nobreaktrue 639 \everypar{\global\@nobreakfalse\everypar{}}% 640 \endgroup 641 \fi} 642%

\l@chapter Modify the macro \l@chapter that formats chapter titles in the contents-like files (.toc, .lof and .lot) by adding a \@dottedtocline macro. The indent width is set to 1.5em - to line up a continued line with the section number below it. We also leave less space between each chapter and the last section entry than the default.

643\renewcommand*{\l@chapter}[2]{% 644 \addpenalty{-\@highpenalty}% 645 \setlength\@tempdima{1.5em}% 646 \begingroup \leavevmode 647 \@dottedtocline{1}{0pt}{\@tempdima}{#1}{#2} 648 \par 649 \penalty\@highpenalty 650 \endgroup 651} 652%

\thesubsubsection We increase the number of section-depth by 1 and force subsubsection entry in the TOC by increasing the \tocdepth. In addition, the label number of \subsubsection is defined to be similar to that for \subsection i.e. all arabic numerals.

653\addtocounter{secnumdepth}{1} 654\addtocounter{tocdepth}{1}

655\renewcommand{\thesubsubsection}{% 656 \thesubsection.\arabic{subsubsection}} 657%

quote Redefine the quote environment to be single-spaced instead of being same as the rest of the text. 658\renewenvironment{quote} 659 {\list{}{\rightmargin\leftmargin}% 660 \singlespacing 661 \item\relax} 662 {\endlist} 663%

itemize Redefine the itemize environment so that each item is single-spaced, but with a line of space between each item.

(33)

667 {\realitemize

668 \singlespacing}

669 {\endrealitemize

670 \doublespacing}

itemize

enumerate Redefine the enumerate environment so that each item is single-spaced, but with a line of space between each item. Note we need the optional argument in order to be compatible with the enumerate package

671\let\realenumerate\enumerate 672\let\endrealenumerate\endenumerate 673\renewenvironment{enumerate}[1][1.] 674 {\realenumerate[#1] 675 \singlespacing} 676 {\endrealenumerate 677 \doublespacing} enumerate

description Redefine the description environment so that each item is single-spaced, but with a line of space between each item.

678\let\realdescription\description 679\let\endrealdescription\enddescription 680\renewenvironment{description} 681 {\realdescription 682 \singlespacing} 683 {\endrealdescription 684 \doublespacing}

description Set some lengths that are used in the table and the figure environments. Note that we set the caption width (\capwidth) to be 90% of the \textwidth.

685\setlength\abovecaptionskip{20\p@} 686\newlength\capwidth 687\setlength{\capwidth}{0.90\textwidth} 688\newlength\abovetableskip 689\newlength\belowtableskip 690\newlength\abovefigureskip 691\newlength\belowfigureskip 692\setlength\abovetableskip\belowcaptionskip 693\setlength\belowtableskip\abovecaptionskip 694\setlength\abovefigureskip\abovecaptionskip 695\setlength\belowfigureskip\belowcaptionskip 696%

figure For the figure environment, first some skip lengths are set, then use \@makefigurecaption to format the captions instead of the default \@makecaption, since the layout is different for figure and the table environment. Further add a \vskip to each entry in .lof file so that the inter-caption spacing seems double-spaced.

697\renewenvironment{figure}{%

(34)

699 \setlength{\belowcaptionskip}{\belowfigureskip} 700 \let\@makecaption\@makefigurecaption

701 \@float{figure}}% 702 {%

703 \addtocontents{lof}{ {\vskip 0.4em} }% 704 \end@float%

705} 706%

\@makefigurecaption The \@makefigurecaption is defined to format the caption in a parbox with width equal to \capwidth and is formatted in single-spacing. The interline-spacing is then changed to double after the caption.

707\long\def\@makefigurecaption#1#2{% 708 \vskip\abovecaptionskip 709 \begin{center} 710 \parbox{\capwidth}{ 711 \centering\singlespacing 712 {#1}. {#2}%\par 713 \vskip\belowcaptionskip\normalspacing }% 714 \end{center} 715}% 716%

table After setting the above and below skip lengths, the table environment is set to be single spaced. However, to obtain double-spacing between the entries, redefine the \arraystretch to be equivalent to the \double@baselinestretch. This way, while there are double-spaced entries, the entry itself is single-spaced. Similar to that in \@makefigurecaption, a \vskip is added to each entry in the .lot file.

717\renewenvironment{table}[1][tbp]{% 718 \setlength{\abovecaptionskip}{\abovetableskip} 719 \setlength{\belowcaptionskip}{\belowtableskip} 720 \renewcommand{\arraystretch}{\double@baselinestretch} 721 \let\scaption\caption% 722 \renewcommand*{\caption}[2][]{% 723 \ifthenelse{\equal{##1}{}}{% 724 \def\shortcaption{##2}% 725 }{% 726 \def\shortcaption{##1}% 727 }% 728 \scaption[\shortcaption]{\MakeTextUppercase{##2}}% 729 }% 730 \let\@makecaption\@maketablecaption 731 \@float{table}[#1]% 732 \singlespacing% 733 }% 734 {%

735 \addtocontents{lot}{ {\vskip 0.4em} }% 736 \end@float%

(35)

\@maketablecaption The \@maketablecaption is defined similarly to \@makefigurecaption to have the table label and caption in separate lines and with normal-spacing (double-spaced).

739\long\def\@maketablecaption#1#2{ 740 \vskip\abovecaptionskip 741 \begin{center} 742 \makebox[\linewidth]{ 743 \parbox{\capwidth}{ 744 \centering\normalspacing 745 \MakeTextUppercase{#1}\\[\single@skip] 746 {#2}%\par 747 \vskip\belowcaptionskip }% 748 }% 749 \end{center} 750} 751%

\longtable Similar to the table environment, the longtable environment is made singly-spaced but the \arraystretch is made equal to double the baselinestretch.

752\renewcommand\longtable{% 753 \singlespacing 754 \renewcommand{\arraystretch}{\double@baselinestretch} 755 \begingroup 756 \@ltfirstcaptiontrue 757 \@ifnextchar[\LT@array{\LT@array[x]}} 758%

\endlongtable This bit is taken from longtable.sty. In order to obtain double-spacing in the list of tables, a \vskip of 0.4em is added to .lot file.

759\renewcommand\endlongtable{% 760 \crcr 761 \noalign{% 762 \let\LT@entry\LT@entry@chop 763 \xdef\LT@save@row{\LT@save@row}}% 764 \LT@echunk 765 \LT@start 766 \unvbox\z@ 767 \LT@get@widths 768 \if@filesw 769 {\let\LT@entry\LT@entry@write\immediate\write\@auxout{% 770 \gdef\expandafter\noexpand 771 \csname LT@\romannumeral\c@LT@tables\endcsname 772 {\LT@save@row}}}% 773 \fi 774 \ifx\LT@save@row\LT@@save@row 775 \else

776 \LT@warn{Column \@width s have changed\MessageBreak

777 in table \thetable}%

778 \LT@final@warn 779 \fi

(36)

781 \addtocontents{lot}{ {\vskip 0.4em} }% 782 \endgroup 783 \global\@mparbottom\z@ 784 \pagegoal\vsize 785 \endgraf\penalty\z@\addvspace\LTpost 786 \ifvoid\footins\else\insert\footins{}\fi 787} 788%

\LT@makecaption For the longtable environment, the \LTcapwidth is set equal to \capwidth. In order to obtain consistent table captions, the command \LT@makecaption is modified in a similar manner as \maketablecaption.

789\setlength{\LTcapwidth}{\capwidth} 790\renewcommand\LT@makecaption[3]{%

791 \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\LTcapwidth{% 792 \vskip\abovetableskip% 793 \centering\normalspacing 794 \if@ltfirstcaption 795 #1{\MakeTextUppercase{#2} }\\[\single@skip] 796 \MakeTextUppercase{#3}\par 797 \else%

798 #1{\MakeTextUppercase{#2 (continued)} }\par

799 \fi

800 \global\@ltfirstcaptionfalse 801 \endgraf\vskip\belowtableskip}% 802 \hss}}}

803%

\timenow This macro is used in making the \draftheader and \reviewheader below. It outputs time in HH:MM format.

804\newcommand\timenow{%

805 \@tempcnta=\time \divide\@tempcnta by 60 \number\@tempcnta:\multiply 806 \@tempcnta by 60 \@tempcntb=\time \advance\@tempcntb by -\@tempcnta 807 \ifnum\@tempcntb <10 0\number\@tempcntb\else\number\@tempcntb\fi} 808%

\diss@header This header is used in the dissertation document when the draft or review option is used. These headers serve as a note for the date and time of the document compilation. 809\newcommand{\diss@header}{%

810 \ifdiss@review Review \else Draft \fi document [\today\/ at \timenow\/]

811 }%

812%

The header prepared above is put in the document by modifiying the plain and empty pagestyles except when the final option is chosen.

813\ifdiss@final

814 \renewcommand{\ps@plain}{

815 \renewcommand{\@oddhead}{\@empty}

(37)

818 \let\@evenfoot\@oddfoot 819 }% 820\else 821 \renewcommand{\ps@plain}{ 822 \renewcommand{\@oddhead}{\framebox[\textwidth]{ 823 \centering\footnotesize\tt\diss@header}}% 824 \renewcommand{\@oddfoot}{\hfil\textrm{\thepage}\hfil} 825 \let\@evenhead\@oddhead 826 \let\@evenfoot\@oddfoot 827 }% 828 \renewcommand{\ps@empty}{ 829 \renewcommand{\@oddhead}{\framebox[\textwidth]{ 830 \centering\footnotesize\tt\diss@header}}% 831 \renewcommand{\@oddfoot}{\@empty} 832 \let\@evenhead\@oddhead 833 \let\@evenfoot\@oddfoot 834 }% 835\fi 836%

\bibsection By redefining \bibsection macro, add the \bibname to the table of contents and as a chapter heading for the bibliography.

837\renewcommand{\bibsection}{ 838 \chapter*{\bibname}%

839 \addcontentsline{toc}{chapter}{\bibname}% 840}%

841%

\bibfont Changed the \bibfont macro to obtain single-spacing within each bibliographic entry. Between different entries, it is still \normalspacing. In addition, when the numrefs option is selected, the \@biblabel is redefined to number the bibliographic entries as 1. xxxx instead of the default [1] xxxx.

842\renewcommand{\bibfont}{\singlespacing} 843\ifnum@refs

844 \renewcommand{\@biblabel}[1]{\hfill#1.\hfill} 845\fi

846%

Lastly, after the bibliography in the final document, add a framed box which contains a blurb about the typesetting program and nddiss2ε version used for preparing the dissertation document. 847\ifdiss@final 848\AtEndDocument{ 849 \vfill 850 \centering\singlespacing 851 \framebox[0.85\textwidth]{ 852 \begin{minipage}{0.80\textwidth}\footnotesize%

853 \centering \itshape This document was prepared \& typeset with 854 \upshape

(38)

856 \LuaLaTeX 857 \else\ifxetex 858 \XeLaTeX 859 \else\ifpdf 860 pdf\LaTeX 861 \else 862 \LaTeXe 863 \fi\fi\fi 864 \itshape , and

865 formatted with \upshape\nddiss\xspace\itshape classfile 866 (v\dissfileversion [\dissfiledate]) 867 \end{minipage} } 868 \clearpage} 869\else\relax\fi 870% 871% \endinput

872% End of file ‘nddiss2e.cls’.

Change History

v0.98

General: Initial beta version . . . 1 v1.0

Release: First release . . . 1 v1.1

General: Minor changes and

clean-up . . . 1 v2.0

General: Some bugfixes, cleaned some of documentation . . . 1 v2.1

General: More bugfixes, changes in documentation . . . 1 v3.0

Release: Major revamp and clean-up of the code, added numrefs and textrefs to allow different kinds of citation styles, added some more macros and modified others, changed the titlepage a bit, completed source

documentation . . . 1 v3.2013

Release: Some bug fixes, minor changes in documentation, and

addition of support for parts. -MP . . . 1 v3.2013β

Release: Initial release of updates in order to comply with the Graduate School’s current formatting regulations and to take advantage of some LaTeX package updates. Should be functional, and has been approved by the

Dissertation/Thesis editors, but has not undergone wide-scale testing. - Megan Patnott . . . 1 v3.2016

Release: Fix natbib/showkeys

ordering bug . . . 1 v3.2017.1

Release: Display (CONTINUED) on multipage long table

captions . . . 1 v3.2017.2

Referenties

GERELATEERDE DOCUMENTEN

This means that items of the first level will be at the current margin and that the progressive indentation will start at the second item.. Thus the previous example could have

Its features include simplicity of use, compatibility with L A TEX, large sans serif font as default, extra macros to start foils with bold headings and special mechanisms to

These are commands that are called with the current option path and argument, and are used for example to declare new options (e.g. .new choice), to change the environment (e.g.

Using this option without a value keeps the document class indentation unchanged, if it is specified with a value then that value is used. If the package is loaded without this

The pgfopts package allows keys defined with pgfkeys to be used as class or package options, in the same way that kvoptions extends keyval.. Users of pgfopts should be familiar with

A guard line is a line that begins with the two characters ‘%&lt;’; guards are used to structure the set of code lines so that docstrip can extract different code lines to

For long section headings to wrap around within the TOC, we need to take the hyperref option linktocpage, unless pdflatex or xelatex are used.. 1.1 Now is the time for all good men

As we have mentioned above this version of the greek option of the babel package supports the use of Greek numerals. The commands \greeknumeral and \Greeknumeral produce the