Theses, Books, Title pagesHow to create a new document variable

Classicthesis, Bachelor and Master thesis, PhD, Doctoral degree
Post Reply
templateuser
Posts: 679
Joined: Tue Mar 03, 2015 4:01 pm

How to create a new document variable

Post by templateuser »

Hi,

in my master thesis I will have two supervisors, and I would like to create the variables supervisor1 and supervisor2. To do so, I modify Thesis.cls like this:

Code: Select all

\newcommand*{\supervisor1}[1]{\def\supname1{#1}}
\newcommand*{\supervisor2}[1]{\def\supname2{#1}}
....
\supervisor1{Dr. James \textsc{Smith}}
\supervisor2{Dr. Johanes \textsc{Prat}}
and at main.tex I also duplicate the block containing the supervisor name

Code: Select all

\begin{minipage}{0.4\textwidth}
\begin{flushright} \large
\emph{Supervisor:} \\
\href{http://www.jamessmith.com}{\supname1} % Supervisor name - remove the \href bracket to remove the link  
\end{flushright}
\end{minipage}\\[3cm]
\begin{minipage}{0.4\textwidth}
\begin{flushright} \large
\emph{Supervisor:} \\
\href{http://www.johanesprat.com}{\supname2} % Supervisor name - remove the \href bracket to remove the link  
\end{flushright}
\end{minipage}\\[3cm]

But when I do so, I get many erors, such as:

Code: Select all

Missing \begin{document}. ...mand*{\supervisor1}[1]{\def\supname1{#1}}
Illegal parameter number in definition of \supname ...mand*{\supervisor1}[1]{\def\supname1{#1}}
Missing \begin{document}. \supervisor1
Any idea why what I am trying to do is not allowed?

Thanks a lot in advance

toni_

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

templateuser
Posts: 679
Joined: Tue Mar 03, 2015 4:01 pm

Re: How to create a new document variable

Post by templateuser »

Ok, digits are not allowed in macro names, it works when I use only letters in macro names.

toni_
Post Reply