modifying the maketitle

2,103 views
Skip to first unread message

rudra

unread,
Jan 1, 2011, 12:57:39 AM1/1/11
to LaTeX Users Group
Dear friends,
I am writing my thesis and have a problem:
in title page, I must have my supervisor's name and my affiliation.
affiliation is managed by authblk package but what about supevisor? I
tried to edit the cls file with inserting a \@supervisor after
\@author as:
\if@titlepage
\newcommand\maketitle{\begin{titlepage}%
\let\footnotesize\small
\let\footnoterule\relax
\let \footnote \thanks
\null\vfil
\vskip 60\p@
\begin{center}%
{\LARGE \@title \par}%
\vskip 3em%
{\large
\lineskip .75em%
\begin{tabular}[t]{c}%
\@author
\end{tabular}\par}%
\vskip 1.5em%
{\large
\lineskip .75em%
\begin{tabular}[t]{c}%
\@supervisor
\end{tabular}\par}%
\vskip 1.5em%
{\large \@date \par}% % Set date in \large size.
\end{center}\par
\@thanks
\vfil\null
\end{titlepage}%

and also in my defination in tex file:

\makeatletter
\def\thickhrulefill{\leavevmode \leaders \hrule height 1pt\hfill \kern
\z@}
\renewcommand{\maketitle}{\begin{titlepage}%
\let\footnotesize\small
\let\footnoterule\relax
\parindent \z@
\reset@font
\null
\vskip 10\p@
\hbox{\mbox{%
\hspace{4pt}%
\fbox{\includegraphics[scale=.1]{images/snb_logo}}%
\hspace{4pt}
}%
\setcounter{page}{0}

\vrule depth 0.9\textheight%
\mbox{\hspace{2em}}
\vtop{% %%%%%%%%%%%%%%%%%%
\vskip 0\p@
\begin{flushleft}
\huge \bfseries \@title \par
\end{flushleft}
\begin{flushleft}
\Large \@supervisor \par
\end{flushleft}
\begin{flushleft}
\Large \@author \par
\end{flushleft}
\vskip 80\p@

\vfil
}}
\null

\end{titlepage}%

but it doesnot help:
$ pdflatex 5k.tex
This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6)
%&-line parsing enabled.
entering extended mode
(./5k.tex
LaTeX2e <2005/12/01>
Babel <v3.8h> and hyphenation patterns for english, usenglishmax,
dumylang, noh
yphenation, arabic, basque, bulgarian, coptic, welsh, czech, slovak,
german, ng
erman, danish, esperanto, spanish, catalan, galician, estonian, farsi,
finnish,
french, greek, monogreek, ancientgreek, croatian, hungarian,
interlingua, ibyc
us, indonesian, icelandic, italian, latin, mongolian, dutch, norsk,
polish, por
tuguese, pinyin, romanian, russian, slovenian, uppersorbian, serbian,
swedish,
turkish, ukenglish, ukrainian, loaded.
(./MyThesis.cls
Document Class: MyThesis 2005/09/16 v1.4f Standard LaTeX document
class
(/usr/share/texmf/tex/latex/base/bk10.clo))
! Undefined control sequence.
l.57 \supervisor
{AM}
?

where MyThesis is derived from book.cls.
what is the error?

Peter Flynn

unread,
Jan 1, 2011, 11:00:33 AM1/1/11
to latexus...@googlegroups.com
On Sat, Jan 1, 2011 at 5:57 AM, rudra <bnrj....@gmail.com> wrote:
Dear friends,
I am writing my thesis and have a problem:
in title page, I must have my supervisor's name and my affiliation.
affiliation is managed by authblk package but what about supevisor? I
tried to edit the cls file with inserting a \@supervisor after

Nearly but not quite. That changed \maketitle, but you then changed it again in your .tex file.

Never, never, never modify the standard distribution files (eg class files). Never. Really.
Instead, always put your changes and additions in your Preamble, or in a private style file, or even make a private class file for theses if your institution doesn't supply one. 

So first off, undo all changes you made to the class file so that it's back where it was.

Then do it all in your Preamble instead, after \makeatletter.
The problem is that you didn't define \@supervisor. The way to do this is to add to your Preamble, after the \makeatletter:

\def\@supervisor{No supervisor defined}
\newcommand{\supervisor}[1]{\gdef\@supervisor{#1}}

Then use \supervisor{AM} or whatever along with your \title, \author, \date, etc. This is how \title, \author, etc all work.


add your \@supervisor stuff here or wherever it should go.
 
       \vskip 80\p@

       \vfil
       }}
   \null

 \end{titlepage}%

I don't know what authblk does, and I'm away from my own machine right now, but check that you are not overwriting what it does: better still, copy its redefinition of \maketitle and change that yo add your own \@supervisor.

///Peter

rudra

unread,
Jan 1, 2011, 12:55:38 PM1/1/11
to LaTeX Users Group
Dear Peter,
Thanks for the reply. Its working great. With one problem(pre-
existing)

the preample I showd, produces 1 blank page at the beginning...i.e.
before the titlepage. do you see any reason of that or a way of
avoiding this?

Peter Flynn

unread,
Jan 1, 2011, 3:05:09 PM1/1/11
to latexus...@googlegroups.com

What document class are you using? I recommend report.cls, because it allows an Abstract (usually a requirement for a thesis) whereas book.cls does not. Article class is not usable for theses.

You have added \begin{titlepage} to your \maketitle, but report and book classes already use a separate page for the title, so the titlepage environment is not needed.

///Peter

Reply all
Reply to author
Forward
0 new messages