# \huge and \newcommand variable don't work together

I want do define a project name somewhere and use it all through my document – but I get problems when trying to use my project name in the document title which should be quite big, so I tried this way:

\newcommand{\projectName}{MyProject}


...

\begin{titlepage}
\begin{center}

\HRule \\[1.2cm] % horizontal line
{\huge \bfseries \projectName{}}\\[0.5cm] % title
\HRule \\[1.5cm] % Horizontal line

\end{center}
\end{titlepage}


But what I get when I try to set the file is the following:

./TitlePage.tex:lineNumberWhereProjectNameIsUsed: Undefined control sequence.


Does anyone know what I do wrong or how I can solve this?

Thanks in advice for all helpers!

EDIT: Here's the full main .tex files content (in which the TitlePage.tex above is included):

\documentclass[11pt, a4paper, oneside]{Thesis} % Paper size, default font size and one-sided paper

\graphicspath{{./Pictures/}} % Specifies the directory where pictures are stored

\usepackage[square, numbers, comma, sort&compress]{natbib} % Use the natbib reference package - read up on this to edit the reference style; if you want text (e.g. Smith et al., 2012) for the in-text references (instead of numbers), remove 'numbers'
\hypersetup{urlcolor=blue, colorlinks=true} % Colors hyperlinks in blue - change to black if annoying
\usepackage[ngerman]{babel}     % Sprachen
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[german]{varioref}
\hyphenation{}
\usepackage{hyperref}
\usepackage[toc]{glossaries}
\makeglossaries
\input{./GlossaryEntries}
\setcounter{tocdepth}{1}

\begin{document}
\selectlanguage{ngerman}    % set language to german

\frontmatter % Use roman page numbering style (i, ii, iii, iv...) for the pre-content pages

\setstretch{1.3} % Line spacing of 1.3

% Define the page headers using the FancyHdr package and set up for one-sided printing
\rhead{\thepage} % Sets the right side header to show the page number

\pagestyle{fancy} % Finally, use the "fancy" page style to implement the FancyHdr headers

\newcommand{\HRule}{\rule{\linewidth}{0.5mm}} % New command to make the lines in the title page

%----------------------------------------------------------------------------------------
%   TITLE PAGE
%----------------------------------------------------------------------------------------

\include{TitlePage}

\end{document}

-
We really need to see a fully compilable example (starting \documentclass and finishing \end{document}) –  Joseph Wright Nov 12 '12 at 20:10
There you are, I've added a fully compilable example. –  CGee Nov 12 '12 at 20:17
Sorry, but the FunctSpec class is unknown to me. –  egreg Nov 12 '12 at 20:18
Does it help, when I quote the following from the file header: This is file Thesis.cls', based on 'ECSthesis.cls', by Steve R. Gunn. (I only changed its name to fit to the project. I've edited the question with the correct name.) –  CGee Nov 12 '12 at 20:19
@Dschee: You really should eliminate anything that is not required to reproduce the problem to get the M part of MWE. First try article class to see if the problem is still there, and then start removing packages... –  Peter Grill Nov 12 '12 at 20:25

It looks like you are using this thesis template. A minimal working example of what you want is:

\documentclass[11pt,a4paper,oneside]{Thesis}

\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}

\begin{document}

\newcommand{\projectName}{MyProject}

\begin{titlepage}
\begin{center}

\HRule \\[1.2cm]
{\huge \bfseries \projectName{}}\\[0.5cm]
\HRule \\[1.5cm]

\end{center}
\end{titlepage}

\end{document}


which produces a page containing

Placing this in your code example and only commenting out the line \input{./GlossaryEntries} gives the file below that compiles without problem and produces a similar result.

\documentclass[11pt, a4paper, oneside]{Thesis} % Paper size, default font size and one-sided paper

\graphicspath{{./Pictures/}} % Specifies the directory where pictures are stored

\usepackage[square, numbers, comma, sort&compress]{natbib} % Use the natbib reference package - read up on this to edit the reference style; if you want text (e.g. Smith et al., 2012) for the in-text references (instead of numbers), remove 'numbers'
\hypersetup{urlcolor=blue, colorlinks=true} % Colors hyperlinks in blue - change to black if annoying
\usepackage[ngerman]{babel}     % Sprachen
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[german]{varioref}
\hyphenation{}
\usepackage{hyperref}
\usepackage[toc]{glossaries}
\makeglossaries
%\input{./GlossaryEntries}
\setcounter{tocdepth}{1}

\begin{document}
\selectlanguage{ngerman}    % set language to german

\frontmatter % Use roman page numbering style (i, ii, iii, iv...) for the pre-content pages

\setstretch{1.3} % Line spacing of 1.3

% Define the page headers using the FancyHdr package and set up for one-sided printing
\rhead{\thepage} % Sets the right side header to show the page number

\pagestyle{fancy} % Finally, use the "fancy" page style to implement the FancyHdr headers

\newcommand{\HRule}{\rule{\linewidth}{0.5mm}} % New command to make the lines in the title page

%----------------------------------------------------------------------------------------
%   TITLE PAGE
%----------------------------------------------------------------------------------------

\newcommand{\projectName}{MyProject}

\begin{titlepage}
\begin{center}

\HRule \\[1.2cm] % horizontal line
{\huge \bfseries \projectName{}}\\[0.5cm] % title
\HRule \\[1.5cm] % Horizontal line

\end{center}
\end{titlepage}

\end{document}
`
-