I am using the MIT Thesis templates to write my thesis. I have created my own document class (that reflects the needs of the university I'm studying at) based on the mitthesis.cls version. Since it is possible to have more than one supervisor, the MIT class implements a vbox for storing the list of supervisors and a command to add them. The main problem I'm having is that I can't figure out how to horizontally center the vbox containing the supervisor list. It is always displayed aligned to the left margin. The code below is what I'm working with.

\supervisor{First Supervisor}   <= add 1st supervisor
\supervisor{Second Supervisor}  <= add 2nd supervisor
% store the supervisor list in a box
% since there can be more than one supervisor,
% we build the box for the titlepage
% as the user makes multiple calls
% to \supervisor
  {\unvbox\@titlesupervisor \vskip 10pt
% Print the supervisor list after the heading, author, etc.

I don't fully understand what \unvbox does, but I think it has something to do with vertical margin expansion to fit the text because if I remove the last \unvbox, the first supervisor disappears in the pdf.

Another problem I have is that I can't figure out is how to determine the number of entries in the supervisor list so I can decide whether to print "Supervisor" singularly or plurally? Do I need to implement a counter in the add command or can I get the number somehow from the supervisor#1 or titlesupervisor variables?

  • By using that code, you just get paragraphs, so lines as wide as the \hsize, so there's no hope of “centering” them.
    – egreg
    Dec 29 '15 at 11:51

I'd go with a different strategy:

\let\@titlesupervisor\@empty % initialize
    % do nothing, it's the first
    \@supervisorstrue % more than one supervisor

% Print the supervisor list after the heading, author, etc.
  • The supervisor list is left justified. How would I center align within the list?
    – gone
    Dec 29 '15 at 12:23
  • Fixed it by using {tabular}{@{}c@{}}. Later I found that I didn't need tabular at all; just needed to place a \\ after \@titlesupervisor. I did need to put a \par inbetween the 'Supervisor' label and the list.
    – gone
    Dec 29 '15 at 16:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.