University of Utah Dissertation Class
From charlesreid1
Contents
- 1 University of Utah Dissertation Class
- 2 Introduction
- 3 Usage Guide
- 4 Document Settings
- 5 Files
- 6 Debugging
- 6.1 Specific Issues
- 6.1.1 Title should be double-spaced
- 6.1.2 Fix spacing between chapter and quote, or quote and text, to be triple space
- 6.1.3 Spaces between words on wrapped section headers are stretched too wide
- 6.1.4 Fix the big dumb spaces that occur between enumerated or itemized lists
- 6.1.5 Figures should be placed as soon as possible
- 6.1.6 Make bibliography double-spaced between entries and single-spaced within entries
- 6.1.7 Redefine quotation environment to be single spaced
- 6.1.8 Fix equation spacing
- 6.1.9 Add a triple space before Sections and Subsections, but double space between consecutive Sections and Subsections
- 6.1.10 Don't break words in section headers
- 6.1.11 Fix bibliography and abstract headings to be 2" from top (was only 1" from top)
- 6.1.12 Fix page numbering to match style guide
- 6.1.13 Appendix should appear in the table of contents with only the appendix title (no section or subsection listing)
- 6.1.14 Figures should not be, but are, placed in middle of text
- 6.1.15 Triple space needed between title heading and section heading (and quotes)
- 6.1.16 Need 2 or more lines underneath subheads at bottom of pages
- 6.1.17 2 or more lines required to be under a subheading at beginning/end of page
- 6.1 Specific Issues
University of Utah Dissertation Class
Note that the use of the words thesis and dissertation are treated as interchangeable in this document.
This document describes how to utilize the University of Utah Dissertation Class to write your University of Utah dissertation in LyX. The procedure described has been confirmed to work on both Windows and Mac.
You can download the class file here:
You can download the layout file here:
- File:Myuuthesis.layout.txt (note that you have to rename .layout.txt to .layout, because mediawiki is stupid)
Introduction
This document assumes you have a working knowledge of both TeX/LaTeX and LyX, and a working, up-to-date copy installed on your system. At the time of this writing, that was LyX 2.0.1. See http://www.lyx.org for a copy, or google "mactex" if you need a tex distribution on your computer.
You can also visit my LaTeX page and my LyX page. I wrote up a detailed guide on how I figured out how to meet the absurd requirements of the thesis office.
This document has two parts.
First, there is a guide on how to use it in your dissertation LyX file and recognized by LaTeX.
Second, there is an example LyX file, and an explanation of the exmaple file.
These two parts are woven together, so each step of the user guide is illustrated with the example LyX file.
Usage Guide
Before You Begin
As mentioned in the introduction, it is assumed you have a TeX distribution and LyX installed on your machine.
To use the University of Utah thesis class, you will first need to download all of the necessary files:
- Thesis class file: http://charlesmartinreid.com/cmr_uuthesis.cls
- Layout file: http://charlesmartinreid.com/cmr_uuthesis.layout
- Example LyX file: http://charlesmartinreid.com/dissertation_class_example.lyx
To use the class file, you can tell LyX to use a local layout by going to "Document > Settings..." and clicking the "Local Layout" button. Then browse to find the file "cmr_uuthesis.layout". I recommend putting it in the same directory as your LyX file.
Macros
A couple of LaTeX macros define some important things, like who is on your committee and such. The important ones are included in the example file. You can add straight TeX into a LyX document by picking "Insert > TeX Code...". Use this to put macros into your dissertation. Also, see the example file.
Title and Author
You'll have to enter the title of the dissertation in all caps, but that's just about the only tricky thing you'll have to do for the title and author.
Front Matter
There are more LaTeX macros after the title and author, but these macros actually insert pages (as opposed to just defining important things).
The order of these pages is dictated by the University of Utah Thesis Office. See the dissertation handbook on the University of Utah Thesis Office web page for more info.
Table of Contents, List of Tables and Figures
There is some code before the table of contents that dictates the level of information displayed in the table of contents:
% Set the depth of the Table of Contents numbering \setcounter{tocdepth}{1} % 0 = chapter titles only % 1 = chapter & section titles % 2 = chapter, section, & subsection titles % etc.
The Table of Contents is required. The List of Figures and List of Tables is only required if you have LESS THAN 25 ITEMS in each list. If you have more than 25 items in either of these lists, that list is optional.
Start of the Document
The document begins with \body
in this block of text:
\body \parindent 2em \parskip 0pt % This fixes some problems with equation spacing \setlength{\abovedisplayskip}{0pt} \setlength{\abovedisplayshortskip}{0pt} \setlength{\belowdisplayskip}{15pt} \setlength{\belowdisplayshortskip}{15pt}
As with any dissertation, I had to include some kludges to get this class to work (these four lines are a kludge for equation spacing). Fortunately there were very few kludges required.
Document Settings
There are a couple of things to address in the document settings, reached by picking "Document > Settings...".
Class Options
There are a couple of class options for this class, but nothing too fancy. To set class options, pick "Document Class" on the left-hand side of the Document Settings window.
First, you can set your department. Only "che" is provided, so if you want to add a different department, search the LaTeX class file for "che" or "chemical engineering", and add your own option (e.g. "ee" for electrical engineering, etc.)
Second, "dissertation" specifies that this is a Ph.D. dissertation. My LaTeX class was originally ported from a LaTeX class that also allowed for Masters theses, but I cut out all of that because it was not useful to me.
There is also a "twoside" option, which will print a two-sided dissertation; otherwise, it will print everything one-sided. Keep this in mind for the page numbering - one-sided puts the page numbers all in the upper right corner, while two-sided puts the page numbers in alternating top left and top right.
Bibliography
Pick "Bibliography" on the left-hand side of the Document Settings window. I left the "default (numerical)" option selected.
PDF Properties
Unfortunately, the hyperref package is inexplicably broken sometimes for this class, so you'll have to test it out on your document to see if it works. Otherwise, leave it disabled.
Math Options
I checked the "Use AMS math/esint/mathdots/mhchem package automatically" options. I recommend you check any options that are available.
Files
- Thesis class file: http://charlesmartinreid.com/cmr_uuthesis.cls
- Layout file: http://charlesmartinreid.com/cmr_uuthesis.layout
- Example LyX file: http://charlesmartinreid.com/dissertation_class_example.lyx
Debugging
This section is mainly for posterity, and records some of the bugs in this class file that I had to fix to satisfy the thesis editor.
Specific Issues
Title should be double-spaced
You can do this by adding a \begin{doublespace}
and \end{doublespace}
around \uppercase{\Ztitle}
Then it should look like this:
\renewcommand*{\maketitle}%
{{
\thispagestyle{empty}%
\noindent\hspace{1em}%
%\begin{minipage}[c]{\minilength}%
\begin{center}%
\vbox to 9\baselineskip{
\vfil
\HFmainhead\bf
\begin{doublespace}
\uppercase{\Ztitle}
\end{doublespace}
\vfil
}%end vbox
Fix spacing between chapter and quote, or quote and text, to be triple space
First I had to figure out what "triple space" means, precisely. I looked at Abstract page, and there was exactly 0.5 inches between Abstract title and abstract text. However, when I changed the quote environment to have 0.5 inches of space, it automatically added some space to that, so I had to reduce 0.5 to 0.3.
First, add 0.3 in vertical space after the quote environment:
% Add 0.5in of extra space after Quote environment
% to make it triple-spaced
\renewenvironment{quote}{%
% before
}{%
% after
%% triple space, the charles way
\vskip 0.30in
}
And second, add 0.35 in vertical space after the chapter environment:
%% triple space, the charles way
\vspace{0.35in}
Spaces between words on wrapped section headers are stretched too wide
When a section title is too long for a single line, LaTeX will wrap it, but will also try and justify it by increasing the spacing between all of the words. This can look really ugly, and the thesis editor doesn't like it.
There are two solutions:
1) case-by-case fix
\begin{flushleft}
Section 8: Title of Section
\end{flushleft}
Note that the flushleft commands must be verbatim tex code, and they must occur BEFORE and AFTER the line that contains the section. That is, when you look at the format drop down box in the upper left hand corner of LyX, it should not say "Section" for those two blocks of Tex code.
2) fix to "inverted pyramid" function
The alternative is to change the "inverted pyramid" function (defined elsewhere in the thesis class) to exclude the following two lines:
%\parfillskip=0pt plus1fil
%\emergencystretch=1in
Fix the big dumb spaces that occur between enumerated or itemized lists
This fix took me forever to figure out.
\usepackage{enumitem}
\setlist{nolistsep}
% no big dumb spaces inbetween list items
\let\oldenumerate=\enumerate
\def\enumerate{%
%\vspace{-5mm}
\oldenumerate%
\setlength{\itemsep}{0pt}%
\setlength{\parskip}{-1pt}%
}
% no big dumb spaces inbetween list items
\let\olditemize=\itemize
\def\itemize{%
\olditemize%
\setlength{\itemsep}{0pt}%
\setlength{\parskip}{-1pt}%
}
Figures should be placed as soon as possible
This request by the thesis editor got to be really difficult to satisfy. The more I specified the behavior of certain figures, the stranger LaTeX's automatic behavior with other figures would become. It would start bunching 40 figures at the end of a chapter, or put figures 10 pages after they were referenced.
The whole thing got to be a complicated mess, but I managed to resolve it with a simple trick. Rather than arranging figures and text in groups of paragraphs and groups of figures, e.g., "3 paragraphs of text, 4 figures, 5 paragraphs of text, 4 figures, 1 paragraph of text, 4 figures," I would place the figure floats in the midst of the text in the paragraph where the figure was being referenced.
(add screenshots with example)
Make bibliography double-spaced between entries and single-spaced within entries
This can be done by modifying thebibliography environment.
The bibliography environment starts with this section:
%{{{ Alter bibliography environment
% Redefine thebibliography such that there is a triple-space between
% the bibliography title and the list of references
%\renewenvironment{thebibliography}[1]
\renewenvironment{thebibliography}[1]
{
\newpage%
\vspace*{25pt} % space at top of text page
% (note: i'm not actually sure where this number came from,
% but it gives EXACTLY 2 inches of spacing, as required)
%
\addcontentsline{toc}{chapter}{\elBibname}
\thispagestyle{empty}% don't print a page number
\begin{center}
{\Large \textbf{\elBibname}} \\
\ \\ % empty line to create required triple space
% between 'References' and list of refs
\end{center}
%
% don't really know what all this stuff below does...
\singlespace
\list{\@biblabel{\@arabic\c@enumiv}}%
{\settowidth\labelwidth{\@biblabel{#1}}%
\leftmargin\labelwidth
\advance\leftmargin\labelsep
Then comes the part that actually does the spacing right:
\setlength\itemsep{1\baselineskip plus2pt minus1pt}%adjust as required
and then the rest of the code:
\@openbib@code
\usecounter{enumiv}%
\let\p@enumiv\@empty
\renewcommand\theenumiv{\@arabic\c@enumiv}}%
\sloppy
%
Redefine quotation environment to be single spaced
This one was a quick fix:
% Make quotations single-spaced
\renewenvironment{quotation}
{
\singlespace
}
Fix equation spacing
I was actually able to fix a couple of equation spacing errors (not enough spacing occurring before the equation) by going to the line right before the equation appears, and pressing "return", to add a line break between the paragraph text and the equation.
Add a triple space before Sections and Subsections, but double space between consecutive Sections and Subsections
This is a pretty dumb rule. Rather than waste my time implementing it, I got around it by not having any consecutive Sections and Subsections. This is simple enough to do: if a Section and Subsection really need to be consecutive, you can add a single sentence between the Section and Subsection.
Don't break words in section headers
Some of the section headers were getting broken when the inverted pyramid scheme was applied to them.
I changed the code for the invered pyramid. Where this occurrs:
\newcommand\invertedpyramidsub[1]{%
\vbox{%
I added this:
\newcommand\invertedpyramidsub[1]{%
\vbox{%
% 10000 = basically infinity
\hyphenpenalty 10000
\exhyphenpenalty 10000
Fix bibliography and abstract headings to be 2" from top (was only 1" from top)
From thesis handbook:
References or Selected Bibliography
The style of the references or selected bibliography must be patterned after the department-approved style guide the student has selected from the list of department-approved journals and manuals of style on The Graduate School website (see also Chapter 3 herein). The list of references is placed at the end of the manuscript in numerical or alphabetical order depending upon the system used. Scientific papers usually do not list any material in the references that has not been referenced in the text. The reference section is generally entitled “REFERENCES,” or less commonly, “LITERATURE CITED.” The references may be placed at the end of each chapter or section in manuscripts composed of a series of articles previously published or accepted for publication. In this case, the subtitle “references” is treated as a first-level subheading.
Writers in the humanities often consult background material that is not directly cited but is included in a bibliography. The compilation of direct and indirect reference material is entitled “SELECTED BIBLIOGRAPHY.”
The first page of the references or selected bibliography begins 2 inches from the top of the page with the main heading typed in all capital letters. A triple space follows. Entries have no extra space between lines within an entry and a double space between each entry. The reference section is listed as the last item in the table of contents (unless a vita is used).
If a separate part-title page is used with the reference section, the first reference begins 1 inch below the top of the page and no major heading is used on the page with the references (see “Division into Parts”).
Initially, I thought I fixed this by copying the Abstract style to match the Chapter style, and fixing the abstract spacing to be 2 inches from the top. However, it turned out that the Abstract style was still wrong.
The solution was to go to the redefinition of the makechapterhead command, and copy the vertical spacing from there, since that was doing it correctly. The code was \vspace*{25pt}, and that made the text EXACTLY 2 inches below the top.
Fix page numbering to match style guide
This one was really frustrating and took a long time, but ended up being really simple.
The document has a document option "twoside" to make it print two-sided (otherwise, it prints one-sided).
The gist of it is here:
\if@twoside \def\ps@topnumber{
% header = page numbers
\def\@evenhead {\thepage\hfil\leftmark}%
\def\@oddhead{\hfil\thepage}%
% footer = none
\let\@oddfoot\@empty\let\@evenfoot\@empty
}
\else
\def\ps@topnumber{
% header = page numbers
% (using odd head only)
\def\@oddhead{\hfil\thepage}%
% footer = none
% (using odd foot only)
\let\@oddfoot\@empty
}
\fi
%}}}
This is saying that if twopage is on, define odd and even head/foot, otherwise define odd head/foot only
Next, had to make sure things were going on even/odd pages correctly: so make some commands
%%% % this makes sure something goes on an odd page
%%% % (e.g. reading/supervisory committee pages for two-sided documents)
\newif\if@twoside
\newif\if@mparswitchfalse
\DeclareOption{twoside}{\@twosidetrue \@mparswitchtrue}
\newcommand{\@blankpage}%{\mbox{}\newpage}
{\centerline{\mbox{(This page intentionally left blank.)}}\newpage}
\newcommand{\@makeodd}[1]{%
\ifthenelse{\isodd{\pageref{#1}}}{}{\@blankpage}%
}
% - cmr
So now I can use this to make a particular page go on an odd or even page:
\def\copyrightpage{
\newpage
% be sure it starts on an odd page number
\if@twoside \@makeodd{CopyrightPage} \fi%
Appendix should appear in the table of contents with only the appendix title (no section or subsection listing)
I fixed this by adding the following block of TeX code in the LyX document, right after the dedication and right before the table of contents:
\setcounter{tocdepth}{0}
% 0 = chapter titles only
% 1 = chapter & section titles
% 2 = chapter, section, & subsection titles
% etc.
Figures should not be, but are, placed in middle of text
Change figure placement by right-clicking the figure float and picking settings. Placement should be changed from "here if possible" to "top of page" or "bottom of page."
Triple space needed between title heading and section heading (and quotes)
Fixed by adding vertical space to the end of quote environment.
Quote environment: only quotes at beginning of chapter.
Quotation environment: only quotations in text.
Need 2 or more lines underneath subheads at bottom of pages
Problem was with Section 2.3.1: Quadrature Approximation.
This is what windows and orphans are all about: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=widows
Solution: put
widowpenalty 100000
in a block of TeX code just before the problematic section. For some reason this isn't always pervasive, so forcing it to go at the beginning of a section helps make sure it is enforced.
2 or more lines required to be under a subheading at beginning/end of page
This is controlled with widow and orphan settings. The following can be added in the LyX file in the area that's having problems, using straight TeX code. Alternatively, this could be set in the class file somewhere, but when I tried to do this, it didn't have any effect.
% minimize orphans and widows
\clubpenalty=999999999
\widowpenalty=999999999
\displaywidowpenalty=9999
\brokenpenalty=9999