0

I'm trying to make a title page within a class for future use within my university. I want users to be able to set the title in the main.tex, and then the custom.cls will make it larger and uppercase, while keeping the formatting of line breaks. I used \uppercase on the variable, but it ignores it, as well as the \large that it is encased in. How can I fix this?

The custom .cls:

\NeedsTeXFormat{LaTeX2e}[1996/12/01]
\ProvidesClass{UMLThesis}[2018/05/09]
\LoadClass[12pt,letterpaper,oneside,openright]{book}

%% ===================================================================================================
\usepackage{calc}
\usepackage{setspace}
\usepackage{vmargin}
\usepackage{ragged2e}

%% ===================================================================================================
\newlength{\remaining}
\newcommand{\supervisorSig}[1]{%
    \justifying
    \begin{singlespacing}
        \setlength{\remaining}{\textwidth-\widthof{\textbf{Signature of Thesis Supervisor: }}}
        \noindent \textbf{Signature of Thesis Supervisor:  }\underline{\hspace{\remaining}}\par
        \setlength{\remaining}{\textwidth-\widthof{\textbf{Name Typed:}\quad\quad\quad\quad#1}}
        \noindent \textbf{Name Typed:}\quad\quad\quad\quad\underline{#1\hspace{\remaining}}\par
        \vspace{2\baselineskip}
        \noindent \textbf{Signatures of Other Thesis Committee Members:}\par
    \end{singlespacing}
}

%% ===================================================================================================
\newcommand{\committeeMember}[1]{%
    \justifying
    \begin{singlespacing}
        \setlength{\remaining}{\textwidth-\widthof{\small \textbf{Committee Member Signature: }}}
        \noindent \textbf{Committee Member Signature: }\underline{\hspace{\remaining}} \par
        \setlength{\remaining}{\textwidth-\widthof{\small \textbf{Name Typed:}\quad\quad\quad\quad#1}}
        \noindent \textbf{Name Typed:}\quad\quad\quad\quad\underline{#1\hspace{\remaining}}\par
    \end{singlespacing}
}

\newcommand{\prevDegree}[3]{%
    #1 \uppercase{#2} (#3)}

%% ===================================================================================================
\newlength{\authline}
\newlength{\autharea}
\newlength{\dateline}
\newcommand\SignaturePage[6]{%
    \thispagestyle{empty}
    \begin{singlespacing}
        \vspace*{0.5 in}
        \uppercase{%
            \centering
            % Title of thesis
            \large{\uppercase{#1}} \par
            %Author section, and previous degrees
            \normalsize{\vspace{2\baselineskip} \par BY \vspace{2\baselineskip} \par \MakeUppercase{\authornames} \par #2 \vspace{3\baselineskip} \par
            submitted in partial fulfillment of the requirements \par
            % degree title
            for the degree of \MakeUppercase{\degreeName} \par
            % department name
            \MakeUppercase{\deptName} \par
            \MakeUppercase{\univName} \par}}
    \end{singlespacing}
    \vfill

    \small{%
        \setlength{\authline}{3.75 in-\widthof{\small{\textbf{Author:} }}}
        \setlength{\autharea}{\widthof{\small{\textbf{Author:} }}+\authline}
        \setlength{\dateline}{5.75 in-\autharea-\widthof{\small{ \textbf{Date:} }}}

        \justifying

        \begin{singlespacing}
            \noindent \textbf{Signature of} \par
            \noindent \textbf{Author:} \underline{\hspace{\authline}} \textbf{Date:} \underline{\hspace{\dateline} } \par
        \end{singlespacing}
        \noindent #3
        \committeeMember{#4}
        \committeeMember{#5}
        \committeeMember{#6} }
\cleardoublepage}

%% ===================================================================================================
\newcommand*{\titleF}[1]{\newcommand{\titleFmat}{#1}}
\newcommand*{\authors}[1]{\newcommand{\authornames}{#1}}
\newcommand*{\faculty}[2]{\newcommand{\facName}{#1}\newcommand{\facTitle}    {#2}}
\newcommand*{\degree}[2]{\newcommand{\degreeNameShort}{#1}\newcommand{\degreeName}{#2}}
\newcommand*{\department}[1]{\newcommand{\deptName}{#1}}
\newcommand*{\university}[1]{\newcommand{\univName}{#1}}

%% ===================================================================================================
\doublespacing
\setmarginsrb           { 1.5in}  % left margin
                        { 1.0in}  % top margin
                        { 1.0in}  % right margin
                        { 1.0in}  % bottom margin
                        {  20pt}  % head height
                        {0.25in}  % head sep
                        {   9pt}  % foot height
                        { 0.3in}  % foot sep

A MWE .tex

\documentclass[letterpaper, 12pt, oneside]{UMLThesis}

\begin{document}
\frontmatter      % Begin Roman style (i, ii, iii, iv...) page numbering

% Set up the Title Page
\titleF     {This is a formattable \\ thesis title, and seems to \\ work without error}
\authors    {My name} %call with \authorNames
\faculty    {My PI}{King professor guy} %call with \facName and \facTitle
\department {Department within College} %call with \depName
\degree     {M.S.}{Masters of Science} %call with \degreeNameShort and \degreeName
\university {University of Massachusetts Lowell} %call with \univName

% Define the page headers using the FancyHdr package and set up for one-sided printing

\SignaturePage{%
%        Manually labeling the \\ manually spaced \\ title page % this line does not cause errors and looks correct
        \titleFmat % This ignores the encased formatting
    }{%
        % Input your previous degrees from least to most prestigious using the \prevdegree{abbreviation}{university}{year} function as show, and '\\' as manual line breaks between each degree
        \prevDegree{B.S.}{University of Massachusetts Lowell}{2014} 
    }{%
        % Create the signatures
        \supervisorSig{\ } % Use this for a master's thesis
        %\dissertationSig{\facName, Ph.D.} % Use this for a doctorate thesis
    }{%
        % First committee member
        \
    }{%
        % Second committee member
        \ 
    }{%
        % Third committee member
        \ 
    }
\clearpage  % Declaration ended, now start a new page

\mainmatter

\end{document}
5
  • as I mentioned in the last question the outer \uppercase shouldn't be there and the inner one added thos time should be \MakeUppercase (\uppercase doesn't expand its argument and isn't suitable for natural language text, unless you can guarantee no accented letters) May 9, 2018 at 18:30
  • you still have size commands using the wrong syntax \large{\uppercase{#1}} makes the rest of the document \large unless stopped by an outer group or another size command. May 9, 2018 at 18:32
  • It seems that using \small{...} versus {\small ...} doesn't affect the document, but maybe that's because sharelatex is doing some extra work. Either way I've changed it to the latter. {\large \MakeUppercase{#1}} however does not make the text large or uppercase unless I use `\protect\` in line 7 of the .tex, which I am hoping to avoid doing altogether to simplify usage of the .cls
    – Ronen
    May 9, 2018 at 18:54
  • no sharelatex is a standard latex system, the syntax is wrong, \small {foo} id the same as \small foo (try removing the braces and see) that is why you need \normalsize{ to compensate for the mis use of \large on the previous line. if you need to uppercase things then fragile commands will need \protect but \\ is normally robust. May 9, 2018 at 19:01
  • I take it single space and double space are University requirements, as they are intended for typewriters, not typesetters. You can avoid a lot of problems by adjusting \baselineskip instead. May 9, 2018 at 22:52

1 Answer 1

1

Still seems over complicated but I fixed the main issues with mis-use of uppercase and size commands, and made \\ robust in the scope of \centering

enter image description here

\NeedsTeXFormat{LaTeX2e}[1996/12/01]
\ProvidesClass{UMLThesis}[2018/05/09]
\LoadClass[12pt,letterpaper,oneside,openright]{book}

%% ===================================================================================================
\usepackage{calc}
\usepackage{setspace}
\usepackage{vmargin}
\usepackage{ragged2e}

%% ===================================================================================================
\newlength{\remaining}
\newcommand{\supervisorSig}[1]{%
    \justifying
    \begin{singlespacing}
        \setlength{\remaining}{\textwidth-\widthof{\textbf{Signature of Thesis Supervisor: }}}
        \noindent \textbf{Signature of Thesis Supervisor:  }\underline{\hspace{\remaining}}\par
        \setlength{\remaining}{\textwidth-\widthof{\textbf{Name Typed:}\quad\quad\quad\quad#1}}
        \noindent \textbf{Name Typed:}\quad\quad\quad\quad\underline{#1\hspace{\remaining}}\par
        \vspace{2\baselineskip}
        \noindent \textbf{Signatures of Other Thesis Committee Members:}\par
    \end{singlespacing}
}

%% ===================================================================================================
\newcommand{\committeeMember}[1]{%
    \justifying
    \begin{singlespacing}
        \setlength{\remaining}{\textwidth-\widthof{\small \textbf{Committee Member Signature: }}}
        \noindent \textbf{Committee Member Signature: }\underline{\hspace{\remaining}} \par
        \setlength{\remaining}{\textwidth-\widthof{\small \textbf{Name Typed:}\quad\quad\quad\quad#1}}
        \noindent \textbf{Name Typed:}\quad\quad\quad\quad\underline{#1\hspace{\remaining}}\par
    \end{singlespacing}
}

\newcommand{\prevDegree}[3]{%
    #1 \uppercase{#2} (#3)}

%% ===================================================================================================
\newlength{\authline}
\newlength{\autharea}
\newlength{\dateline}
\newcommand\SignaturePage[6]{%
    \thispagestyle{empty}
    \begin{singlespacing}
        \vspace*{0.5 in}
            \centering
            % Title of thesis
            {\large\let\\\par\MakeUppercase{#1}\par}
            %Author section, and previous degrees
            \vspace{2\baselineskip}%
            BY\par
            \vspace{2\baselineskip}%
            \MakeUppercase{\authornames}\par
            #2\par
            \vspace{3\baselineskip}%
            SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS\\%
            % degree title
            FOR THE DEGREE OF \MakeUppercase{\degreeName}\\%
            % department name
            \MakeUppercase{\deptName}\\%
            \MakeUppercase{\univName}\par
    \end{singlespacing}
    \vfill

    \small
        \setlength{\authline}{3.75 in-\widthof{\textbf{Author: }}}
        \setlength{\autharea}{\widthof{\textbf{Author:} }+\authline}
        \setlength{\dateline}{5.75 in-\autharea-\widthof{ \textbf{Date:} }}


        \begin{singlespacing}
            \noindent \textbf{Signature of}\par
            \noindent \textbf{Author:} \underline{\hspace{\authline}} \textbf{Date:} \underline{\hspace{\dateline} } \par
        \end{singlespacing}
        \noindent #3
        \committeeMember{#4}
        \committeeMember{#5}
        \committeeMember{#6}
\cleardoublepage}

%% ===================================================================================================
\newcommand*{\titleF}[1]{\newcommand{\titleFmat}{#1}}
\newcommand*{\authors}[1]{\newcommand{\authornames}{#1}}
\newcommand*{\faculty}[2]{\newcommand{\facName}{#1}\newcommand{\facTitle}    {#2}}
\newcommand*{\degree}[2]{\newcommand{\degreeNameShort}{#1}\newcommand{\degreeName}{#2}}
\newcommand*{\department}[1]{\newcommand{\deptName}{#1}}
\newcommand*{\university}[1]{\newcommand{\univName}{#1}}

%% ===================================================================================================
\doublespacing
\setmarginsrb           { 1.5in}  % left margin
                        { 1.0in}  % top margin
                        { 1.0in}  % right margin
                        { 1.0in}  % bottom margin
                        {  20pt}  % head height
                        {0.25in}  % head sep
                        {   9pt}  % foot height
                        { 0.3in}  % foot sep

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .