# Is it possible to include document title from an included body file?

I have a dozen or so course notes that I am writing. I have one 'styling file' (call it Master.tex) containing the header, and begin/end document - it specifies fonts, included packages, defined environments, etc. I then include the body of the document I want to compile. This way, all of my notes have the same styling, formatting, and feel.

However, the title of the document is declared in the header, which is in Master.tex. I would like to have a way to have this title be read off of the included body file - is this or something similar possible?

-
Yes it is possible. However this all depends on how you specify the title and how you want to access it. So, really need you to compose a MWE that shows how the title is specified as a complete file, and how you want to use it. – Peter Grill Feb 24 '13 at 20:49

Here's a solution using the fancyhdr package. (Edited to fix header formatting and to move \title to master file.)

% Master.tex
%
\documentclass{article}

\newcommand{\thisdocument}{to be replaced}

\title{\thisdocument}

\usepackage{fancyhdr}
\pagestyle{fancy}

\begin{document}

% included file contains the next lines
\renewcommand{\thisdocument}{What is the title of this lecture?}

\maketitle
\newpage