How can I single space long titles in my table of contents and list of figures/tables?
up vote
2
down vote
favorite
I'm currently revising my university's thesis template, and I have almost everything fixed except for particular spacing issues. Our thesis manual states that long section titles must be single spaced, but even after enclosing the entire TOC in a singlespace environment, the long title still appears as double-spaced text. Using abbreviated titles are not allowed; titles must match in the table of contents and the body.
I've tried the fix outlined here but it just double spaced the entire table of contents. I'm currently fiddling with the class file to see if there's anything in there I can do.
MWE is below:
documentclass[SectionMethod, ListStyleI]{TAMUthesis2}
%documentclass[ChapterMethod, ListStyleI]{TAMUthesis2}
usepackage{amsthm}
usepackage[doublespacing]{setspace}
usepackage{tocloft}
%usepackage[labelsep=period]{caption}
numberwithin{equation}{chapter}
%FIX
sloppy
hfuzz=6pt
vfuzz=6pt
hbadness=2000
vbadness=maxdimen
%FIX
graphicspath{{graphic/}}
begin{document}
include{data/cover} %only store parameter
maketitle
frontmatter
include{data/Abstract}
include{data/Dedication}
include{data/Acknowledgment}
include{data/Contributors}
include{data/Nomenclature}
TAMUTableofContentsFormat
%The line below add Word `F` on next page Table of Content (TOC). To add the third page word `Page`, Please apply the same command below at appropriate position.
TAMUTocAddWordPage
begin{singlespace}
tableofcontents
end{singlespace}
TAMUListOfFiguresFormat
begin{singlespace}
listoffigures
end{singlespace}
TAMUListOfTablesFormat
%Uncomment the line below to add Word `Page' on next page of List of Figure
%TAMULotAddWordPage
begin{singlespace}
listoftables
end{singlespace}
mainmatter
include{data/chapterI}
include{data/chapterII}
include{data/chapterIII}
include{data/chapterIV}
%include{data/AnotherChapter}
TAMUReferenceFormat
bibliographystyle{ieeetr}
bibliography{myReference}
appendix
TAMUAppendixFormat
%comment the line below if using ChapterMethod or there is no Appendix
begin{appendices}
%keep this line always if you have appendix
include{data/Appendix}
%comment the line below if using ChapterMethod or no appendix
end{appendices}
end{document}
Here is the class file TAMUThesis2.cls
for which most was generated by the person that had this position last.
NeedsTeXFormat{LaTeX2e}
ProvidesClass{TAMUthesis2}[2016/07/15 Texas A&M University Thesis Template Version 2.07.16 based on book.cls]
newifif@ChapterMethod@ChapterMethodtrue
DeclareOption{ChapterMethod}{@ChapterMethodtrue}
DeclareOption{SectionMethod}{@ChapterMethodfalse}
%ExecuteOptions{ChapterMethod} %default is ChapterMethod
newifif@ListStyle@ListStyletrue
DeclareOption{ListStyleI}{@ListStyletrue}
DeclareOption{ListStyleII}{@ListStylefalse}
DeclareOption*{PassOptionsToClass{CurrentOption}{book}}
%ExecuteOptions{}
ProcessOptionsrelax
showboxdepth=5
showboxbreadth=5
RequirePackage{{lscape}}
RequirePackage{url}
RequirePackage{mathtools}
%RequirePackage{setspace}onehalfspacing
RequirePackage{adjustbox}
%newcommandblfootnote[1]{%
% begingroup
% renewcommandthefootnote{}footnote{#1}%
% addtocounter{footnote}{-1}%
% endgroup
%}
%setlength{overfullrule}{5pt}
%hfuzz=50pt
LoadClass[12pt, letterpaper,oneside]{book}
RequirePackage{textcomp}
RequirePackage[T1]{fontenc}
RequirePackage{arydshln}
RequirePackage{gensymb}
RequirePackage{listings}
lstset{basicstyle=ttfamilynormalsize}
RequirePackage{rotating,booktabs}
RequirePackage[xetex,bookmarks, hidelinks]{hyperref} % comment to disable hyper-link in table of contents
RequirePackage[flushleft]{threeparttable}
RequirePackage{color, graphicx} % Allows you to import images
RequirePackage{amsmath}
RequirePackage{multirow}
RequirePackage{booktabs}
RequirePackage[top=1.25in, bottom=1.25in, left=1.4in, right=1.15in]{geometry}
RequirePackage{caption}
RequirePackage{truncate}
DeclareRobustCommandCaption[2][130pt]{captionof{figure}{truncate{#1}{#2}}}
RequirePackage[T1]{fontenc}
RequirePackage{mathptmx}
RequirePackage{pdflscape}
RequirePackage{subcaption}
DeclareCaptionFormat{cont}{#1 continued #2#3par}
if@ChapterMethod
else
RequirePackage[titletoc,title]{appendix}
fi
RequirePackage{setspace}
%setstretch{1}
%linespread{1.6}
%font type
RequirePackage{fontspec}
%setmainfont{Arial} %change font style to Arial
setmainfont{Times New Roman}
renewcommand*large{fontsize{14.05}{14.05}selectfont} %fine tunement to adjust large to be 14pt exactly
%remove vertical space between itemize/enumerate/description
RequirePackage{enumitem}
%remove vertical space between items in itemize
setlist[itemize]{noitemsep, nolistsep}
setlist[enumerate]{noitemsep, nolistsep}
setlist[description]{noitemsep, nolistsep}
%indent after chapter/sectioin, only affect the first one
RequirePackage{indentfirst}
setlength{parindent}{1cm} %first indent
%Header/Footer Modification
RequirePackage{fancyhdr}
lhead{}
chead{}
rhead{}
%lfoot{}
%rfoot{thepage}
cfoot{thepage}
%fancyfoot[RO, LE]{thepage}
renewcommand{headrulewidth}{0pt}
RequirePackage{titlesec}
%modify section title font size
titleformat*{section}{normalfontbfseries}
titleformat*{subsection}{normalfontbfseries}
titleformat*{subsubsection}{normalfontbfseries}
titleformat*{paragraph}{normalfontbfseries}
if@ChapterMethod
%chapter title format
titleformat{chapter}[display]{largebfseriescentering}{chaptertitlename thechapter}{0pt}{large}
%modify chapter title name
renewcommand{chaptertitlename}{CHAPTER}
else
%chapter title format
titleformat{chapter}{vspace{1ex}largebfseriescentering}{thechapter}{1em}{large}
%modify chapter title name
%renewcommand{chaptertitlename}{CHAPTER}
fi
renewcommand{appendixname}{APPENDIX} % this command is overlapped by something else, I believe comment it won't cause any difference in APPENDIX title
renewcommand{bibname}{REFERENCES}
RequirePackage{tocloft}
%enable that toc has no section number, no subsection number as well
if@ChapterMethod
renewcommand{cftsecpresnum}{begin{lrbox}{@tempboxa}} %for section
renewcommand{cftsecaftersnum}{end{lrbox}} %for section
renewcommand{cftsubsecpresnum}{begin{lrbox}{@tempboxa}} %for subsection
renewcommand{cftsubsecaftersnum}{end{lrbox}} %for subsection
fi
addtocontents{toc}{linespread{1.4}selectfont}
%renewcommandcftbeforechapskip{0pt}
%renewcommandcftchapafterpnum{vskip14pt}
renewcommandcftbeforesecskip{-7pt}
%renewcommandcftsecafterpnum{vskip0pt}
renewcommandcftbeforesubsecskip{-7pt}
%renewcommandcftsubsecafterpnum{vskip0pt}
%redefine section to have 14pt space in first appearance at toc
renewcommandsection{@startsection{section}{2}{z@}%
{-3.25ex@plus -1ex @minus -0.2ex}%
{1.5ex @plus 0.2ex}%
{normalfontbfseries%
ifnumvalue{section}>1 else addtocontents{toc}{protectaddvspace{14pt}}fi}}
%add vertical space in lof to have equal space for each figure item
newcommand*{noaddvspace}{renewcommand*{addvspace}[1]{}}
addtocontents{lof}{protectnoaddvspace}
addtocontents{lot}{protectnoaddvspace}
addtocontents{lof}{linespread{2.1}selectfont}
%add vertical space in lof to have equal space for each figure item
addtocontents{lot}{linespread{2.1}selectfont}
RequirePackage{afterpage} %enable the "PAGE" or other information on the consequencing next page
if@ListStyle
%LIST STYLE I
addtocontents{toc}{~hfill {Page} par} %add "PAGE" to toc/lof/lot
%addtocontents{toc}{~hfill par} %double space of toc word `'Page' and the chapter title.
addtocontents{lof}{{FIGURE}~hfill {Page} par}
%addtocontents{lof}{~hfill par}
addtocontents{lot}{{TABLE}~hfill {Page} par}
%addtocontents{lot}{~hfill par}
else
%LIST STYLE II
addtocontents{lof}{~hfill {Page} par}
addtocontents{lot}{~hfill {Page} par}
%%list of figures with "FIGURE"
renewcommand{cftfigfont}{Figure ~}
renewcommand{cfttabfont}{Table ~}
fi
%modify the vertical space after title but before the content in toc/lof/lot
setlength{cftafterloftitleskip}{27pt}
setlength{cftafterlottitleskip}{27pt}
setlength{cftaftertoctitleskip}{33pt}
%toc title
renewcommand{cftchapfont}{normalfont}
renewcommand{cftchappagefont}{normalfont}
if@ChapterMethod
renewcommand{cftchappresnum}{CHAPTER }
renewcommand{cftchapnumwidth}{7em}
%Chapter Roman Numbering
renewcommandthechapter{Roman{chapter}}
else
%Chapter Arabic Numbering
renewcommandthechapter{arabic{chapter}}
fi
%leader dots in TABLE OF CONTENTS
renewcommand{cftpartleader}{cftdotfill{cftdotsep}} % for parts
renewcommand{cftchapleader}{cftdotfill{cftdotsep}} % for chapters
newcommand*updatechaptername{%
addtocontents{toc}{protectrenewcommand*protectcftchappresnum{@chapapp }}
}
%modify toc/lof/lot font size and align horizontal middle
renewcommand{cfttoctitlefont}{largebfseries}
renewcommand{cftloftitlefont}{largebfseries}
renewcommand{cftlottitlefont}{largebfseries}
renewcommand{contentsname}{centerline{TABLE OF CONTENTS}}
renewcommand{listfigurename}{centerline{LIST OF FIGURES}}
renewcommand{listtablename}{centerline{LIST OF TABLES}}
%remove the vertical spacing before toc/lof/lot
setlength{cftbeforetoctitleskip}{-6ex}
setlength{cftbeforeloftitleskip}{-5.5ex}
setlength{cftbeforelottitleskip}{-2.4ex}
%modify the horizontal spacing in lof/lot
setlength{cfttabnumwidth}{4em}
setlength{cftfignumwidth}{4em}
%remove the vertical space above CHAPTER title in each chapter, not toc
titlespacing*{chapter}{0pt}{-5.5ex}{6ex}
%modify the vertical space above/below section/subsection title in the main content, not toc.
titlespacing*{section}{0pt}{1ex}{0.5ex}
titlespacing*{subsection}{0pt}{1ex}{0.5ex}
titlespacing*{subsubsection}{0pt}{1ex}{0.5ex}
titlespacing*{paragraph}{0pt}{1ex}{0.5ex}
%%change equation vertical space
g@addto@macronormalsize{%
setlengthabovedisplayskip{0ex plus 1ex minus 1ex}
setlengthbelowdisplayskip{4pt plus 4pt minus 4pt}% plus 1ex minus 1ex}
setlengthabovedisplayshortskip{0ex plus 1ex minus 1ex}
setlengthbelowdisplayshortskip{4pt plus 4pt minus 4pt}%x plus 1ex minus 1ex}
}
%set figure/table display method to be Arabic.arabic instead of following chapter Roman Number.
renewcommand{thefigure}{arabic{chapter}.arabic{figure}}
renewcommand{thetable}{arabic{chapter}.arabic{table}}
renewcommand{theequation}{arabic{chapter}.arabic{equation}}
%new environment definition
newenvironment{Contfigure}{%
%renewcommand{thefigure}{Roman{chapter}.arabic{figure} Continued.}%
renewcommand{thefigure}{arabic{chapter}.arabic{figure} Continued.}%
addtocounter{figure}{-1}%
begin{figure}}{%
%renewcommand{thefigure}{Roman{chapter}.arabic{figure} }
renewcommand{thefigure}{arabic{chapter}.arabic{figure} }
end{figure}}
%new environment definition
newenvironment{Conttable}{%
%renewcommand{thetable}{Roman{chapter}.arabic{table} Continued.}%
renewcommand{thetable}{arabic{chapter}.arabic{table} Continued.}%
addtocounter{table}{-1}%
begin{table}}{%
%renewcommand{thetable}{Roman{chapter}.arabic{table} }
renewcommand{thetable}{arabic{chapter}.arabic{table}}
end{table}}
%command must be used when applying Contfigure and Conttable %captionsetup{list=no} %disable figures/table to appear in lof/lot
%%%%%%%%%%%%%%%%%
%hook definition
AtBeginDocument{
pagestyle{empty}
pagenumbering{roman}
}
renewcommandfrontmatter{
clearpage
setcounter{page}{2} %abstract page number starts from 2.
pagestyle{fancy}
linespread{2}selectfont
}
newcommand{TAMUTableofContentsFormat}{
addtocontents{toc}{protectafterpage{~hfill parmedskip}} %command to enable second page "PAGE" in toc, together with package{afterpage}
phantomsection
addcontentsline{toc}{chapter}{TABLE OF CONTENTS}
}
newcommand{TAMUTocAddWordPage}{
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
addtocontents{toc}{protectafterpage{~hfill{Page}parmedskipvspace{1ex}}} %command to enable second page "PAGE" in toc,
addtocontents{toc}{protectafterpage{~hfill parmedskip}} %command to enable second page "PAGE" in toc, together
%this is a manual way to do so, pleaer refer to http://www.latex-community.org/forum/viewtopic.php?f=5&t=252
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}
newcommand{TAMUListOfFiguresFormat}{
newpage
phantomsection
addcontentsline{toc}{chapter}{LIST OF FIGURES}
addtocontents{lof}{protectafterpage{~hfill parmedskip}} %command to enable second page "PAGE" in toc, together with package{afterpage}
}
newcommand{TAMULofAddWordPage}{
if@ListStyle
addtocontents{lof}{protectafterpage{noindent{FIGURE}~hfill{Page}parmedskipvspace{-1ex}}} %command to enable second page "PAGE" in toc,
else
addtocontents{lof}{protectafterpage{~hfill{Page}parmedskipvspace{-1ex}}} %command to enable second page "PAGE" in toc,
fi
}
newcommand{TAMULotAddWordPage}{
if@ListStyle
addtocontents{lot}{protectafterpage{noindent{TABLE}~hfill{Page}parmedskipvspace{-1ex}}} %command to enable second page "PAGE" in toc,
%addtocontents{toc}{protectafterpage{~hfill parmedskip}} %command to enable second page "PAGE" in toc, together
%this is a manul way to do so, pleaer refer to http://www.latex-community.org/forum/viewtopic.php?f=5&t=252
else
addtocontents{lot}{protectafterpage{~hfill{Page}parmedskipvspace{-1ex}}} %command to enable second page "PAGE" in toc,
fi
}
newcommand{TAMUListOfTablesFormat}{
linespread{1}selectfont
newpage
phantomsection %optional for hyper-ref:
addcontentsline{toc}{chapter}{LIST OF TABLES}
%
%addtocontents{lot}{protectafterpage{{TABLE}~hfill{Page}parmedskip}} %command to enable second page "PAGE" in toc, together with package{afterpage}
%addtocontents{lot}{protectafterpage{~hfill{Page}parmedskip}} %command to enable second page "PAGE" in toc, together with package{afterpage}
}
newcommand{TAMUAbstractFormat}{
%cleardoublepage
phantomsection %optional for hyperref
%addtocontents{toc}{chapter}{protectnumberline{}Abstract}
addcontentsline{toc}{chapter}{ABSTRACT}
% begin{spacing}{2}
begin{center}
MakeUppercase{textbf{large Abstract}}
% MakeUppercase
end{center}
vspace{14pt}
}
newcommand{TAMUContributorFormat}{
%cleardoublepage
phantomsection %optional for hyperref
%addtocontents{toc}{chapter}{protectnumberline{}Contributors and Funding Sources}
addcontentsline{toc}{chapter}{CONTRIBUTORS AND FUNDING SOURCES}
% begin{spacing}{2}
begin{center}
MakeUppercase{textbf{large Contributors and Funding Sources}}
% MakeUppercase
end{center}
vspace{14pt}
}
newcommand{TAMUNomenclatureFormat}{
%cleardoublepage
%addtocontents{toc}{chapter}{protectnumberline{}Abstract
phantomsection %optional for hyperref
addcontentsline{toc}{chapter}{NOMENCLATURE}
begin{center}
MakeUppercase{textbf{large Nomenclature}}
end{center}
vspace{14pt}
}
newcommand{TAMUDedicationFormat}{
%cleardoublepage
phantomsection
%addtocontents{toc}{chapter}{protectnumberline{}Abstract
addcontentsline{toc}{chapter}{DEDICATION}
}
newcommand{TAMUAcknowledgmentFormat}{
phantomsection %optional for hyperref
addcontentsline{toc}{chapter}{ACKNOWLEDGMENTS}
begin{center}
MakeUppercase{textbf{large Acknowledgments}}
end{center}
vspace{14pt}
}
newcommand{TAMUReferenceFormat}{
newpage
phantomsection
addcontentsline{toc}{chapter}{REFERENCES}
}
newcommand{TAMUAppendixFormat}{
captionsetup{list=no} %disable figures/table to appear in lof/lot
renewcommand{thefigure}{Alph{chapter}.arabic{figure}} %fixed the bug caused by Figure/Table Continued, all appendix figure/table in appendix will be labeled as A.1, A.2, A.3...
renewcommand{thetable}{Alph{chapter}.arabic{table}} %fixed the bug caused by Figure/Table Continued, all appendix figure/table in appendix labeled as A.1, A.2
if@ChapterMethod
renewcommand{chaptertitlename}{APPENDIX} % some unknown bugs, comment this line will cause the Appendix title in main content becomes CHAPTER A instead of APPENDIX A
updatechaptername %this cmd is needed for chatper method to update toc title for appendix
fi
}
renewcommandmainmatter{
clearpage
pagenumbering{arabic}
linespread{2}selectfont
}
%end of hook definition
let@documentname@empty
let@degreename@empty
let@majorname@empty
let@ChairOfCommittee@empty
let@CoChairOfCommittee@empty
let@CommitteeMemberOne@empty
let@CommitteeMemberTwo@empty
let@CommitteeMemberThree@empty
let@CommitteeMemberFour@empty
let@HeadOfDepartment@empty
let@GraduateMonth@empty
let@GraduateYear@empty
let@GradMajor@empty
newcommand{TAMUdocument}[1]{def@documentname{#1}}TAMUdocument{Thesis/Dissertation/Record of Study}
def@TAMUdocument{@documentname}
newcommand{TAMUdegree}[1]{def@degreename{#1}}TAMUdegree{Master of Science}
def@TAMUdegree{@degreename}
newcommand{ChairOfCommitteeName}[1]{def@ChairOfCommittee{#1}}ChairOfCommitteeName{Chair's Name}
def@ChairOfCommitteeName{@ChairOfCommittee}
newcommand{CommitteeMemberOneName}[1]{def@CommitteeMemberOne{#1}}CommitteeMemberOneName{Committee Member One's Name}
def@CommitteeMemberOneName{@CommitteeMemberOne}
newcommand{CommitteeMemberTwoName}[1]{def@CommitteeMemberTwo{#1}}CommitteeMemberTwoName{Committee Member Two's Name}
def@CommitteeMemberTwoName{@CommitteeMemberTwo}
newcommand{HeadOfDepartmentName}[1]{def@HeadOfDepartment{#1}}HeadOfDepartmentName{Head Of Department's Name}
def@HeadOfDepartmentName{@HeadOfDepartment}
newcommand{CoChairOfCommitteeName}[1]{def@CoChairOfCommittee{#1}}
newcommand{CommitteeMemberThreeName}[1]{def@CommitteeMemberThree{#1}}
newcommand{CommitteeMemberFourName}[1]{def@CommitteeMemberFour{#1}}
newcommand{TAMUgradMonth}[1]{def@GraduateMonth{#1}}TAMUgradMonth{May/August/December}
def@TAMUgradMonth{@GraduateMonth}
newcommand{TAMUgradYear}[1]{def@GraduateYear{#1}}TAMUgradYear{20XX}
def@TAMUgradYear{@GraduateYear}
newcommand{TAMUmajor}[1]{def@GradMajor{#1}}TAMUmajor{Your Major}
def@TAMUmajor{@GradMajor}
renewcommandmaketitle{
begin{center}
begin{spacing}{2.1}
{largebfseries@titlepar}
vspace{17mm} par
A @documentname par
by par
MakeUppercase{@author} \
end{spacing}
vspace{8mm}par
{Submitted to the Office of Graduate and Professional Studies of par
Texas A&M University par
in partial fulfillment of the requirement for the degree of par
% vspace{9mm}
vspace{14pt}
MakeUppercase{@degreename}
}
end{center}
% vspace{6mm}
vspace{24pt}
begin{flushleft}
begin{tabular}{l l}
Chair of Committee, & @ChairOfCommittee \
%
ifx@CoChairOfCommittee@empty %
expandafter@firstoftwo
else %
expandafter@secondoftwo
fi %
{} %
{Co-Chair of Committee,& @CoChairOfCommittee \ }%
Committee Members, & @CommitteeMemberOne \
& @CommitteeMemberTwo \ %
ifx@CommitteeMemberThree@empty %
expandafter@firstoftwo
else %
expandafter@secondoftwo %
fi %
{} %
{ & @CommitteeMemberThree \} %
ifx@CommitteeMemberFour@empty %
expandafter@firstoftwo
else %
expandafter@secondoftwo %
fi %
{}%
{ & @CommitteeMemberFour \} %
%https://tex.stackexchange.com/questions/4072/how-to-display-some-text-based-on-a-condition-inside-a-tabular-environment
Head of Department, & @HeadOfDepartment \
end{tabular}
end{flushleft}
begin{center}
vspace{31pt} par
@GraduateMonth %August%December %
~ %
@GraduateYear % 20XX
%university requires that graduating data must be
par
vspace{40pt}
Major Subject: @GradMajor
par
vspace{42pt}
Copyright @GraduateYear %
~@author
end{center}
}
endinput
I apologize for the length of code.
templates line-spacing thesis
add a comment |
up vote
2
down vote
favorite
I'm currently revising my university's thesis template, and I have almost everything fixed except for particular spacing issues. Our thesis manual states that long section titles must be single spaced, but even after enclosing the entire TOC in a singlespace environment, the long title still appears as double-spaced text. Using abbreviated titles are not allowed; titles must match in the table of contents and the body.
I've tried the fix outlined here but it just double spaced the entire table of contents. I'm currently fiddling with the class file to see if there's anything in there I can do.
MWE is below:
documentclass[SectionMethod, ListStyleI]{TAMUthesis2}
%documentclass[ChapterMethod, ListStyleI]{TAMUthesis2}
usepackage{amsthm}
usepackage[doublespacing]{setspace}
usepackage{tocloft}
%usepackage[labelsep=period]{caption}
numberwithin{equation}{chapter}
%FIX
sloppy
hfuzz=6pt
vfuzz=6pt
hbadness=2000
vbadness=maxdimen
%FIX
graphicspath{{graphic/}}
begin{document}
include{data/cover} %only store parameter
maketitle
frontmatter
include{data/Abstract}
include{data/Dedication}
include{data/Acknowledgment}
include{data/Contributors}
include{data/Nomenclature}
TAMUTableofContentsFormat
%The line below add Word `F` on next page Table of Content (TOC). To add the third page word `Page`, Please apply the same command below at appropriate position.
TAMUTocAddWordPage
begin{singlespace}
tableofcontents
end{singlespace}
TAMUListOfFiguresFormat
begin{singlespace}
listoffigures
end{singlespace}
TAMUListOfTablesFormat
%Uncomment the line below to add Word `Page' on next page of List of Figure
%TAMULotAddWordPage
begin{singlespace}
listoftables
end{singlespace}
mainmatter
include{data/chapterI}
include{data/chapterII}
include{data/chapterIII}
include{data/chapterIV}
%include{data/AnotherChapter}
TAMUReferenceFormat
bibliographystyle{ieeetr}
bibliography{myReference}
appendix
TAMUAppendixFormat
%comment the line below if using ChapterMethod or there is no Appendix
begin{appendices}
%keep this line always if you have appendix
include{data/Appendix}
%comment the line below if using ChapterMethod or no appendix
end{appendices}
end{document}
Here is the class file TAMUThesis2.cls
for which most was generated by the person that had this position last.
NeedsTeXFormat{LaTeX2e}
ProvidesClass{TAMUthesis2}[2016/07/15 Texas A&M University Thesis Template Version 2.07.16 based on book.cls]
newifif@ChapterMethod@ChapterMethodtrue
DeclareOption{ChapterMethod}{@ChapterMethodtrue}
DeclareOption{SectionMethod}{@ChapterMethodfalse}
%ExecuteOptions{ChapterMethod} %default is ChapterMethod
newifif@ListStyle@ListStyletrue
DeclareOption{ListStyleI}{@ListStyletrue}
DeclareOption{ListStyleII}{@ListStylefalse}
DeclareOption*{PassOptionsToClass{CurrentOption}{book}}
%ExecuteOptions{}
ProcessOptionsrelax
showboxdepth=5
showboxbreadth=5
RequirePackage{{lscape}}
RequirePackage{url}
RequirePackage{mathtools}
%RequirePackage{setspace}onehalfspacing
RequirePackage{adjustbox}
%newcommandblfootnote[1]{%
% begingroup
% renewcommandthefootnote{}footnote{#1}%
% addtocounter{footnote}{-1}%
% endgroup
%}
%setlength{overfullrule}{5pt}
%hfuzz=50pt
LoadClass[12pt, letterpaper,oneside]{book}
RequirePackage{textcomp}
RequirePackage[T1]{fontenc}
RequirePackage{arydshln}
RequirePackage{gensymb}
RequirePackage{listings}
lstset{basicstyle=ttfamilynormalsize}
RequirePackage{rotating,booktabs}
RequirePackage[xetex,bookmarks, hidelinks]{hyperref} % comment to disable hyper-link in table of contents
RequirePackage[flushleft]{threeparttable}
RequirePackage{color, graphicx} % Allows you to import images
RequirePackage{amsmath}
RequirePackage{multirow}
RequirePackage{booktabs}
RequirePackage[top=1.25in, bottom=1.25in, left=1.4in, right=1.15in]{geometry}
RequirePackage{caption}
RequirePackage{truncate}
DeclareRobustCommandCaption[2][130pt]{captionof{figure}{truncate{#1}{#2}}}
RequirePackage[T1]{fontenc}
RequirePackage{mathptmx}
RequirePackage{pdflscape}
RequirePackage{subcaption}
DeclareCaptionFormat{cont}{#1 continued #2#3par}
if@ChapterMethod
else
RequirePackage[titletoc,title]{appendix}
fi
RequirePackage{setspace}
%setstretch{1}
%linespread{1.6}
%font type
RequirePackage{fontspec}
%setmainfont{Arial} %change font style to Arial
setmainfont{Times New Roman}
renewcommand*large{fontsize{14.05}{14.05}selectfont} %fine tunement to adjust large to be 14pt exactly
%remove vertical space between itemize/enumerate/description
RequirePackage{enumitem}
%remove vertical space between items in itemize
setlist[itemize]{noitemsep, nolistsep}
setlist[enumerate]{noitemsep, nolistsep}
setlist[description]{noitemsep, nolistsep}
%indent after chapter/sectioin, only affect the first one
RequirePackage{indentfirst}
setlength{parindent}{1cm} %first indent
%Header/Footer Modification
RequirePackage{fancyhdr}
lhead{}
chead{}
rhead{}
%lfoot{}
%rfoot{thepage}
cfoot{thepage}
%fancyfoot[RO, LE]{thepage}
renewcommand{headrulewidth}{0pt}
RequirePackage{titlesec}
%modify section title font size
titleformat*{section}{normalfontbfseries}
titleformat*{subsection}{normalfontbfseries}
titleformat*{subsubsection}{normalfontbfseries}
titleformat*{paragraph}{normalfontbfseries}
if@ChapterMethod
%chapter title format
titleformat{chapter}[display]{largebfseriescentering}{chaptertitlename thechapter}{0pt}{large}
%modify chapter title name
renewcommand{chaptertitlename}{CHAPTER}
else
%chapter title format
titleformat{chapter}{vspace{1ex}largebfseriescentering}{thechapter}{1em}{large}
%modify chapter title name
%renewcommand{chaptertitlename}{CHAPTER}
fi
renewcommand{appendixname}{APPENDIX} % this command is overlapped by something else, I believe comment it won't cause any difference in APPENDIX title
renewcommand{bibname}{REFERENCES}
RequirePackage{tocloft}
%enable that toc has no section number, no subsection number as well
if@ChapterMethod
renewcommand{cftsecpresnum}{begin{lrbox}{@tempboxa}} %for section
renewcommand{cftsecaftersnum}{end{lrbox}} %for section
renewcommand{cftsubsecpresnum}{begin{lrbox}{@tempboxa}} %for subsection
renewcommand{cftsubsecaftersnum}{end{lrbox}} %for subsection
fi
addtocontents{toc}{linespread{1.4}selectfont}
%renewcommandcftbeforechapskip{0pt}
%renewcommandcftchapafterpnum{vskip14pt}
renewcommandcftbeforesecskip{-7pt}
%renewcommandcftsecafterpnum{vskip0pt}
renewcommandcftbeforesubsecskip{-7pt}
%renewcommandcftsubsecafterpnum{vskip0pt}
%redefine section to have 14pt space in first appearance at toc
renewcommandsection{@startsection{section}{2}{z@}%
{-3.25ex@plus -1ex @minus -0.2ex}%
{1.5ex @plus 0.2ex}%
{normalfontbfseries%
ifnumvalue{section}>1 else addtocontents{toc}{protectaddvspace{14pt}}fi}}
%add vertical space in lof to have equal space for each figure item
newcommand*{noaddvspace}{renewcommand*{addvspace}[1]{}}
addtocontents{lof}{protectnoaddvspace}
addtocontents{lot}{protectnoaddvspace}
addtocontents{lof}{linespread{2.1}selectfont}
%add vertical space in lof to have equal space for each figure item
addtocontents{lot}{linespread{2.1}selectfont}
RequirePackage{afterpage} %enable the "PAGE" or other information on the consequencing next page
if@ListStyle
%LIST STYLE I
addtocontents{toc}{~hfill {Page} par} %add "PAGE" to toc/lof/lot
%addtocontents{toc}{~hfill par} %double space of toc word `'Page' and the chapter title.
addtocontents{lof}{{FIGURE}~hfill {Page} par}
%addtocontents{lof}{~hfill par}
addtocontents{lot}{{TABLE}~hfill {Page} par}
%addtocontents{lot}{~hfill par}
else
%LIST STYLE II
addtocontents{lof}{~hfill {Page} par}
addtocontents{lot}{~hfill {Page} par}
%%list of figures with "FIGURE"
renewcommand{cftfigfont}{Figure ~}
renewcommand{cfttabfont}{Table ~}
fi
%modify the vertical space after title but before the content in toc/lof/lot
setlength{cftafterloftitleskip}{27pt}
setlength{cftafterlottitleskip}{27pt}
setlength{cftaftertoctitleskip}{33pt}
%toc title
renewcommand{cftchapfont}{normalfont}
renewcommand{cftchappagefont}{normalfont}
if@ChapterMethod
renewcommand{cftchappresnum}{CHAPTER }
renewcommand{cftchapnumwidth}{7em}
%Chapter Roman Numbering
renewcommandthechapter{Roman{chapter}}
else
%Chapter Arabic Numbering
renewcommandthechapter{arabic{chapter}}
fi
%leader dots in TABLE OF CONTENTS
renewcommand{cftpartleader}{cftdotfill{cftdotsep}} % for parts
renewcommand{cftchapleader}{cftdotfill{cftdotsep}} % for chapters
newcommand*updatechaptername{%
addtocontents{toc}{protectrenewcommand*protectcftchappresnum{@chapapp }}
}
%modify toc/lof/lot font size and align horizontal middle
renewcommand{cfttoctitlefont}{largebfseries}
renewcommand{cftloftitlefont}{largebfseries}
renewcommand{cftlottitlefont}{largebfseries}
renewcommand{contentsname}{centerline{TABLE OF CONTENTS}}
renewcommand{listfigurename}{centerline{LIST OF FIGURES}}
renewcommand{listtablename}{centerline{LIST OF TABLES}}
%remove the vertical spacing before toc/lof/lot
setlength{cftbeforetoctitleskip}{-6ex}
setlength{cftbeforeloftitleskip}{-5.5ex}
setlength{cftbeforelottitleskip}{-2.4ex}
%modify the horizontal spacing in lof/lot
setlength{cfttabnumwidth}{4em}
setlength{cftfignumwidth}{4em}
%remove the vertical space above CHAPTER title in each chapter, not toc
titlespacing*{chapter}{0pt}{-5.5ex}{6ex}
%modify the vertical space above/below section/subsection title in the main content, not toc.
titlespacing*{section}{0pt}{1ex}{0.5ex}
titlespacing*{subsection}{0pt}{1ex}{0.5ex}
titlespacing*{subsubsection}{0pt}{1ex}{0.5ex}
titlespacing*{paragraph}{0pt}{1ex}{0.5ex}
%%change equation vertical space
g@addto@macronormalsize{%
setlengthabovedisplayskip{0ex plus 1ex minus 1ex}
setlengthbelowdisplayskip{4pt plus 4pt minus 4pt}% plus 1ex minus 1ex}
setlengthabovedisplayshortskip{0ex plus 1ex minus 1ex}
setlengthbelowdisplayshortskip{4pt plus 4pt minus 4pt}%x plus 1ex minus 1ex}
}
%set figure/table display method to be Arabic.arabic instead of following chapter Roman Number.
renewcommand{thefigure}{arabic{chapter}.arabic{figure}}
renewcommand{thetable}{arabic{chapter}.arabic{table}}
renewcommand{theequation}{arabic{chapter}.arabic{equation}}
%new environment definition
newenvironment{Contfigure}{%
%renewcommand{thefigure}{Roman{chapter}.arabic{figure} Continued.}%
renewcommand{thefigure}{arabic{chapter}.arabic{figure} Continued.}%
addtocounter{figure}{-1}%
begin{figure}}{%
%renewcommand{thefigure}{Roman{chapter}.arabic{figure} }
renewcommand{thefigure}{arabic{chapter}.arabic{figure} }
end{figure}}
%new environment definition
newenvironment{Conttable}{%
%renewcommand{thetable}{Roman{chapter}.arabic{table} Continued.}%
renewcommand{thetable}{arabic{chapter}.arabic{table} Continued.}%
addtocounter{table}{-1}%
begin{table}}{%
%renewcommand{thetable}{Roman{chapter}.arabic{table} }
renewcommand{thetable}{arabic{chapter}.arabic{table}}
end{table}}
%command must be used when applying Contfigure and Conttable %captionsetup{list=no} %disable figures/table to appear in lof/lot
%%%%%%%%%%%%%%%%%
%hook definition
AtBeginDocument{
pagestyle{empty}
pagenumbering{roman}
}
renewcommandfrontmatter{
clearpage
setcounter{page}{2} %abstract page number starts from 2.
pagestyle{fancy}
linespread{2}selectfont
}
newcommand{TAMUTableofContentsFormat}{
addtocontents{toc}{protectafterpage{~hfill parmedskip}} %command to enable second page "PAGE" in toc, together with package{afterpage}
phantomsection
addcontentsline{toc}{chapter}{TABLE OF CONTENTS}
}
newcommand{TAMUTocAddWordPage}{
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
addtocontents{toc}{protectafterpage{~hfill{Page}parmedskipvspace{1ex}}} %command to enable second page "PAGE" in toc,
addtocontents{toc}{protectafterpage{~hfill parmedskip}} %command to enable second page "PAGE" in toc, together
%this is a manual way to do so, pleaer refer to http://www.latex-community.org/forum/viewtopic.php?f=5&t=252
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}
newcommand{TAMUListOfFiguresFormat}{
newpage
phantomsection
addcontentsline{toc}{chapter}{LIST OF FIGURES}
addtocontents{lof}{protectafterpage{~hfill parmedskip}} %command to enable second page "PAGE" in toc, together with package{afterpage}
}
newcommand{TAMULofAddWordPage}{
if@ListStyle
addtocontents{lof}{protectafterpage{noindent{FIGURE}~hfill{Page}parmedskipvspace{-1ex}}} %command to enable second page "PAGE" in toc,
else
addtocontents{lof}{protectafterpage{~hfill{Page}parmedskipvspace{-1ex}}} %command to enable second page "PAGE" in toc,
fi
}
newcommand{TAMULotAddWordPage}{
if@ListStyle
addtocontents{lot}{protectafterpage{noindent{TABLE}~hfill{Page}parmedskipvspace{-1ex}}} %command to enable second page "PAGE" in toc,
%addtocontents{toc}{protectafterpage{~hfill parmedskip}} %command to enable second page "PAGE" in toc, together
%this is a manul way to do so, pleaer refer to http://www.latex-community.org/forum/viewtopic.php?f=5&t=252
else
addtocontents{lot}{protectafterpage{~hfill{Page}parmedskipvspace{-1ex}}} %command to enable second page "PAGE" in toc,
fi
}
newcommand{TAMUListOfTablesFormat}{
linespread{1}selectfont
newpage
phantomsection %optional for hyper-ref:
addcontentsline{toc}{chapter}{LIST OF TABLES}
%
%addtocontents{lot}{protectafterpage{{TABLE}~hfill{Page}parmedskip}} %command to enable second page "PAGE" in toc, together with package{afterpage}
%addtocontents{lot}{protectafterpage{~hfill{Page}parmedskip}} %command to enable second page "PAGE" in toc, together with package{afterpage}
}
newcommand{TAMUAbstractFormat}{
%cleardoublepage
phantomsection %optional for hyperref
%addtocontents{toc}{chapter}{protectnumberline{}Abstract}
addcontentsline{toc}{chapter}{ABSTRACT}
% begin{spacing}{2}
begin{center}
MakeUppercase{textbf{large Abstract}}
% MakeUppercase
end{center}
vspace{14pt}
}
newcommand{TAMUContributorFormat}{
%cleardoublepage
phantomsection %optional for hyperref
%addtocontents{toc}{chapter}{protectnumberline{}Contributors and Funding Sources}
addcontentsline{toc}{chapter}{CONTRIBUTORS AND FUNDING SOURCES}
% begin{spacing}{2}
begin{center}
MakeUppercase{textbf{large Contributors and Funding Sources}}
% MakeUppercase
end{center}
vspace{14pt}
}
newcommand{TAMUNomenclatureFormat}{
%cleardoublepage
%addtocontents{toc}{chapter}{protectnumberline{}Abstract
phantomsection %optional for hyperref
addcontentsline{toc}{chapter}{NOMENCLATURE}
begin{center}
MakeUppercase{textbf{large Nomenclature}}
end{center}
vspace{14pt}
}
newcommand{TAMUDedicationFormat}{
%cleardoublepage
phantomsection
%addtocontents{toc}{chapter}{protectnumberline{}Abstract
addcontentsline{toc}{chapter}{DEDICATION}
}
newcommand{TAMUAcknowledgmentFormat}{
phantomsection %optional for hyperref
addcontentsline{toc}{chapter}{ACKNOWLEDGMENTS}
begin{center}
MakeUppercase{textbf{large Acknowledgments}}
end{center}
vspace{14pt}
}
newcommand{TAMUReferenceFormat}{
newpage
phantomsection
addcontentsline{toc}{chapter}{REFERENCES}
}
newcommand{TAMUAppendixFormat}{
captionsetup{list=no} %disable figures/table to appear in lof/lot
renewcommand{thefigure}{Alph{chapter}.arabic{figure}} %fixed the bug caused by Figure/Table Continued, all appendix figure/table in appendix will be labeled as A.1, A.2, A.3...
renewcommand{thetable}{Alph{chapter}.arabic{table}} %fixed the bug caused by Figure/Table Continued, all appendix figure/table in appendix labeled as A.1, A.2
if@ChapterMethod
renewcommand{chaptertitlename}{APPENDIX} % some unknown bugs, comment this line will cause the Appendix title in main content becomes CHAPTER A instead of APPENDIX A
updatechaptername %this cmd is needed for chatper method to update toc title for appendix
fi
}
renewcommandmainmatter{
clearpage
pagenumbering{arabic}
linespread{2}selectfont
}
%end of hook definition
let@documentname@empty
let@degreename@empty
let@majorname@empty
let@ChairOfCommittee@empty
let@CoChairOfCommittee@empty
let@CommitteeMemberOne@empty
let@CommitteeMemberTwo@empty
let@CommitteeMemberThree@empty
let@CommitteeMemberFour@empty
let@HeadOfDepartment@empty
let@GraduateMonth@empty
let@GraduateYear@empty
let@GradMajor@empty
newcommand{TAMUdocument}[1]{def@documentname{#1}}TAMUdocument{Thesis/Dissertation/Record of Study}
def@TAMUdocument{@documentname}
newcommand{TAMUdegree}[1]{def@degreename{#1}}TAMUdegree{Master of Science}
def@TAMUdegree{@degreename}
newcommand{ChairOfCommitteeName}[1]{def@ChairOfCommittee{#1}}ChairOfCommitteeName{Chair's Name}
def@ChairOfCommitteeName{@ChairOfCommittee}
newcommand{CommitteeMemberOneName}[1]{def@CommitteeMemberOne{#1}}CommitteeMemberOneName{Committee Member One's Name}
def@CommitteeMemberOneName{@CommitteeMemberOne}
newcommand{CommitteeMemberTwoName}[1]{def@CommitteeMemberTwo{#1}}CommitteeMemberTwoName{Committee Member Two's Name}
def@CommitteeMemberTwoName{@CommitteeMemberTwo}
newcommand{HeadOfDepartmentName}[1]{def@HeadOfDepartment{#1}}HeadOfDepartmentName{Head Of Department's Name}
def@HeadOfDepartmentName{@HeadOfDepartment}
newcommand{CoChairOfCommitteeName}[1]{def@CoChairOfCommittee{#1}}
newcommand{CommitteeMemberThreeName}[1]{def@CommitteeMemberThree{#1}}
newcommand{CommitteeMemberFourName}[1]{def@CommitteeMemberFour{#1}}
newcommand{TAMUgradMonth}[1]{def@GraduateMonth{#1}}TAMUgradMonth{May/August/December}
def@TAMUgradMonth{@GraduateMonth}
newcommand{TAMUgradYear}[1]{def@GraduateYear{#1}}TAMUgradYear{20XX}
def@TAMUgradYear{@GraduateYear}
newcommand{TAMUmajor}[1]{def@GradMajor{#1}}TAMUmajor{Your Major}
def@TAMUmajor{@GradMajor}
renewcommandmaketitle{
begin{center}
begin{spacing}{2.1}
{largebfseries@titlepar}
vspace{17mm} par
A @documentname par
by par
MakeUppercase{@author} \
end{spacing}
vspace{8mm}par
{Submitted to the Office of Graduate and Professional Studies of par
Texas A&M University par
in partial fulfillment of the requirement for the degree of par
% vspace{9mm}
vspace{14pt}
MakeUppercase{@degreename}
}
end{center}
% vspace{6mm}
vspace{24pt}
begin{flushleft}
begin{tabular}{l l}
Chair of Committee, & @ChairOfCommittee \
%
ifx@CoChairOfCommittee@empty %
expandafter@firstoftwo
else %
expandafter@secondoftwo
fi %
{} %
{Co-Chair of Committee,& @CoChairOfCommittee \ }%
Committee Members, & @CommitteeMemberOne \
& @CommitteeMemberTwo \ %
ifx@CommitteeMemberThree@empty %
expandafter@firstoftwo
else %
expandafter@secondoftwo %
fi %
{} %
{ & @CommitteeMemberThree \} %
ifx@CommitteeMemberFour@empty %
expandafter@firstoftwo
else %
expandafter@secondoftwo %
fi %
{}%
{ & @CommitteeMemberFour \} %
%https://tex.stackexchange.com/questions/4072/how-to-display-some-text-based-on-a-condition-inside-a-tabular-environment
Head of Department, & @HeadOfDepartment \
end{tabular}
end{flushleft}
begin{center}
vspace{31pt} par
@GraduateMonth %August%December %
~ %
@GraduateYear % 20XX
%university requires that graduating data must be
par
vspace{40pt}
Major Subject: @GradMajor
par
vspace{42pt}
Copyright @GraduateYear %
~@author
end{center}
}
endinput
I apologize for the length of code.
templates line-spacing thesis
1
Welcome to TeX.SX! Where canTAMUthesis2.cls
be found?
– Christian Hupfer
Jul 26 '16 at 19:02
This page, howdy.me/template-download, V1.7, makes particular reference to fixing TOC spacing in the TAMU thesis template (though I cannot find reference toTAMUthesis2.cls
, onlyTAMUthesis.cls
at ogaps.tamu.edu/New-Current-Students/…)
– Steven B. Segletes
Jul 26 '16 at 19:29
That was for an older template version; I also apologize for the lack of TAMUthesis2.cls. I will include it as soon as I can.
– TheIncredibleZ1
Jul 26 '16 at 20:43
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I'm currently revising my university's thesis template, and I have almost everything fixed except for particular spacing issues. Our thesis manual states that long section titles must be single spaced, but even after enclosing the entire TOC in a singlespace environment, the long title still appears as double-spaced text. Using abbreviated titles are not allowed; titles must match in the table of contents and the body.
I've tried the fix outlined here but it just double spaced the entire table of contents. I'm currently fiddling with the class file to see if there's anything in there I can do.
MWE is below:
documentclass[SectionMethod, ListStyleI]{TAMUthesis2}
%documentclass[ChapterMethod, ListStyleI]{TAMUthesis2}
usepackage{amsthm}
usepackage[doublespacing]{setspace}
usepackage{tocloft}
%usepackage[labelsep=period]{caption}
numberwithin{equation}{chapter}
%FIX
sloppy
hfuzz=6pt
vfuzz=6pt
hbadness=2000
vbadness=maxdimen
%FIX
graphicspath{{graphic/}}
begin{document}
include{data/cover} %only store parameter
maketitle
frontmatter
include{data/Abstract}
include{data/Dedication}
include{data/Acknowledgment}
include{data/Contributors}
include{data/Nomenclature}
TAMUTableofContentsFormat
%The line below add Word `F` on next page Table of Content (TOC). To add the third page word `Page`, Please apply the same command below at appropriate position.
TAMUTocAddWordPage
begin{singlespace}
tableofcontents
end{singlespace}
TAMUListOfFiguresFormat
begin{singlespace}
listoffigures
end{singlespace}
TAMUListOfTablesFormat
%Uncomment the line below to add Word `Page' on next page of List of Figure
%TAMULotAddWordPage
begin{singlespace}
listoftables
end{singlespace}
mainmatter
include{data/chapterI}
include{data/chapterII}
include{data/chapterIII}
include{data/chapterIV}
%include{data/AnotherChapter}
TAMUReferenceFormat
bibliographystyle{ieeetr}
bibliography{myReference}
appendix
TAMUAppendixFormat
%comment the line below if using ChapterMethod or there is no Appendix
begin{appendices}
%keep this line always if you have appendix
include{data/Appendix}
%comment the line below if using ChapterMethod or no appendix
end{appendices}
end{document}
Here is the class file TAMUThesis2.cls
for which most was generated by the person that had this position last.
NeedsTeXFormat{LaTeX2e}
ProvidesClass{TAMUthesis2}[2016/07/15 Texas A&M University Thesis Template Version 2.07.16 based on book.cls]
newifif@ChapterMethod@ChapterMethodtrue
DeclareOption{ChapterMethod}{@ChapterMethodtrue}
DeclareOption{SectionMethod}{@ChapterMethodfalse}
%ExecuteOptions{ChapterMethod} %default is ChapterMethod
newifif@ListStyle@ListStyletrue
DeclareOption{ListStyleI}{@ListStyletrue}
DeclareOption{ListStyleII}{@ListStylefalse}
DeclareOption*{PassOptionsToClass{CurrentOption}{book}}
%ExecuteOptions{}
ProcessOptionsrelax
showboxdepth=5
showboxbreadth=5
RequirePackage{{lscape}}
RequirePackage{url}
RequirePackage{mathtools}
%RequirePackage{setspace}onehalfspacing
RequirePackage{adjustbox}
%newcommandblfootnote[1]{%
% begingroup
% renewcommandthefootnote{}footnote{#1}%
% addtocounter{footnote}{-1}%
% endgroup
%}
%setlength{overfullrule}{5pt}
%hfuzz=50pt
LoadClass[12pt, letterpaper,oneside]{book}
RequirePackage{textcomp}
RequirePackage[T1]{fontenc}
RequirePackage{arydshln}
RequirePackage{gensymb}
RequirePackage{listings}
lstset{basicstyle=ttfamilynormalsize}
RequirePackage{rotating,booktabs}
RequirePackage[xetex,bookmarks, hidelinks]{hyperref} % comment to disable hyper-link in table of contents
RequirePackage[flushleft]{threeparttable}
RequirePackage{color, graphicx} % Allows you to import images
RequirePackage{amsmath}
RequirePackage{multirow}
RequirePackage{booktabs}
RequirePackage[top=1.25in, bottom=1.25in, left=1.4in, right=1.15in]{geometry}
RequirePackage{caption}
RequirePackage{truncate}
DeclareRobustCommandCaption[2][130pt]{captionof{figure}{truncate{#1}{#2}}}
RequirePackage[T1]{fontenc}
RequirePackage{mathptmx}
RequirePackage{pdflscape}
RequirePackage{subcaption}
DeclareCaptionFormat{cont}{#1 continued #2#3par}
if@ChapterMethod
else
RequirePackage[titletoc,title]{appendix}
fi
RequirePackage{setspace}
%setstretch{1}
%linespread{1.6}
%font type
RequirePackage{fontspec}
%setmainfont{Arial} %change font style to Arial
setmainfont{Times New Roman}
renewcommand*large{fontsize{14.05}{14.05}selectfont} %fine tunement to adjust large to be 14pt exactly
%remove vertical space between itemize/enumerate/description
RequirePackage{enumitem}
%remove vertical space between items in itemize
setlist[itemize]{noitemsep, nolistsep}
setlist[enumerate]{noitemsep, nolistsep}
setlist[description]{noitemsep, nolistsep}
%indent after chapter/sectioin, only affect the first one
RequirePackage{indentfirst}
setlength{parindent}{1cm} %first indent
%Header/Footer Modification
RequirePackage{fancyhdr}
lhead{}
chead{}
rhead{}
%lfoot{}
%rfoot{thepage}
cfoot{thepage}
%fancyfoot[RO, LE]{thepage}
renewcommand{headrulewidth}{0pt}
RequirePackage{titlesec}
%modify section title font size
titleformat*{section}{normalfontbfseries}
titleformat*{subsection}{normalfontbfseries}
titleformat*{subsubsection}{normalfontbfseries}
titleformat*{paragraph}{normalfontbfseries}
if@ChapterMethod
%chapter title format
titleformat{chapter}[display]{largebfseriescentering}{chaptertitlename thechapter}{0pt}{large}
%modify chapter title name
renewcommand{chaptertitlename}{CHAPTER}
else
%chapter title format
titleformat{chapter}{vspace{1ex}largebfseriescentering}{thechapter}{1em}{large}
%modify chapter title name
%renewcommand{chaptertitlename}{CHAPTER}
fi
renewcommand{appendixname}{APPENDIX} % this command is overlapped by something else, I believe comment it won't cause any difference in APPENDIX title
renewcommand{bibname}{REFERENCES}
RequirePackage{tocloft}
%enable that toc has no section number, no subsection number as well
if@ChapterMethod
renewcommand{cftsecpresnum}{begin{lrbox}{@tempboxa}} %for section
renewcommand{cftsecaftersnum}{end{lrbox}} %for section
renewcommand{cftsubsecpresnum}{begin{lrbox}{@tempboxa}} %for subsection
renewcommand{cftsubsecaftersnum}{end{lrbox}} %for subsection
fi
addtocontents{toc}{linespread{1.4}selectfont}
%renewcommandcftbeforechapskip{0pt}
%renewcommandcftchapafterpnum{vskip14pt}
renewcommandcftbeforesecskip{-7pt}
%renewcommandcftsecafterpnum{vskip0pt}
renewcommandcftbeforesubsecskip{-7pt}
%renewcommandcftsubsecafterpnum{vskip0pt}
%redefine section to have 14pt space in first appearance at toc
renewcommandsection{@startsection{section}{2}{z@}%
{-3.25ex@plus -1ex @minus -0.2ex}%
{1.5ex @plus 0.2ex}%
{normalfontbfseries%
ifnumvalue{section}>1 else addtocontents{toc}{protectaddvspace{14pt}}fi}}
%add vertical space in lof to have equal space for each figure item
newcommand*{noaddvspace}{renewcommand*{addvspace}[1]{}}
addtocontents{lof}{protectnoaddvspace}
addtocontents{lot}{protectnoaddvspace}
addtocontents{lof}{linespread{2.1}selectfont}
%add vertical space in lof to have equal space for each figure item
addtocontents{lot}{linespread{2.1}selectfont}
RequirePackage{afterpage} %enable the "PAGE" or other information on the consequencing next page
if@ListStyle
%LIST STYLE I
addtocontents{toc}{~hfill {Page} par} %add "PAGE" to toc/lof/lot
%addtocontents{toc}{~hfill par} %double space of toc word `'Page' and the chapter title.
addtocontents{lof}{{FIGURE}~hfill {Page} par}
%addtocontents{lof}{~hfill par}
addtocontents{lot}{{TABLE}~hfill {Page} par}
%addtocontents{lot}{~hfill par}
else
%LIST STYLE II
addtocontents{lof}{~hfill {Page} par}
addtocontents{lot}{~hfill {Page} par}
%%list of figures with "FIGURE"
renewcommand{cftfigfont}{Figure ~}
renewcommand{cfttabfont}{Table ~}
fi
%modify the vertical space after title but before the content in toc/lof/lot
setlength{cftafterloftitleskip}{27pt}
setlength{cftafterlottitleskip}{27pt}
setlength{cftaftertoctitleskip}{33pt}
%toc title
renewcommand{cftchapfont}{normalfont}
renewcommand{cftchappagefont}{normalfont}
if@ChapterMethod
renewcommand{cftchappresnum}{CHAPTER }
renewcommand{cftchapnumwidth}{7em}
%Chapter Roman Numbering
renewcommandthechapter{Roman{chapter}}
else
%Chapter Arabic Numbering
renewcommandthechapter{arabic{chapter}}
fi
%leader dots in TABLE OF CONTENTS
renewcommand{cftpartleader}{cftdotfill{cftdotsep}} % for parts
renewcommand{cftchapleader}{cftdotfill{cftdotsep}} % for chapters
newcommand*updatechaptername{%
addtocontents{toc}{protectrenewcommand*protectcftchappresnum{@chapapp }}
}
%modify toc/lof/lot font size and align horizontal middle
renewcommand{cfttoctitlefont}{largebfseries}
renewcommand{cftloftitlefont}{largebfseries}
renewcommand{cftlottitlefont}{largebfseries}
renewcommand{contentsname}{centerline{TABLE OF CONTENTS}}
renewcommand{listfigurename}{centerline{LIST OF FIGURES}}
renewcommand{listtablename}{centerline{LIST OF TABLES}}
%remove the vertical spacing before toc/lof/lot
setlength{cftbeforetoctitleskip}{-6ex}
setlength{cftbeforeloftitleskip}{-5.5ex}
setlength{cftbeforelottitleskip}{-2.4ex}
%modify the horizontal spacing in lof/lot
setlength{cfttabnumwidth}{4em}
setlength{cftfignumwidth}{4em}
%remove the vertical space above CHAPTER title in each chapter, not toc
titlespacing*{chapter}{0pt}{-5.5ex}{6ex}
%modify the vertical space above/below section/subsection title in the main content, not toc.
titlespacing*{section}{0pt}{1ex}{0.5ex}
titlespacing*{subsection}{0pt}{1ex}{0.5ex}
titlespacing*{subsubsection}{0pt}{1ex}{0.5ex}
titlespacing*{paragraph}{0pt}{1ex}{0.5ex}
%%change equation vertical space
g@addto@macronormalsize{%
setlengthabovedisplayskip{0ex plus 1ex minus 1ex}
setlengthbelowdisplayskip{4pt plus 4pt minus 4pt}% plus 1ex minus 1ex}
setlengthabovedisplayshortskip{0ex plus 1ex minus 1ex}
setlengthbelowdisplayshortskip{4pt plus 4pt minus 4pt}%x plus 1ex minus 1ex}
}
%set figure/table display method to be Arabic.arabic instead of following chapter Roman Number.
renewcommand{thefigure}{arabic{chapter}.arabic{figure}}
renewcommand{thetable}{arabic{chapter}.arabic{table}}
renewcommand{theequation}{arabic{chapter}.arabic{equation}}
%new environment definition
newenvironment{Contfigure}{%
%renewcommand{thefigure}{Roman{chapter}.arabic{figure} Continued.}%
renewcommand{thefigure}{arabic{chapter}.arabic{figure} Continued.}%
addtocounter{figure}{-1}%
begin{figure}}{%
%renewcommand{thefigure}{Roman{chapter}.arabic{figure} }
renewcommand{thefigure}{arabic{chapter}.arabic{figure} }
end{figure}}
%new environment definition
newenvironment{Conttable}{%
%renewcommand{thetable}{Roman{chapter}.arabic{table} Continued.}%
renewcommand{thetable}{arabic{chapter}.arabic{table} Continued.}%
addtocounter{table}{-1}%
begin{table}}{%
%renewcommand{thetable}{Roman{chapter}.arabic{table} }
renewcommand{thetable}{arabic{chapter}.arabic{table}}
end{table}}
%command must be used when applying Contfigure and Conttable %captionsetup{list=no} %disable figures/table to appear in lof/lot
%%%%%%%%%%%%%%%%%
%hook definition
AtBeginDocument{
pagestyle{empty}
pagenumbering{roman}
}
renewcommandfrontmatter{
clearpage
setcounter{page}{2} %abstract page number starts from 2.
pagestyle{fancy}
linespread{2}selectfont
}
newcommand{TAMUTableofContentsFormat}{
addtocontents{toc}{protectafterpage{~hfill parmedskip}} %command to enable second page "PAGE" in toc, together with package{afterpage}
phantomsection
addcontentsline{toc}{chapter}{TABLE OF CONTENTS}
}
newcommand{TAMUTocAddWordPage}{
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
addtocontents{toc}{protectafterpage{~hfill{Page}parmedskipvspace{1ex}}} %command to enable second page "PAGE" in toc,
addtocontents{toc}{protectafterpage{~hfill parmedskip}} %command to enable second page "PAGE" in toc, together
%this is a manual way to do so, pleaer refer to http://www.latex-community.org/forum/viewtopic.php?f=5&t=252
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}
newcommand{TAMUListOfFiguresFormat}{
newpage
phantomsection
addcontentsline{toc}{chapter}{LIST OF FIGURES}
addtocontents{lof}{protectafterpage{~hfill parmedskip}} %command to enable second page "PAGE" in toc, together with package{afterpage}
}
newcommand{TAMULofAddWordPage}{
if@ListStyle
addtocontents{lof}{protectafterpage{noindent{FIGURE}~hfill{Page}parmedskipvspace{-1ex}}} %command to enable second page "PAGE" in toc,
else
addtocontents{lof}{protectafterpage{~hfill{Page}parmedskipvspace{-1ex}}} %command to enable second page "PAGE" in toc,
fi
}
newcommand{TAMULotAddWordPage}{
if@ListStyle
addtocontents{lot}{protectafterpage{noindent{TABLE}~hfill{Page}parmedskipvspace{-1ex}}} %command to enable second page "PAGE" in toc,
%addtocontents{toc}{protectafterpage{~hfill parmedskip}} %command to enable second page "PAGE" in toc, together
%this is a manul way to do so, pleaer refer to http://www.latex-community.org/forum/viewtopic.php?f=5&t=252
else
addtocontents{lot}{protectafterpage{~hfill{Page}parmedskipvspace{-1ex}}} %command to enable second page "PAGE" in toc,
fi
}
newcommand{TAMUListOfTablesFormat}{
linespread{1}selectfont
newpage
phantomsection %optional for hyper-ref:
addcontentsline{toc}{chapter}{LIST OF TABLES}
%
%addtocontents{lot}{protectafterpage{{TABLE}~hfill{Page}parmedskip}} %command to enable second page "PAGE" in toc, together with package{afterpage}
%addtocontents{lot}{protectafterpage{~hfill{Page}parmedskip}} %command to enable second page "PAGE" in toc, together with package{afterpage}
}
newcommand{TAMUAbstractFormat}{
%cleardoublepage
phantomsection %optional for hyperref
%addtocontents{toc}{chapter}{protectnumberline{}Abstract}
addcontentsline{toc}{chapter}{ABSTRACT}
% begin{spacing}{2}
begin{center}
MakeUppercase{textbf{large Abstract}}
% MakeUppercase
end{center}
vspace{14pt}
}
newcommand{TAMUContributorFormat}{
%cleardoublepage
phantomsection %optional for hyperref
%addtocontents{toc}{chapter}{protectnumberline{}Contributors and Funding Sources}
addcontentsline{toc}{chapter}{CONTRIBUTORS AND FUNDING SOURCES}
% begin{spacing}{2}
begin{center}
MakeUppercase{textbf{large Contributors and Funding Sources}}
% MakeUppercase
end{center}
vspace{14pt}
}
newcommand{TAMUNomenclatureFormat}{
%cleardoublepage
%addtocontents{toc}{chapter}{protectnumberline{}Abstract
phantomsection %optional for hyperref
addcontentsline{toc}{chapter}{NOMENCLATURE}
begin{center}
MakeUppercase{textbf{large Nomenclature}}
end{center}
vspace{14pt}
}
newcommand{TAMUDedicationFormat}{
%cleardoublepage
phantomsection
%addtocontents{toc}{chapter}{protectnumberline{}Abstract
addcontentsline{toc}{chapter}{DEDICATION}
}
newcommand{TAMUAcknowledgmentFormat}{
phantomsection %optional for hyperref
addcontentsline{toc}{chapter}{ACKNOWLEDGMENTS}
begin{center}
MakeUppercase{textbf{large Acknowledgments}}
end{center}
vspace{14pt}
}
newcommand{TAMUReferenceFormat}{
newpage
phantomsection
addcontentsline{toc}{chapter}{REFERENCES}
}
newcommand{TAMUAppendixFormat}{
captionsetup{list=no} %disable figures/table to appear in lof/lot
renewcommand{thefigure}{Alph{chapter}.arabic{figure}} %fixed the bug caused by Figure/Table Continued, all appendix figure/table in appendix will be labeled as A.1, A.2, A.3...
renewcommand{thetable}{Alph{chapter}.arabic{table}} %fixed the bug caused by Figure/Table Continued, all appendix figure/table in appendix labeled as A.1, A.2
if@ChapterMethod
renewcommand{chaptertitlename}{APPENDIX} % some unknown bugs, comment this line will cause the Appendix title in main content becomes CHAPTER A instead of APPENDIX A
updatechaptername %this cmd is needed for chatper method to update toc title for appendix
fi
}
renewcommandmainmatter{
clearpage
pagenumbering{arabic}
linespread{2}selectfont
}
%end of hook definition
let@documentname@empty
let@degreename@empty
let@majorname@empty
let@ChairOfCommittee@empty
let@CoChairOfCommittee@empty
let@CommitteeMemberOne@empty
let@CommitteeMemberTwo@empty
let@CommitteeMemberThree@empty
let@CommitteeMemberFour@empty
let@HeadOfDepartment@empty
let@GraduateMonth@empty
let@GraduateYear@empty
let@GradMajor@empty
newcommand{TAMUdocument}[1]{def@documentname{#1}}TAMUdocument{Thesis/Dissertation/Record of Study}
def@TAMUdocument{@documentname}
newcommand{TAMUdegree}[1]{def@degreename{#1}}TAMUdegree{Master of Science}
def@TAMUdegree{@degreename}
newcommand{ChairOfCommitteeName}[1]{def@ChairOfCommittee{#1}}ChairOfCommitteeName{Chair's Name}
def@ChairOfCommitteeName{@ChairOfCommittee}
newcommand{CommitteeMemberOneName}[1]{def@CommitteeMemberOne{#1}}CommitteeMemberOneName{Committee Member One's Name}
def@CommitteeMemberOneName{@CommitteeMemberOne}
newcommand{CommitteeMemberTwoName}[1]{def@CommitteeMemberTwo{#1}}CommitteeMemberTwoName{Committee Member Two's Name}
def@CommitteeMemberTwoName{@CommitteeMemberTwo}
newcommand{HeadOfDepartmentName}[1]{def@HeadOfDepartment{#1}}HeadOfDepartmentName{Head Of Department's Name}
def@HeadOfDepartmentName{@HeadOfDepartment}
newcommand{CoChairOfCommitteeName}[1]{def@CoChairOfCommittee{#1}}
newcommand{CommitteeMemberThreeName}[1]{def@CommitteeMemberThree{#1}}
newcommand{CommitteeMemberFourName}[1]{def@CommitteeMemberFour{#1}}
newcommand{TAMUgradMonth}[1]{def@GraduateMonth{#1}}TAMUgradMonth{May/August/December}
def@TAMUgradMonth{@GraduateMonth}
newcommand{TAMUgradYear}[1]{def@GraduateYear{#1}}TAMUgradYear{20XX}
def@TAMUgradYear{@GraduateYear}
newcommand{TAMUmajor}[1]{def@GradMajor{#1}}TAMUmajor{Your Major}
def@TAMUmajor{@GradMajor}
renewcommandmaketitle{
begin{center}
begin{spacing}{2.1}
{largebfseries@titlepar}
vspace{17mm} par
A @documentname par
by par
MakeUppercase{@author} \
end{spacing}
vspace{8mm}par
{Submitted to the Office of Graduate and Professional Studies of par
Texas A&M University par
in partial fulfillment of the requirement for the degree of par
% vspace{9mm}
vspace{14pt}
MakeUppercase{@degreename}
}
end{center}
% vspace{6mm}
vspace{24pt}
begin{flushleft}
begin{tabular}{l l}
Chair of Committee, & @ChairOfCommittee \
%
ifx@CoChairOfCommittee@empty %
expandafter@firstoftwo
else %
expandafter@secondoftwo
fi %
{} %
{Co-Chair of Committee,& @CoChairOfCommittee \ }%
Committee Members, & @CommitteeMemberOne \
& @CommitteeMemberTwo \ %
ifx@CommitteeMemberThree@empty %
expandafter@firstoftwo
else %
expandafter@secondoftwo %
fi %
{} %
{ & @CommitteeMemberThree \} %
ifx@CommitteeMemberFour@empty %
expandafter@firstoftwo
else %
expandafter@secondoftwo %
fi %
{}%
{ & @CommitteeMemberFour \} %
%https://tex.stackexchange.com/questions/4072/how-to-display-some-text-based-on-a-condition-inside-a-tabular-environment
Head of Department, & @HeadOfDepartment \
end{tabular}
end{flushleft}
begin{center}
vspace{31pt} par
@GraduateMonth %August%December %
~ %
@GraduateYear % 20XX
%university requires that graduating data must be
par
vspace{40pt}
Major Subject: @GradMajor
par
vspace{42pt}
Copyright @GraduateYear %
~@author
end{center}
}
endinput
I apologize for the length of code.
templates line-spacing thesis
I'm currently revising my university's thesis template, and I have almost everything fixed except for particular spacing issues. Our thesis manual states that long section titles must be single spaced, but even after enclosing the entire TOC in a singlespace environment, the long title still appears as double-spaced text. Using abbreviated titles are not allowed; titles must match in the table of contents and the body.
I've tried the fix outlined here but it just double spaced the entire table of contents. I'm currently fiddling with the class file to see if there's anything in there I can do.
MWE is below:
documentclass[SectionMethod, ListStyleI]{TAMUthesis2}
%documentclass[ChapterMethod, ListStyleI]{TAMUthesis2}
usepackage{amsthm}
usepackage[doublespacing]{setspace}
usepackage{tocloft}
%usepackage[labelsep=period]{caption}
numberwithin{equation}{chapter}
%FIX
sloppy
hfuzz=6pt
vfuzz=6pt
hbadness=2000
vbadness=maxdimen
%FIX
graphicspath{{graphic/}}
begin{document}
include{data/cover} %only store parameter
maketitle
frontmatter
include{data/Abstract}
include{data/Dedication}
include{data/Acknowledgment}
include{data/Contributors}
include{data/Nomenclature}
TAMUTableofContentsFormat
%The line below add Word `F` on next page Table of Content (TOC). To add the third page word `Page`, Please apply the same command below at appropriate position.
TAMUTocAddWordPage
begin{singlespace}
tableofcontents
end{singlespace}
TAMUListOfFiguresFormat
begin{singlespace}
listoffigures
end{singlespace}
TAMUListOfTablesFormat
%Uncomment the line below to add Word `Page' on next page of List of Figure
%TAMULotAddWordPage
begin{singlespace}
listoftables
end{singlespace}
mainmatter
include{data/chapterI}
include{data/chapterII}
include{data/chapterIII}
include{data/chapterIV}
%include{data/AnotherChapter}
TAMUReferenceFormat
bibliographystyle{ieeetr}
bibliography{myReference}
appendix
TAMUAppendixFormat
%comment the line below if using ChapterMethod or there is no Appendix
begin{appendices}
%keep this line always if you have appendix
include{data/Appendix}
%comment the line below if using ChapterMethod or no appendix
end{appendices}
end{document}
Here is the class file TAMUThesis2.cls
for which most was generated by the person that had this position last.
NeedsTeXFormat{LaTeX2e}
ProvidesClass{TAMUthesis2}[2016/07/15 Texas A&M University Thesis Template Version 2.07.16 based on book.cls]
newifif@ChapterMethod@ChapterMethodtrue
DeclareOption{ChapterMethod}{@ChapterMethodtrue}
DeclareOption{SectionMethod}{@ChapterMethodfalse}
%ExecuteOptions{ChapterMethod} %default is ChapterMethod
newifif@ListStyle@ListStyletrue
DeclareOption{ListStyleI}{@ListStyletrue}
DeclareOption{ListStyleII}{@ListStylefalse}
DeclareOption*{PassOptionsToClass{CurrentOption}{book}}
%ExecuteOptions{}
ProcessOptionsrelax
showboxdepth=5
showboxbreadth=5
RequirePackage{{lscape}}
RequirePackage{url}
RequirePackage{mathtools}
%RequirePackage{setspace}onehalfspacing
RequirePackage{adjustbox}
%newcommandblfootnote[1]{%
% begingroup
% renewcommandthefootnote{}footnote{#1}%
% addtocounter{footnote}{-1}%
% endgroup
%}
%setlength{overfullrule}{5pt}
%hfuzz=50pt
LoadClass[12pt, letterpaper,oneside]{book}
RequirePackage{textcomp}
RequirePackage[T1]{fontenc}
RequirePackage{arydshln}
RequirePackage{gensymb}
RequirePackage{listings}
lstset{basicstyle=ttfamilynormalsize}
RequirePackage{rotating,booktabs}
RequirePackage[xetex,bookmarks, hidelinks]{hyperref} % comment to disable hyper-link in table of contents
RequirePackage[flushleft]{threeparttable}
RequirePackage{color, graphicx} % Allows you to import images
RequirePackage{amsmath}
RequirePackage{multirow}
RequirePackage{booktabs}
RequirePackage[top=1.25in, bottom=1.25in, left=1.4in, right=1.15in]{geometry}
RequirePackage{caption}
RequirePackage{truncate}
DeclareRobustCommandCaption[2][130pt]{captionof{figure}{truncate{#1}{#2}}}
RequirePackage[T1]{fontenc}
RequirePackage{mathptmx}
RequirePackage{pdflscape}
RequirePackage{subcaption}
DeclareCaptionFormat{cont}{#1 continued #2#3par}
if@ChapterMethod
else
RequirePackage[titletoc,title]{appendix}
fi
RequirePackage{setspace}
%setstretch{1}
%linespread{1.6}
%font type
RequirePackage{fontspec}
%setmainfont{Arial} %change font style to Arial
setmainfont{Times New Roman}
renewcommand*large{fontsize{14.05}{14.05}selectfont} %fine tunement to adjust large to be 14pt exactly
%remove vertical space between itemize/enumerate/description
RequirePackage{enumitem}
%remove vertical space between items in itemize
setlist[itemize]{noitemsep, nolistsep}
setlist[enumerate]{noitemsep, nolistsep}
setlist[description]{noitemsep, nolistsep}
%indent after chapter/sectioin, only affect the first one
RequirePackage{indentfirst}
setlength{parindent}{1cm} %first indent
%Header/Footer Modification
RequirePackage{fancyhdr}
lhead{}
chead{}
rhead{}
%lfoot{}
%rfoot{thepage}
cfoot{thepage}
%fancyfoot[RO, LE]{thepage}
renewcommand{headrulewidth}{0pt}
RequirePackage{titlesec}
%modify section title font size
titleformat*{section}{normalfontbfseries}
titleformat*{subsection}{normalfontbfseries}
titleformat*{subsubsection}{normalfontbfseries}
titleformat*{paragraph}{normalfontbfseries}
if@ChapterMethod
%chapter title format
titleformat{chapter}[display]{largebfseriescentering}{chaptertitlename thechapter}{0pt}{large}
%modify chapter title name
renewcommand{chaptertitlename}{CHAPTER}
else
%chapter title format
titleformat{chapter}{vspace{1ex}largebfseriescentering}{thechapter}{1em}{large}
%modify chapter title name
%renewcommand{chaptertitlename}{CHAPTER}
fi
renewcommand{appendixname}{APPENDIX} % this command is overlapped by something else, I believe comment it won't cause any difference in APPENDIX title
renewcommand{bibname}{REFERENCES}
RequirePackage{tocloft}
%enable that toc has no section number, no subsection number as well
if@ChapterMethod
renewcommand{cftsecpresnum}{begin{lrbox}{@tempboxa}} %for section
renewcommand{cftsecaftersnum}{end{lrbox}} %for section
renewcommand{cftsubsecpresnum}{begin{lrbox}{@tempboxa}} %for subsection
renewcommand{cftsubsecaftersnum}{end{lrbox}} %for subsection
fi
addtocontents{toc}{linespread{1.4}selectfont}
%renewcommandcftbeforechapskip{0pt}
%renewcommandcftchapafterpnum{vskip14pt}
renewcommandcftbeforesecskip{-7pt}
%renewcommandcftsecafterpnum{vskip0pt}
renewcommandcftbeforesubsecskip{-7pt}
%renewcommandcftsubsecafterpnum{vskip0pt}
%redefine section to have 14pt space in first appearance at toc
renewcommandsection{@startsection{section}{2}{z@}%
{-3.25ex@plus -1ex @minus -0.2ex}%
{1.5ex @plus 0.2ex}%
{normalfontbfseries%
ifnumvalue{section}>1 else addtocontents{toc}{protectaddvspace{14pt}}fi}}
%add vertical space in lof to have equal space for each figure item
newcommand*{noaddvspace}{renewcommand*{addvspace}[1]{}}
addtocontents{lof}{protectnoaddvspace}
addtocontents{lot}{protectnoaddvspace}
addtocontents{lof}{linespread{2.1}selectfont}
%add vertical space in lof to have equal space for each figure item
addtocontents{lot}{linespread{2.1}selectfont}
RequirePackage{afterpage} %enable the "PAGE" or other information on the consequencing next page
if@ListStyle
%LIST STYLE I
addtocontents{toc}{~hfill {Page} par} %add "PAGE" to toc/lof/lot
%addtocontents{toc}{~hfill par} %double space of toc word `'Page' and the chapter title.
addtocontents{lof}{{FIGURE}~hfill {Page} par}
%addtocontents{lof}{~hfill par}
addtocontents{lot}{{TABLE}~hfill {Page} par}
%addtocontents{lot}{~hfill par}
else
%LIST STYLE II
addtocontents{lof}{~hfill {Page} par}
addtocontents{lot}{~hfill {Page} par}
%%list of figures with "FIGURE"
renewcommand{cftfigfont}{Figure ~}
renewcommand{cfttabfont}{Table ~}
fi
%modify the vertical space after title but before the content in toc/lof/lot
setlength{cftafterloftitleskip}{27pt}
setlength{cftafterlottitleskip}{27pt}
setlength{cftaftertoctitleskip}{33pt}
%toc title
renewcommand{cftchapfont}{normalfont}
renewcommand{cftchappagefont}{normalfont}
if@ChapterMethod
renewcommand{cftchappresnum}{CHAPTER }
renewcommand{cftchapnumwidth}{7em}
%Chapter Roman Numbering
renewcommandthechapter{Roman{chapter}}
else
%Chapter Arabic Numbering
renewcommandthechapter{arabic{chapter}}
fi
%leader dots in TABLE OF CONTENTS
renewcommand{cftpartleader}{cftdotfill{cftdotsep}} % for parts
renewcommand{cftchapleader}{cftdotfill{cftdotsep}} % for chapters
newcommand*updatechaptername{%
addtocontents{toc}{protectrenewcommand*protectcftchappresnum{@chapapp }}
}
%modify toc/lof/lot font size and align horizontal middle
renewcommand{cfttoctitlefont}{largebfseries}
renewcommand{cftloftitlefont}{largebfseries}
renewcommand{cftlottitlefont}{largebfseries}
renewcommand{contentsname}{centerline{TABLE OF CONTENTS}}
renewcommand{listfigurename}{centerline{LIST OF FIGURES}}
renewcommand{listtablename}{centerline{LIST OF TABLES}}
%remove the vertical spacing before toc/lof/lot
setlength{cftbeforetoctitleskip}{-6ex}
setlength{cftbeforeloftitleskip}{-5.5ex}
setlength{cftbeforelottitleskip}{-2.4ex}
%modify the horizontal spacing in lof/lot
setlength{cfttabnumwidth}{4em}
setlength{cftfignumwidth}{4em}
%remove the vertical space above CHAPTER title in each chapter, not toc
titlespacing*{chapter}{0pt}{-5.5ex}{6ex}
%modify the vertical space above/below section/subsection title in the main content, not toc.
titlespacing*{section}{0pt}{1ex}{0.5ex}
titlespacing*{subsection}{0pt}{1ex}{0.5ex}
titlespacing*{subsubsection}{0pt}{1ex}{0.5ex}
titlespacing*{paragraph}{0pt}{1ex}{0.5ex}
%%change equation vertical space
g@addto@macronormalsize{%
setlengthabovedisplayskip{0ex plus 1ex minus 1ex}
setlengthbelowdisplayskip{4pt plus 4pt minus 4pt}% plus 1ex minus 1ex}
setlengthabovedisplayshortskip{0ex plus 1ex minus 1ex}
setlengthbelowdisplayshortskip{4pt plus 4pt minus 4pt}%x plus 1ex minus 1ex}
}
%set figure/table display method to be Arabic.arabic instead of following chapter Roman Number.
renewcommand{thefigure}{arabic{chapter}.arabic{figure}}
renewcommand{thetable}{arabic{chapter}.arabic{table}}
renewcommand{theequation}{arabic{chapter}.arabic{equation}}
%new environment definition
newenvironment{Contfigure}{%
%renewcommand{thefigure}{Roman{chapter}.arabic{figure} Continued.}%
renewcommand{thefigure}{arabic{chapter}.arabic{figure} Continued.}%
addtocounter{figure}{-1}%
begin{figure}}{%
%renewcommand{thefigure}{Roman{chapter}.arabic{figure} }
renewcommand{thefigure}{arabic{chapter}.arabic{figure} }
end{figure}}
%new environment definition
newenvironment{Conttable}{%
%renewcommand{thetable}{Roman{chapter}.arabic{table} Continued.}%
renewcommand{thetable}{arabic{chapter}.arabic{table} Continued.}%
addtocounter{table}{-1}%
begin{table}}{%
%renewcommand{thetable}{Roman{chapter}.arabic{table} }
renewcommand{thetable}{arabic{chapter}.arabic{table}}
end{table}}
%command must be used when applying Contfigure and Conttable %captionsetup{list=no} %disable figures/table to appear in lof/lot
%%%%%%%%%%%%%%%%%
%hook definition
AtBeginDocument{
pagestyle{empty}
pagenumbering{roman}
}
renewcommandfrontmatter{
clearpage
setcounter{page}{2} %abstract page number starts from 2.
pagestyle{fancy}
linespread{2}selectfont
}
newcommand{TAMUTableofContentsFormat}{
addtocontents{toc}{protectafterpage{~hfill parmedskip}} %command to enable second page "PAGE" in toc, together with package{afterpage}
phantomsection
addcontentsline{toc}{chapter}{TABLE OF CONTENTS}
}
newcommand{TAMUTocAddWordPage}{
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
addtocontents{toc}{protectafterpage{~hfill{Page}parmedskipvspace{1ex}}} %command to enable second page "PAGE" in toc,
addtocontents{toc}{protectafterpage{~hfill parmedskip}} %command to enable second page "PAGE" in toc, together
%this is a manual way to do so, pleaer refer to http://www.latex-community.org/forum/viewtopic.php?f=5&t=252
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}
newcommand{TAMUListOfFiguresFormat}{
newpage
phantomsection
addcontentsline{toc}{chapter}{LIST OF FIGURES}
addtocontents{lof}{protectafterpage{~hfill parmedskip}} %command to enable second page "PAGE" in toc, together with package{afterpage}
}
newcommand{TAMULofAddWordPage}{
if@ListStyle
addtocontents{lof}{protectafterpage{noindent{FIGURE}~hfill{Page}parmedskipvspace{-1ex}}} %command to enable second page "PAGE" in toc,
else
addtocontents{lof}{protectafterpage{~hfill{Page}parmedskipvspace{-1ex}}} %command to enable second page "PAGE" in toc,
fi
}
newcommand{TAMULotAddWordPage}{
if@ListStyle
addtocontents{lot}{protectafterpage{noindent{TABLE}~hfill{Page}parmedskipvspace{-1ex}}} %command to enable second page "PAGE" in toc,
%addtocontents{toc}{protectafterpage{~hfill parmedskip}} %command to enable second page "PAGE" in toc, together
%this is a manul way to do so, pleaer refer to http://www.latex-community.org/forum/viewtopic.php?f=5&t=252
else
addtocontents{lot}{protectafterpage{~hfill{Page}parmedskipvspace{-1ex}}} %command to enable second page "PAGE" in toc,
fi
}
newcommand{TAMUListOfTablesFormat}{
linespread{1}selectfont
newpage
phantomsection %optional for hyper-ref:
addcontentsline{toc}{chapter}{LIST OF TABLES}
%
%addtocontents{lot}{protectafterpage{{TABLE}~hfill{Page}parmedskip}} %command to enable second page "PAGE" in toc, together with package{afterpage}
%addtocontents{lot}{protectafterpage{~hfill{Page}parmedskip}} %command to enable second page "PAGE" in toc, together with package{afterpage}
}
newcommand{TAMUAbstractFormat}{
%cleardoublepage
phantomsection %optional for hyperref
%addtocontents{toc}{chapter}{protectnumberline{}Abstract}
addcontentsline{toc}{chapter}{ABSTRACT}
% begin{spacing}{2}
begin{center}
MakeUppercase{textbf{large Abstract}}
% MakeUppercase
end{center}
vspace{14pt}
}
newcommand{TAMUContributorFormat}{
%cleardoublepage
phantomsection %optional for hyperref
%addtocontents{toc}{chapter}{protectnumberline{}Contributors and Funding Sources}
addcontentsline{toc}{chapter}{CONTRIBUTORS AND FUNDING SOURCES}
% begin{spacing}{2}
begin{center}
MakeUppercase{textbf{large Contributors and Funding Sources}}
% MakeUppercase
end{center}
vspace{14pt}
}
newcommand{TAMUNomenclatureFormat}{
%cleardoublepage
%addtocontents{toc}{chapter}{protectnumberline{}Abstract
phantomsection %optional for hyperref
addcontentsline{toc}{chapter}{NOMENCLATURE}
begin{center}
MakeUppercase{textbf{large Nomenclature}}
end{center}
vspace{14pt}
}
newcommand{TAMUDedicationFormat}{
%cleardoublepage
phantomsection
%addtocontents{toc}{chapter}{protectnumberline{}Abstract
addcontentsline{toc}{chapter}{DEDICATION}
}
newcommand{TAMUAcknowledgmentFormat}{
phantomsection %optional for hyperref
addcontentsline{toc}{chapter}{ACKNOWLEDGMENTS}
begin{center}
MakeUppercase{textbf{large Acknowledgments}}
end{center}
vspace{14pt}
}
newcommand{TAMUReferenceFormat}{
newpage
phantomsection
addcontentsline{toc}{chapter}{REFERENCES}
}
newcommand{TAMUAppendixFormat}{
captionsetup{list=no} %disable figures/table to appear in lof/lot
renewcommand{thefigure}{Alph{chapter}.arabic{figure}} %fixed the bug caused by Figure/Table Continued, all appendix figure/table in appendix will be labeled as A.1, A.2, A.3...
renewcommand{thetable}{Alph{chapter}.arabic{table}} %fixed the bug caused by Figure/Table Continued, all appendix figure/table in appendix labeled as A.1, A.2
if@ChapterMethod
renewcommand{chaptertitlename}{APPENDIX} % some unknown bugs, comment this line will cause the Appendix title in main content becomes CHAPTER A instead of APPENDIX A
updatechaptername %this cmd is needed for chatper method to update toc title for appendix
fi
}
renewcommandmainmatter{
clearpage
pagenumbering{arabic}
linespread{2}selectfont
}
%end of hook definition
let@documentname@empty
let@degreename@empty
let@majorname@empty
let@ChairOfCommittee@empty
let@CoChairOfCommittee@empty
let@CommitteeMemberOne@empty
let@CommitteeMemberTwo@empty
let@CommitteeMemberThree@empty
let@CommitteeMemberFour@empty
let@HeadOfDepartment@empty
let@GraduateMonth@empty
let@GraduateYear@empty
let@GradMajor@empty
newcommand{TAMUdocument}[1]{def@documentname{#1}}TAMUdocument{Thesis/Dissertation/Record of Study}
def@TAMUdocument{@documentname}
newcommand{TAMUdegree}[1]{def@degreename{#1}}TAMUdegree{Master of Science}
def@TAMUdegree{@degreename}
newcommand{ChairOfCommitteeName}[1]{def@ChairOfCommittee{#1}}ChairOfCommitteeName{Chair's Name}
def@ChairOfCommitteeName{@ChairOfCommittee}
newcommand{CommitteeMemberOneName}[1]{def@CommitteeMemberOne{#1}}CommitteeMemberOneName{Committee Member One's Name}
def@CommitteeMemberOneName{@CommitteeMemberOne}
newcommand{CommitteeMemberTwoName}[1]{def@CommitteeMemberTwo{#1}}CommitteeMemberTwoName{Committee Member Two's Name}
def@CommitteeMemberTwoName{@CommitteeMemberTwo}
newcommand{HeadOfDepartmentName}[1]{def@HeadOfDepartment{#1}}HeadOfDepartmentName{Head Of Department's Name}
def@HeadOfDepartmentName{@HeadOfDepartment}
newcommand{CoChairOfCommitteeName}[1]{def@CoChairOfCommittee{#1}}
newcommand{CommitteeMemberThreeName}[1]{def@CommitteeMemberThree{#1}}
newcommand{CommitteeMemberFourName}[1]{def@CommitteeMemberFour{#1}}
newcommand{TAMUgradMonth}[1]{def@GraduateMonth{#1}}TAMUgradMonth{May/August/December}
def@TAMUgradMonth{@GraduateMonth}
newcommand{TAMUgradYear}[1]{def@GraduateYear{#1}}TAMUgradYear{20XX}
def@TAMUgradYear{@GraduateYear}
newcommand{TAMUmajor}[1]{def@GradMajor{#1}}TAMUmajor{Your Major}
def@TAMUmajor{@GradMajor}
renewcommandmaketitle{
begin{center}
begin{spacing}{2.1}
{largebfseries@titlepar}
vspace{17mm} par
A @documentname par
by par
MakeUppercase{@author} \
end{spacing}
vspace{8mm}par
{Submitted to the Office of Graduate and Professional Studies of par
Texas A&M University par
in partial fulfillment of the requirement for the degree of par
% vspace{9mm}
vspace{14pt}
MakeUppercase{@degreename}
}
end{center}
% vspace{6mm}
vspace{24pt}
begin{flushleft}
begin{tabular}{l l}
Chair of Committee, & @ChairOfCommittee \
%
ifx@CoChairOfCommittee@empty %
expandafter@firstoftwo
else %
expandafter@secondoftwo
fi %
{} %
{Co-Chair of Committee,& @CoChairOfCommittee \ }%
Committee Members, & @CommitteeMemberOne \
& @CommitteeMemberTwo \ %
ifx@CommitteeMemberThree@empty %
expandafter@firstoftwo
else %
expandafter@secondoftwo %
fi %
{} %
{ & @CommitteeMemberThree \} %
ifx@CommitteeMemberFour@empty %
expandafter@firstoftwo
else %
expandafter@secondoftwo %
fi %
{}%
{ & @CommitteeMemberFour \} %
%https://tex.stackexchange.com/questions/4072/how-to-display-some-text-based-on-a-condition-inside-a-tabular-environment
Head of Department, & @HeadOfDepartment \
end{tabular}
end{flushleft}
begin{center}
vspace{31pt} par
@GraduateMonth %August%December %
~ %
@GraduateYear % 20XX
%university requires that graduating data must be
par
vspace{40pt}
Major Subject: @GradMajor
par
vspace{42pt}
Copyright @GraduateYear %
~@author
end{center}
}
endinput
I apologize for the length of code.
templates line-spacing thesis
templates line-spacing thesis
edited Apr 13 '17 at 12:35
Community♦
1
1
asked Jul 26 '16 at 18:29
TheIncredibleZ1
1538
1538
1
Welcome to TeX.SX! Where canTAMUthesis2.cls
be found?
– Christian Hupfer
Jul 26 '16 at 19:02
This page, howdy.me/template-download, V1.7, makes particular reference to fixing TOC spacing in the TAMU thesis template (though I cannot find reference toTAMUthesis2.cls
, onlyTAMUthesis.cls
at ogaps.tamu.edu/New-Current-Students/…)
– Steven B. Segletes
Jul 26 '16 at 19:29
That was for an older template version; I also apologize for the lack of TAMUthesis2.cls. I will include it as soon as I can.
– TheIncredibleZ1
Jul 26 '16 at 20:43
add a comment |
1
Welcome to TeX.SX! Where canTAMUthesis2.cls
be found?
– Christian Hupfer
Jul 26 '16 at 19:02
This page, howdy.me/template-download, V1.7, makes particular reference to fixing TOC spacing in the TAMU thesis template (though I cannot find reference toTAMUthesis2.cls
, onlyTAMUthesis.cls
at ogaps.tamu.edu/New-Current-Students/…)
– Steven B. Segletes
Jul 26 '16 at 19:29
That was for an older template version; I also apologize for the lack of TAMUthesis2.cls. I will include it as soon as I can.
– TheIncredibleZ1
Jul 26 '16 at 20:43
1
1
Welcome to TeX.SX! Where can
TAMUthesis2.cls
be found?– Christian Hupfer
Jul 26 '16 at 19:02
Welcome to TeX.SX! Where can
TAMUthesis2.cls
be found?– Christian Hupfer
Jul 26 '16 at 19:02
This page, howdy.me/template-download, V1.7, makes particular reference to fixing TOC spacing in the TAMU thesis template (though I cannot find reference to
TAMUthesis2.cls
, only TAMUthesis.cls
at ogaps.tamu.edu/New-Current-Students/…)– Steven B. Segletes
Jul 26 '16 at 19:29
This page, howdy.me/template-download, V1.7, makes particular reference to fixing TOC spacing in the TAMU thesis template (though I cannot find reference to
TAMUthesis2.cls
, only TAMUthesis.cls
at ogaps.tamu.edu/New-Current-Students/…)– Steven B. Segletes
Jul 26 '16 at 19:29
That was for an older template version; I also apologize for the lack of TAMUthesis2.cls. I will include it as soon as I can.
– TheIncredibleZ1
Jul 26 '16 at 20:43
That was for an older template version; I also apologize for the lack of TAMUthesis2.cls. I will include it as soon as I can.
– TheIncredibleZ1
Jul 26 '16 at 20:43
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f321089%2fhow-can-i-single-space-long-titles-in-my-table-of-contents-and-list-of-figures-t%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Welcome to TeX.SX! Where can
TAMUthesis2.cls
be found?– Christian Hupfer
Jul 26 '16 at 19:02
This page, howdy.me/template-download, V1.7, makes particular reference to fixing TOC spacing in the TAMU thesis template (though I cannot find reference to
TAMUthesis2.cls
, onlyTAMUthesis.cls
at ogaps.tamu.edu/New-Current-Students/…)– Steven B. Segletes
Jul 26 '16 at 19:29
That was for an older template version; I also apologize for the lack of TAMUthesis2.cls. I will include it as soon as I can.
– TheIncredibleZ1
Jul 26 '16 at 20:43