I am working on customizing a thesis document class according to my needs. I am trying to renew the \maketitle command to modify my title page, and I am facing two problems:
I wish to define a newcommand for the logo in the title page. If there is no user-defined parameter, a default value called "logo.pdf" should be passed to the
\includegraphicscommand to load the default logo.\newcommand{\logo}[1][logo.pdf]{\includegraphics[width=40mm]{#1}}Is this correct?
There seems to be some problem with my class file, as I keep getting the
Undefined control sequence in \maketitleerror. Below is my document class:
mythesis.cls:
\NeedsTeXFormat{LaTeX2e} \ProvidesClass{mythesis}[2013/07/25 v1.0 My thesis class] \LoadClass[a4paper]{report} \RequirePackage{graphicx} % needed for logo and pictures \newcommand{\logo}[1][logo.pdf]{\includegraphics[width=40mm]{#1}} \newcommand{\college}[1][My School]{{#1}} \newcommand{\degree}[1][My degree]{{#1}} \newcommand{\university}[1][My university]{{#1}} \newenvironment{alwayssingle}{% \@restonecolfalse \if@twocolumn\@restonecoltrue\onecolumn \else\if@openright\cleardoublepage\else\clearpage\fi \fi}% {\if@restonecol\twocolumn \else\newpage\thispagestyle{empty}\fi} \makeatletter \renewcommand\maketitle{ \begin{alwayssingle} \begin{center} {\Huge {\bfseries {\@title}} \par} {\large \vspace*{10mm} {\@logo \par} \vspace*{15mm}} {{\Large \bf \@author} \par} {\large \vspace*{1ex} {{\@college} \par} {\large \@university \par} {\Large \it {\@degree} \par} \vspace*{2ex} {\today}} \end{center} \null\vfill \end{alwayssingle} } \makeatother thesis.tex:
\documentclass[12pt]{mythesis} \begin{document} \title{My research} \author{My name} \logo{logo_new.pdf} \maketitle \end{document} Any help on this is appreciated. P.S.: I am a newbie, especially in document class creation.